nft: reject: fix endianess
Subsystems (2)
cover nft: reject: fix endianess
Hello,
Here's a small fix for 3.13. I'm not sure it is necessary but getting it in 3.13 will avoid us some possible backward compatibility issues later.
BR,
--
Eric
PATCH 1/1 netfilter: nft: 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.
Signed-off-by Eric Leblond <[email protected]>
--- net/ipv4/netfilter/nft_reject_ipv4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/nft_reject_ipv4.c +1 -1
@@ -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) {
Signature · 1 line
1.8.5.1
Re: [PATCH] netfilter: nft: fix endianness in dump function
Quoted 2 lines · Eric Leblond
The dump function in
nft_reject_ipv4was not converting a u32 field to network order before sending it to userspace.
Good catch. I've been reviewing other but I haven't seen any similar endianess issue.
Applied to the nf tree, thanks Eric.