Page MenuHomeFreeBSD

frag6: properly handle atomic fragments according to RFCs.
ClosedPublic

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

Details

Summary

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

Included.

Diff Detail

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

Event Timeline

bz created this revision.Fri, Oct 25, 8:13 PM
bz added inline comments.Mon, Oct 28, 9:52 PM
sys/netinet6/frag6.c
452 ↗(On Diff #63675)

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

bz added a comment.Thu, Nov 7, 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?

sys/netinet6/frag6.c
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.Fri, Nov 8, 2:37 PM
This revision was automatically updated to reflect the committed changes.