HomeFreeBSD

Don't break out of the m_advance() loop if len drops to zero.

Description

Don't break out of the m_advance() loop if len drops to zero.

If a packet contains the Ethernet header (14 bytes) in the first mbuf
and the payload (IP + UDP + data) in the second mbuf, then the attempt
to fetch the l3hdr will return a NULL pointer. The first loop iteration
will drop len to zero and exit the loop without setting 'p'. However,
the desired data is at the start of the second mbuf, so the correct
behavior is to loop around and let the conditional set 'p' to m_data of
the next mbuf (and leave offset as 0).

Reviewed by: np
Sponsored by: Chelsio Communications

Details

Provenance
jhbAuthored on
Reviewer
np
Parents
rS305547: MFC r304920:
Branches
Unknown
Tags
Unknown