]> git.baikalelectronics.ru Git - kernel.git/commitdiff
netfilter: conntrack: comparison of unsigned in cthelper confirmation
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 27 May 2020 10:17:34 +0000 (12:17 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 27 May 2020 11:39:06 +0000 (13:39 +0200)
net/netfilter/nf_conntrack_core.c: In function nf_confirm_cthelper:
net/netfilter/nf_conntrack_core.c:2117:15: warning: comparison of unsigned expression in < 0 is always false [-Wtype-limits]
 2117 |   if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
      |               ^

ipv6_skip_exthdr() returns a signed integer.

Reported-by: Colin Ian King <colin.king@canonical.com>
Fixes: 8ecaf31ebe28 ("netfilter: nfnetlink_cthelper: unbreak userspace helper support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_core.c

index e3b054a2f796fd861ceaad17b8112bafd3df2b60..bb72ca5f3999aa49b39aea824b6db1cfdb2dd46b 100644 (file)
@@ -2092,7 +2092,7 @@ static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct,
 {
        const struct nf_conntrack_helper *helper;
        const struct nf_conn_help *help;
-       unsigned int protoff;
+       int protoff;
 
        help = nfct_help(ct);
        if (!help)