Skip to contentSkip to conversation

ipv6: correct return on ipv6_rcv() packet drop

PATCH Applied Mark Smith 2 participants 6 messages Jul 6, 2009 – Jul 8, 2009

Subsystems (3)
lore
Share & tools
lore

Mark Smith

author
#0 lore raw

PATCH 1/1 ipv6: correct return on ipv6_rcv() packet drop

The routine ipv6_rcv() uses magic number 0 for a return when it drops a packet. This corresponds to NET_RX_SUCCESS, which is obviously incorrect. Correct this by using NET_RX_DROP instead.

ps. It isn't exactly clear who the IPv6 maintainers are, apologies if I've missed any.

net/ipv6/ip6_input.c +3 -3
index 8f04bd9..bb05c17 100644
@@ -63,7 +63,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 
 	if (skb->pkt_type == PACKET_OTHERHOST) {
 		kfree_skb(skb);
-		return 0;
+		return NET_RX_DROP;
 	}
 
 	rcu_read_lock();
@@ -133,7 +133,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
 		if (ipv6_parse_hopopts(skb) < 0) {
 			IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INHDRERRORS);
 			rcu_read_unlock();
-			return 0;
+			return NET_RX_DROP;
 		}
 	}
 
@@ -146,7 +146,7 @@ err:
 drop:
 	rcu_read_unlock();
 	kfree_skb(skb);
-	return 0;
+	return NET_RX_DROP;
 }
 
 /*
maintainer Applied
#1 lore raw

From: Mark Smith <[email protected]>
Date: Tue, 7 Jul 2009 06:56:24 +0930

Quoted 8 lines

The routine ipv6_rcv() uses magic number 0 for a return when it drops a packet. This corresponds to NET_RX_SUCCESS, which is obviously incorrect. Correct this by using NET_RX_DROP instead.

ps. It isn't exactly clear who the IPv6 maintainers are, apologies if I've missed any.

Applied.

author
#2 lore raw

Hi Dave,

Quoted 7 lines · On Mon, 06 Jul 2009 18:09:45 -0700 (PDT) David Miller <[email protected]>…

From: Mark Smith <[email protected]>
Date: Tue, 7 Jul 2009 06:56:24 +0930

Quoted 4 lines

The routine ipv6_rcv() uses magic number 0 for a return when it drops a packet. This corresponds to NET_RX_SUCCESS, which is obviously incorrect. Correct this by using NET_RX_DROP instead.

Quoted 6 lines
Quoted 4 lines

ps. It isn't exactly clear who the IPv6 maintainers are, apologies if I've missed any.

Applied.

Today I came across this earlier partial version of what I independently identified and submitted, so I shouldn't get full credit for it:

http://lkml.indiana.edu/hypermail/linux/kernel/0804.1/2393.html

Regards,
Mark.

maintainer
#3 lore raw

From: Mark Smith <[email protected]>
Date: Tue, 7 Jul 2009 18:50:15 +0930

Quoted 5 lines

Today I came across this earlier partial version of what I independently identified and submitted, so I shouldn't get full credit for it:

http://lkml.indiana.edu/hypermail/linux/kernel/0804.1/2393.html

I already pushed your change out to my public tree so we're past the point of being able to modify the commit message.

We'll just try to be more careful next time.

author
#4 lore raw
Quoted 7 lines · On Tue, 07 Jul 2009 08:52:19 -0700 (PDT) David Miller <[email protected]>…

From: Mark Smith <[email protected]>
Date: Tue, 7 Jul 2009 18:50:15 +0930

Quoted 4 lines

Today I came across this earlier partial version of what I independently identified and submitted, so I shouldn't get full credit for it:

Quoted 6 lines
Quoted 1 line

http://lkml.indiana.edu/hypermail/linux/kernel/0804.1/2393.html

I already pushed your change out to my public tree so we're past the point of being able to modify the commit message.

We'll just try to be more careful next time.

Is there an easier way to avoid this, other than a google search? I happened to discover it by doing a google search when I was at work, to see how my patch was going. I suppose possibly not.

maintainer
#5 lore raw

From: Mark Smith <[email protected]>
Date: Wed, 8 Jul 2009 06:34:13 +0930

Quoted 12 lines
Quoted 9 lines · On Tue, 07 Jul 2009 08:52:19 -0700 (PDT) David Miller <[email protected]>…

From: Mark Smith <[email protected]>
Date: Tue, 7 Jul 2009 18:50:15 +0930

Quoted 5 lines

Today I came across this earlier partial version of what I independently identified and submitted, so I shouldn't get full credit for it:

http://lkml.indiana.edu/hypermail/linux/kernel/0804.1/2393.html

Quoted 8 lines
Quoted 4 lines

I already pushed your change out to my public tree so we're past the point of being able to modify the commit message.

We'll just try to be more careful next time.

Is there an easier way to avoid this, other than a google search? I happened to discover it by doing a google search when I was at work, to see how my patch was going. I suppose possibly not.

Perhaps some day we can have more powerful searching mechanisms on patchwork, who knows.

Feel free to discuss such ideas on the patchwork mailing list:

https://ozlabs.org/mailman/listinfo/patchwork