diff mbox

ipv6: correct return on ipv6_rcv() packet drop

Message ID 20090707065624.ee55809e.lk-netdev@lk-netdev.nosense.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Mark Smith July 6, 2009, 9:26 p.m. UTC
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.

Signed-off-by: Mark Smith <markzzzsmith@yahoo.com.au>


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller July 7, 2009, 1:09 a.m. UTC | #1
From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
Date: Tue, 7 Jul 2009 06:56:24 +0930

> 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.
> 
> Signed-off-by: Mark Smith <markzzzsmith@yahoo.com.au>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Smith July 7, 2009, 9:20 a.m. UTC | #2
Hi Dave,

On Mon, 06 Jul 2009 18:09:45 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
> Date: Tue, 7 Jul 2009 06:56:24 +0930
> 
> > 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.
> > 
> > Signed-off-by: Mark Smith <markzzzsmith@yahoo.com.au>
> 
> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 7, 2009, 3:52 p.m. UTC | #3
From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
Date: Tue, 7 Jul 2009 18:50:15 +0930

> 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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Smith July 7, 2009, 9:04 p.m. UTC | #4
On Tue, 07 Jul 2009 08:52:19 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:

> From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
> Date: Tue, 7 Jul 2009 18:50:15 +0930
> 
> > 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.

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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller July 8, 2009, 1:34 a.m. UTC | #5
From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
Date: Wed, 8 Jul 2009 06:34:13 +0930

> On Tue, 07 Jul 2009 08:52:19 -0700 (PDT)
> David Miller <davem@davemloft.net> wrote:
> 
>> From: Mark Smith <lk-netdev@lk-netdev.nosense.org>
>> Date: Tue, 7 Jul 2009 18:50:15 +0930
>> 
>> > 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.
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index 8f04bd9..bb05c17 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -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;
 }
 
 /*