[NET]: Fix comparisons of unsigned < 0.
Recent gcc versions emit warnings when unsigned variables are compared < 0 or >= 0. Signed-off-by: Bill Nottingham <notting@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
60468d5b5b
commit
75202e7689
@@ -177,8 +177,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,
|
||||
|
||||
protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum,
|
||||
(*pskb)->len - extoff);
|
||||
if (protoff < 0 || protoff > (*pskb)->len ||
|
||||
pnum == NEXTHDR_FRAGMENT) {
|
||||
if (protoff > (*pskb)->len || pnum == NEXTHDR_FRAGMENT) {
|
||||
DEBUGP("proto header not found\n");
|
||||
return NF_ACCEPT;
|
||||
}
|
||||
|
@@ -168,8 +168,7 @@ icmpv6_error_message(struct sk_buff *skb,
|
||||
skb->len - inip6off
|
||||
- sizeof(struct ipv6hdr));
|
||||
|
||||
if ((inprotoff < 0) || (inprotoff > skb->len) ||
|
||||
(inprotonum == NEXTHDR_FRAGMENT)) {
|
||||
if ((inprotoff > skb->len) || (inprotonum == NEXTHDR_FRAGMENT)) {
|
||||
DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n");
|
||||
return -NF_ACCEPT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user