HomeFreeBSD

Modify ip6_get_prevhdr() to be able use it safely.

Description

Modify ip6_get_prevhdr() to be able use it safely.

Instead of returning pointer to the previous header, return its offset.
In frag6_input() use m_copyback() and determined offset to store next
header instead of accessing to it by pointer and assuming that the memory
is contiguous.

In rip6_input() use offset returned by ip6_get_prevhdr() instead of
calculating it from pointers arithmetic, because IP header can belong
to another mbuf in the chain.

Reported by: Maxime Villard <max at m00nbsd dot net>
Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14158

Details

Provenance
aeAuthored on
Differential Revision
D14158: Rework ip6_get_prevhdr() to be able use it safely
Parents
rS328875: MFC r323683:
Branches
Unknown
Tags
Unknown