All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] udp6: fix encap return code for resubmitting
@ 2018-10-17  9:44 Paolo Abeni
  2018-10-18  5:27 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Abeni @ 2018-10-17  9:44 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller

The commit eb63f2964dbe ("udp6: add missing checks on edumux packet
processing") used the same return code convention of the ipv4 counterpart,
but ipv6 uses the opposite one: positive values means resubmit.

This change addresses the issue, using positive return value for
resubmitting. Also update the related comment, which was broken, too.

Fixes: eb63f2964dbe ("udp6: add missing checks on edumux packet processing")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Note: I could not find any in kernel udp6 encap using the above
feature, that would explain why nobody complained so far...
---
 net/ipv6/udp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 28c4aa5078fc..b36694b6716e 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -766,11 +766,9 @@ static int udp6_unicast_rcv_skb(struct sock *sk, struct sk_buff *skb,
 
 	ret = udpv6_queue_rcv_skb(sk, skb);
 
-	/* a return value > 0 means to resubmit the input, but
-	 * it wants the return to be -protocol, or 0
-	 */
+	/* a return value > 0 means to resubmit the input */
 	if (ret > 0)
-		return -ret;
+		return ret;
 	return 0;
 }
 
-- 
2.17.2

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

* Re: [PATCH net] udp6: fix encap return code for resubmitting
  2018-10-17  9:44 [PATCH net] udp6: fix encap return code for resubmitting Paolo Abeni
@ 2018-10-18  5:27 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-10-18  5:27 UTC (permalink / raw)
  To: pabeni; +Cc: netdev

From: Paolo Abeni <pabeni@redhat.com>
Date: Wed, 17 Oct 2018 11:44:04 +0200

> The commit eb63f2964dbe ("udp6: add missing checks on edumux packet
> processing") used the same return code convention of the ipv4 counterpart,
> but ipv6 uses the opposite one: positive values means resubmit.
> 
> This change addresses the issue, using positive return value for
> resubmitting. Also update the related comment, which was broken, too.
> 
> Fixes: eb63f2964dbe ("udp6: add missing checks on edumux packet processing")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> Note: I could not find any in kernel udp6 encap using the above
> feature, that would explain why nobody complained so far...

Applied.

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

end of thread, other threads:[~2018-10-18 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17  9:44 [PATCH net] udp6: fix encap return code for resubmitting Paolo Abeni
2018-10-18  5:27 ` 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.