Skip to content

Commit

Permalink
udp6: fix encap return code for resubmitting
Browse files Browse the repository at this point in the history
The commit eb63f29 ("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: eb63f29 ("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>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Oct 18, 2018
1 parent 9b3bc7d commit 84dad55
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv6/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 84dad55

Please sign in to comment.