From: Eric Leblond Date: Thu, 12 Dec 2013 07:51:59 +0000 (+0100) Subject: netfilter: nft_reject: fix endianness in dump function X-Git-Tag: upstream/snapshot3+hdmi~3761^2~5^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a3adadf3018102c24754e0b53a5515c40fbaff4a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git netfilter: nft_reject: fix endianness in dump function The dump function in nft_reject_ipv4 was not converting a u32 field to network order before sending it to userspace, this needs to happen for consistency with other nf_tables and nfnetlink subsystems. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/ipv4/netfilter/nft_reject_ipv4.c b/net/ipv4/netfilter/nft_reject_ipv4.c index fff5ba1..4a5e94a 100644 --- a/net/ipv4/netfilter/nft_reject_ipv4.c +++ b/net/ipv4/netfilter/nft_reject_ipv4.c @@ -72,7 +72,7 @@ static int nft_reject_dump(struct sk_buff *skb, const struct nft_expr *expr) { const struct nft_reject *priv = nft_expr_priv(expr); - if (nla_put_be32(skb, NFTA_REJECT_TYPE, priv->type)) + if (nla_put_be32(skb, NFTA_REJECT_TYPE, htonl(priv->type))) goto nla_put_failure; switch (priv->type) {