Page MenuHomeFreeBSD

frag6: properly handle atomic fragments according to RFCs.

Authored by bz on Oct 25 2019, 8:13 PM.



RFC 8200 says:
"If the fragment is a whole datagram (that is, both the Fragment

Offset field and the M flag are zero), then it does not need
any further reassembly and should be processed as a fully
reassembled packet (i.e., updating Next Header, adjust Payload
Length, removing the Fragment header, etc.).  .."

That means we should remove the fragment header and make all the adjustments
rather than just skipping over the fragment header. The difference should
be noticeable in that a properly handled atomic fragment triggering an ICMPv6
message at an upper layer (e.g. dest unreach, unreachable port) will not
include the fragment header.

Update the test cases to also test for an unfragmentable part. That is
needed so that the next header is properly updated (not just lengths).

Test Plan


Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz created this revision.Oct 25 2019, 8:13 PM
bz added inline comments.Oct 28 2019, 9:52 PM
452 ↗(On Diff #63675)

*mp = m; is missing here as m can change.

bz added a comment.Nov 7 2019, 6:34 PM

I'd like to commit the main part of the change with(out) the two changes I commented on the next 24 hours.
Does anyone want to have a look?

410 ↗(On Diff #63675)

M_ASSERTPKTHDR() should really become like this to have the information and then I can use that here.
I'll ignore it for this change and split it out.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 8 2019, 2:37 PM
This revision was automatically updated to reflect the committed changes.