netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ipv6: correct return on ipv6_rcv() packet drop
@ 2009-07-06 21:26 Mark Smith
  2009-07-07  1:09 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Smith @ 2009-07-06 21:26 UTC (permalink / raw)
  To: netdev; +Cc: davem, pekkas, yoshfuji

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>


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;
 }
 
 /*

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] ipv6: correct return on ipv6_rcv() packet drop
  2009-07-06 21:26 [patch] ipv6: correct return on ipv6_rcv() packet drop Mark Smith
@ 2009-07-07  1:09 ` David Miller
  2009-07-07  9:20   ` Mark Smith
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-07-07  1:09 UTC (permalink / raw)
  To: lk-netdev; +Cc: netdev, pekkas, yoshfuji

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ipv6: correct return on ipv6_rcv() packet drop
  2009-07-07  1:09 ` David Miller
@ 2009-07-07  9:20   ` Mark Smith
  2009-07-07 15:52     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Smith @ 2009-07-07  9:20 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, pekkas, yoshfuji

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ipv6: correct return on ipv6_rcv() packet drop
  2009-07-07  9:20   ` Mark Smith
@ 2009-07-07 15:52     ` David Miller
  2009-07-07 21:04       ` Mark Smith
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2009-07-07 15:52 UTC (permalink / raw)
  To: lk-netdev; +Cc: netdev, pekkas, yoshfuji

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ipv6: correct return on ipv6_rcv() packet drop
  2009-07-07 15:52     ` David Miller
@ 2009-07-07 21:04       ` Mark Smith
  2009-07-08  1:34         ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Smith @ 2009-07-07 21:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, pekkas, yoshfuji

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] ipv6: correct return on ipv6_rcv() packet drop
  2009-07-07 21:04       ` Mark Smith
@ 2009-07-08  1:34         ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2009-07-08  1:34 UTC (permalink / raw)
  To: lk-netdev; +Cc: netdev, pekkas, yoshfuji

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-08  1:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-06 21:26 [patch] ipv6: correct return on ipv6_rcv() packet drop Mark Smith
2009-07-07  1:09 ` David Miller
2009-07-07  9:20   ` Mark Smith
2009-07-07 15:52     ` David Miller
2009-07-07 21:04       ` Mark Smith
2009-07-08  1:34         ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).