]> 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)
commit3196836639952a8fc9c582ed674b51184430ef77
treef847f686cdcedbc86ce2e2e0ba469f17ca96e3d0
parentd50a59e69ac170cc79001302ec99dad8a831e48d
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