Skip to content

Commit e2511b2

Browse files
aharivelrjarry
authored andcommitted
ip: implement output packet fragmentation
Add an ip_fragment node that fragments IPv4 packets exceeding the outgoing interface MTU. The node is invoked from ip_output when a packet is too large and does not have the DF (Don't Fragment) flag set. Fragmentation follows RFC 791 requirements: each fragment payload size is rounded down to a multiple of 8 bytes, fragment offset field is expressed in 8-byte units, and the MF (More Fragments) flag is set on all fragments except the last one. All fragments share the same packet ID from the original packet. The ip_output node now stores the output interface in mbuf metadata before the size check, ensuring ip_fragment can access the MTU for proper fragment sizing. The previous ip_output_too_big drop node is removed as oversized packets are now handled by ip_fragment. Fragments inherit trace state from the original packet to maintain debugging capability across fragmentation boundaries. Closes: #336 Signed-off-by: Anthony Harivel <[email protected]> Reviewed-by: Christophe Fontaine <[email protected]>
1 parent 4854b56 commit e2511b2

File tree

4 files changed

+595
-390
lines changed

4 files changed

+595
-390
lines changed

0 commit comments

Comments
 (0)