Page MenuHomeFreeBSD

frag6: properly handle atomic fragments according to RFCs.
ClosedPublic

Authored by bz on Oct 25 2019, 8:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 22 2024, 1:16 AM
Unknown Object (File)
Nov 4 2024, 11:43 AM
Unknown Object (File)
Sep 18 2024, 8:07 AM
Unknown Object (File)
Sep 5 2024, 1:46 AM
Unknown Object (File)
Sep 5 2024, 1:46 AM
Unknown Object (File)
Sep 5 2024, 1:46 AM
Unknown Object (File)
Sep 5 2024, 1:43 AM
Unknown Object (File)
Aug 26 2024, 3:32 AM

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netinet6/frag6.c
452 ↗(On Diff #63675)

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

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.Nov 8 2019, 2:37 PM
This revision was automatically updated to reflect the committed changes.