]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: Fix nexthdr for reinjection
authorTom Herbert <tom@herbertland.com>
Wed, 18 May 2016 16:06:11 +0000 (09:06 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 May 2016 22:03:16 +0000 (18:03 -0400)
commitbb4d6c662bc7921413ac1c504246d2f0d89e8523
treef847f686cdcedbc86ce2e2e0ba469f17ca96e3d0
parent2a0a3b1544d161e4347656dc1a9eb57b7fdd2422
ipv6: Fix nexthdr for reinjection

In ip6_input_finish the nexthdr protocol is retrieved from the
next header offset that is returned in the cb of the skb.
This method does not work for UDP encapsulation that may not
even have a concept of a nexthdr field (e.g. FOU).

This patch checks for a final protocol (INET6_PROTO_FINAL) when a
protocol handler returns > 0. If the protocol is not final then
resubmission is performed on nhoff value. If the protocol is final
then the nexthdr is taken to be the return value.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/ip6_input.c