Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nf_tables_trace: fix endiness when dump chain policy

NFTA_TRACE_POLICY attribute is big endian, but we forget to call
htonl to convert it. Fortunately, this attribute is parsed as big
endian in libnftnl.

Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Liping Zhang and committed by
Pablo Neira Ayuso
5210d393 6e1ce3c3

+1 -1
+1 -1
net/netfilter/nf_tables_trace.c
··· 237 237 break; 238 238 case NFT_TRACETYPE_POLICY: 239 239 if (nla_put_be32(skb, NFTA_TRACE_POLICY, 240 - info->basechain->policy)) 240 + htonl(info->basechain->policy))) 241 241 goto nla_put_failure; 242 242 break; 243 243 }