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)
Jan 16 2024, 12:46 AM
Unknown Object (File)
Dec 22 2023, 11:53 PM
Unknown Object (File)
Dec 12 2023, 3:39 AM
Unknown Object (File)
Nov 11 2023, 12:47 AM
Unknown Object (File)
Nov 9 2023, 12:55 AM
Unknown Object (File)
Nov 2 2023, 3:29 AM
Unknown Object (File)
Nov 2 2023, 12:25 AM
Unknown Object (File)
Oct 6 2023, 11:44 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 - 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.