* [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy
@ 2016-09-02 12:49 Liping Zhang
2016-09-02 13:00 ` Florian Westphal
2016-09-05 17:29 ` Pablo Neira Ayuso
0 siblings, 2 replies; 3+ messages in thread
From: Liping Zhang @ 2016-09-02 12:49 UTC (permalink / raw)
To: pablo; +Cc: netfilter-devel, Liping Zhang
From: Liping Zhang <liping.zhang@spreadtrum.com>
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>
---
net/netfilter/nf_tables_trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_tables_trace.c b/net/netfilter/nf_tables_trace.c
index 39eb1cc..fa24a5b 100644
--- a/net/netfilter/nf_tables_trace.c
+++ b/net/netfilter/nf_tables_trace.c
@@ -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;
}
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy
2016-09-02 12:49 [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy Liping Zhang
@ 2016-09-02 13:00 ` Florian Westphal
2016-09-05 17:29 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2016-09-02 13:00 UTC (permalink / raw)
To: Liping Zhang; +Cc: pablo, netfilter-devel, Liping Zhang
Liping Zhang <zlpnobody@163.com> wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> 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.
It is however handled as u16, not u32. Care to send a patch for this as
well? Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy
2016-09-02 12:49 [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy Liping Zhang
2016-09-02 13:00 ` Florian Westphal
@ 2016-09-05 17:29 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2016-09-05 17:29 UTC (permalink / raw)
To: Liping Zhang; +Cc: netfilter-devel, Liping Zhang
On Fri, Sep 02, 2016 at 08:49:12PM +0800, Liping Zhang wrote:
> From: Liping Zhang <liping.zhang@spreadtrum.com>
>
> 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.
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-05 17:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-02 12:49 [PATCH nf] netfilter: nf_tables_trace: fix endiness when dump chain policy Liping Zhang
2016-09-02 13:00 ` Florian Westphal
2016-09-05 17:29 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).