linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: conntrack: get rid of double sizeof
@ 2018-09-19 12:21 zhong jiang
  2018-09-19 12:40 ` Florian Westphal
  2018-09-20 16:22 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-19 12:21 UTC (permalink / raw)
  To: davem; +Cc: kadlec, pablo, fw, netfilter-devel, netdev, linux-kernel

sizeof(sizeof()) is quite strange and does not seem to be what
is wanted here.

The issue is detected with the help of Coccinelle.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 net/netfilter/nf_conntrack_proto_tcp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index b4bdf9e..247b897 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -1213,8 +1213,8 @@ static int tcp_to_nlattr(struct sk_buff *skb, struct nlattr *nla,
 #define TCP_NLATTR_SIZE	( \
 	NLA_ALIGN(NLA_HDRLEN + 1) + \
 	NLA_ALIGN(NLA_HDRLEN + 1) + \
-	NLA_ALIGN(NLA_HDRLEN + sizeof(sizeof(struct nf_ct_tcp_flags))) + \
-	NLA_ALIGN(NLA_HDRLEN + sizeof(sizeof(struct nf_ct_tcp_flags))))
+	NLA_ALIGN(NLA_HDRLEN + sizeof(struct nf_ct_tcp_flags)) + \
+	NLA_ALIGN(NLA_HDRLEN + sizeof(struct nf_ct_tcp_flags)))
 
 static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct)
 {
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: conntrack: get rid of double sizeof
  2018-09-19 12:21 [PATCH] netfilter: conntrack: get rid of double sizeof zhong jiang
@ 2018-09-19 12:40 ` Florian Westphal
  2018-09-20 16:22 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2018-09-19 12:40 UTC (permalink / raw)
  To: zhong jiang
  Cc: davem, kadlec, pablo, fw, netfilter-devel, netdev, linux-kernel

zhong jiang <zhongjiang@huawei.com> wrote:
> sizeof(sizeof()) is quite strange and does not seem to be what
> is wanted here.

Fixes: 39215846740a9f ("netfilter: conntrack: remove nlattr_size pointer from l4proto trackers")
Acked-by: Florian Westphal <fw@strlen.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] netfilter: conntrack: get rid of double sizeof
  2018-09-19 12:21 [PATCH] netfilter: conntrack: get rid of double sizeof zhong jiang
  2018-09-19 12:40 ` Florian Westphal
@ 2018-09-20 16:22 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2018-09-20 16:22 UTC (permalink / raw)
  To: zhong jiang; +Cc: davem, kadlec, fw, netfilter-devel, netdev, linux-kernel

On Wed, Sep 19, 2018 at 08:21:11PM +0800, zhong jiang wrote:
> sizeof(sizeof()) is quite strange and does not seem to be what
> is wanted here.
> 
> The issue is detected with the help of Coccinelle.

Applied to nf, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-20 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 12:21 [PATCH] netfilter: conntrack: get rid of double sizeof zhong jiang
2018-09-19 12:40 ` Florian Westphal
2018-09-20 16:22 ` 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).