netfilter: nf_tables_trace: fix endiness when dump chain policy
Subsystems (2)
PATCH 1/1 netfilter: nf_tables_trace: fix endiness when dump chain policy
From: Liping Zhang <[email protected]>
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 <[email protected]>
--- net/netfilter/nf_tables_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_trace.c +1 -1
@@ -237,7 +237,7 @@ void nft_trace_notify(struct nft_traceinfo *info)break ;case NFT_TRACETYPE_POLICY :if (nla_put_be32 (skb,NFTA_TRACE_POLICY , - info->basechain->policy)) +htonl (info->basechain->policy))) goto nla_put_failure;break ; }
Signature · 1 line
2.5.5
Florian Westphal
maintainerQuoted 5 lines · Liping Zhang
From: Liping Zhang <[email protected]>
NFTA_TRACE_POLICYattribute is big endian, but we forget to call htonl to convert it. Fortunately, this attribute is parsed as big endian in libnftnl.
It is however handled as u16, not u32. Care to send a patch for this as well? Thanks!
Quoted 5 lines · Liping Zhang
From: Liping Zhang <[email protected]>
NFTA_TRACE_POLICYattribute is big endian, but we forget to call htonl to convert it. Fortunately, this attribute is parsed as big endian in libnftnl.
Applied, thanks!