The gif(4) interface always used MTU of the outgoing interface based on
the routing entries when the outer protocol is IPv4, and IPV6_MINMTU
for IPv6. The latter was required so that packets would not be dropped
in the middle of the IPv6 tunnel endpoints, where path MTU discovery
does not work well.
However, this was confusing and IPV6_MINMTU caused performance penalty
even when the path MTU was obviuosly longer than the minimal value.
The pain point is that there is no way to configure the outer protocol
MTU when it is IPv6, while the MTU looks configurable via the gif interface.
This patch makes gif(4) to use the interface MTU as the outer protocol MTU,
instead of the outgoing interface. The default MTU is 1280, which is
the same as before and the safest value for IPv6. The system administrator
now change the MTU by just using the ifconfig(8) utility.
This reverts change in D51297. I do not think the word 'clamping' is
appropriate for this because the behavior in question just involves
forced fragmentation, not clamping the transfer unit, and is applied to
IPv6 only. A name that looks like a generic knob to adjust the segment
length is not intuitive to sysadmins, IMO.
When I wrote D45854, I received feedback indicating that simply
configuring IPV6_MINMTU as the default MTU on the gif(4) interface
and letting the transmit code path follow it was simpler. I agree
that sysadmins expect that the MTU on the gif(4) interface works
for both the input and output paths.
The reason why this was not implemented in the first place was that
if_bridge(4) does not allow uneven MTUs across the members,
and ip6_output() does not see the MTU value configured on
the gif(4) interface. Fixing this limitation is more consistent
than adding a new knob. I had planned to update the patch,
but I didn't have time to revisit it.
I also plan to add test for whether the fragmentation occurs as expected.
Before that, I would like feedback about this change.