HomeFreeBSD

Eliminate the use of m_copydata() in gif_encapcheck().

Description

Eliminate the use of m_copydata() in gif_encapcheck().

ip_encap already has inspected mbuf's data, at least an IP header.
And it is safe to use mtod() and do direct access to needed fields.
Add M_ASSERTPKTHDR() to gif_encapcheck(), since the code expects that
mbuf has a packet header.
Move the code from gif_validate[46] into in[6]_gif_encapcheck(), also
remove "martian filters" checks. According to RFC 4213 it is enough to
verify that the source address is the address of the encapsulator, as
configured on the decapsulator.

Reviewed by: melifaro
Obtained from: Yandex LLC
Sponsored by: Yandex LLC

Details

Provenance
aeAuthored on
Reviewer
melifaro
Parents
rS286012: Revert r286007-r286009 for now, until I can figure out how to make the
Branches
Unknown
Tags
Unknown