]> git.baikalelectronics.ru Git - kernel.git/commit
esp6: get the right proto for transport mode in esp6_gso_encap
authorXin Long <lucien.xin@gmail.com>
Fri, 10 Apr 2020 09:06:56 +0000 (17:06 +0800)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 15 Apr 2020 07:50:03 +0000 (09:50 +0200)
commitdd32d395bc756aff1c67f139415e6e82f45f0c84
tree1946f27bcce1ae8d24edadc021a76ede3df7ec2d
parent9e25e3d5f4a39e4462a72e83f8689bf72ba0ecbc
esp6: get the right proto for transport mode in esp6_gso_encap

For transport mode, when ipv6 nexthdr is set, the packet format might
be like:

    ----------------------------------------------------
    |        | dest |     |     |      |  ESP    | ESP |
    | IP6 hdr| opts.| ESP | TCP | Data | Trailer | ICV |
    ----------------------------------------------------

What it wants to get for x-proto in esp6_gso_encap() is the proto that
will be set in ESP nexthdr. So it should skip all ipv6 nexthdrs and
get the real transport protocol. Othersize, the wrong proto number
will be set into ESP nexthdr.

This patch is to skip all ipv6 nexthdrs by calling ipv6_skip_exthdr()
in esp6_gso_encap().

Fixes: 24019a4cf881 ("esp: Add gso handlers for esp4 and esp6")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv6/esp6_offload.c