Skip to content
Commit 0b8a8849 authored by Florian Vaussard's avatar Florian Vaussard Committed by Christopher Friedt
Browse files

net: ipv6: fix the logics of prev_hdr_offset



Currently prev_hdr_offset always equals 6, which is the offset of
the nexthdr field in the IPv6 header. This value is used to overwrite it
when removing an IPv6 Fragment header, so it will work as long as there
is no other Extension header between the IPv6 header and the Fragment
header.

However this does not work in the other cases: the nexthdr field of the
IPv6 header will be overwritten instead of the nexthdr field of the last
Extension header before the Fragment, leading to unwanted results.

Update prev_hdr_offset so that it always point to the nexthdr field of
the previous header, either the IPv6 header or an Extension header.

Signed-off-by: default avatarFlorian Vaussard <florian.vaussard@gmail.com>
parent 4bacedb4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment