Skip to content

Commit

Permalink
netfilter: nft_reject: fix endianness in dump function
Browse files Browse the repository at this point in the history
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 <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Eric Leblond authored and Pablo Neira Ayuso committed Dec 12, 2013
1 parent f01b392 commit a3adadf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/nft_reject_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a3adadf

Please sign in to comment.