All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gre: fix return value of gre_rcv
@ 2016-03-23  1:34 Haishuang Yan
  2016-03-23 18:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Haishuang Yan @ 2016-03-23  1:34 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris, Patrick McHardy
  Cc: netdev, linux-kernel, Haishuang Yan

Dropped skb's should be documented by an appropriate return value.
Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.

Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
---
 net/ipv4/ip_gre.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 31936d3..1dc0cdb 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -432,12 +432,12 @@ static int gre_rcv(struct sk_buff *skb)
 		goto drop;
 
 	if (ipgre_rcv(skb, &tpi) == PACKET_RCVD)
-		return 0;
+		return NET_RX_SUCCESS;
 
 	icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0);
 drop:
 	kfree_skb(skb);
-	return 0;
+	return NET_RX_DROP;
 }
 
 static __sum16 gre_checksum(struct sk_buff *skb)
-- 
1.8.3.1

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

* Re: [PATCH] gre: fix return value of gre_rcv
  2016-03-23  1:34 [PATCH] gre: fix return value of gre_rcv Haishuang Yan
@ 2016-03-23 18:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-23 18:25 UTC (permalink / raw)
  To: yanhaishuang; +Cc: kuznet, jmorris, kaber, netdev, linux-kernel

From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Wed, 23 Mar 2016 09:34:43 +0800

> Dropped skb's should be documented by an appropriate return value.
> Use the correct NET_RX_DROP and NET_RX_SUCCESS values for that reason.
> 
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

IP protocol handlers do not use NET_RX_* values like this.

They either return 0, to finish processing, or a negative value which
indicates the negated protocol number to use to demux in the protocol
switch again.

Many of your patches seem very straightforward, but usually upon
further inspection severe fundamental issues with your changes are
found because you don't know what the proper semantics are for the
pieces of infrastructure you are touching.

Therefore, reviewing your seemingly trivial changes is a large
inventment of time and energy.

Please put more care into your changes, or else people will simply
stop reviewing your work and instead put their effort into submissions
which are more properly researched and easier to verify.

Thanks.

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

end of thread, other threads:[~2016-03-23 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23  1:34 [PATCH] gre: fix return value of gre_rcv Haishuang Yan
2016-03-23 18:25 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.