Fix unable to send big UDP packets when SNAT rules are configured for nat46 #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the IPv4->IPv6 direction, if SNAT rules are configured for nat46 (i.e. "iptables -A POSTROUTING -t nat -o clatd -j SNAT --to-source 182.0.0.111"), when the host sends a big udp packet (8000 bytes), the IP layer will fragment the packet. However, the fragments must be reassembled before doing NAT. The length of reassembled packet is less than nat46's mtu 16384, so it is not fragmented after NAT. Then nat46 converts it into an IPv6 packet, which causes the packet to be dropped by the network protocol stack and send an icmpv6 with "Fragmentation needed" to the source since the length of the packet is greater than the mtu of next hop and it is not sent locally. In order to send this packet, we should tell the network protocol stack that this is a locally sent IPv6 packet and fragment it if necessary.