udp6: fix encap return code for resubmitting
authorPaolo Abeni <pabeni@redhat.com>
Wed, 17 Oct 2018 09:44:04 +0000 (11:44 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2018 05:26:53 +0000 (22:26 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/udp.c

index 28c4aa5078fcb34b773875d28790e367a5c98ad6..b36694b6716e3ce9828987337138626c06f74d5b 100644 (file)
@@ -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;
 }