Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75202e76 authored by Bill Nottingham's avatar Bill Nottingham Committed by David S. Miller
Browse files

[NET]: Fix comparisons of unsigned < 0.



Recent gcc versions emit warnings when unsigned variables are
compared < 0 or >= 0.

Signed-off-by: default avatarBill Nottingham <notting@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60468d5b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -736,8 +736,7 @@ static int vlan_ioctl_handler(void __user *arg)
	case SET_VLAN_NAME_TYPE_CMD:
		if (!capable(CAP_NET_ADMIN))
			return -EPERM;
		if ((args.u.name_type >= 0) &&
		    (args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
		if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
			vlan_name_type = args.u.name_type;
			err = 0;
		} else {
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
	int error = 0, cnt = 0;
	unsigned char *tbuf;

	if (!buf || len < 0)
	if (!buf)
		return -EINVAL;

	if (len == 0)
+1 −2
Original line number Diff line number Diff line
@@ -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;
	}
+1 −2
Original line number Diff line number Diff line
@@ -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;
	}
+1 −2
Original line number Diff line number Diff line
@@ -164,8 +164,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
				printk("offset must be on 32 bit boundaries\n");
				goto bad;
			}
			if (skb->len < 0 ||
			    (offset > 0 && offset > skb->len)) {
			if (offset > 0 && offset > skb->len) {
				printk("offset %d cant exceed pkt length %d\n",
				       offset, skb->len);
				goto bad;
Loading