Page MenuHomeFreeBSD

if_gif(4): Support the NOCLAMP flag to change the MTU handling for IPv6
ClosedPublic

Authored by meta on Jul 14 2025, 8:25 AM.
Tags
None
Referenced Files
F132583091: D51297.id158724.diff
Sat, Oct 18, 4:16 AM
F132571729: D51297.id158718.diff
Sat, Oct 18, 2:03 AM
Unknown Object (File)
Sat, Oct 11, 3:04 PM
Unknown Object (File)
Sat, Oct 11, 3:04 PM
Unknown Object (File)
Sat, Oct 11, 3:04 PM
Unknown Object (File)
Sat, Oct 11, 3:04 PM
Unknown Object (File)
Sat, Oct 11, 3:03 PM
Unknown Object (File)
Sat, Oct 11, 3:03 PM

Details

Summary

The gif(4) interface always used IPV6_MINMTU when the outer protocol was
IPv6 so that packets would not be dropped between the tunnel endpoints.
The interface MTU was ignored because path MTU discovery was too expensive.

This change adds NOCLAMP flag support to revert it to normal behavior,
and documents the backgrounds. While using IPV6_MINMTU is still
the safest option for IPv6, ignoring the configured interface MTU is
confuses the users, and using a larger MTU is sometimes useful.

This is originally developed by hrs@. I just made additional changes to
implement the feature via a named flag noclamp as ae@ suggested in D45854.
Also I updated the man page for the named flag. I named noclamp for the
flag but I'm open to other suggestions.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

meta requested review of this revision.Jul 14 2025, 8:25 AM
This revision is now accepted and ready to land.Jul 14 2025, 9:12 AM

I like the word noclamp. Well, there're other tunneling interfaces such as if_gre, if_vxlan and if_wg. Will we introduce too many XX_NOCLAP flags for other types of tunneling interfaces?

I like the word noclamp. Well, there're other tunneling interfaces such as if_gre, if_vxlan and if_wg. Will we introduce too many XX_NOCLAP flags for other types of tunneling interfaces?

Honestly, I'm not familiar with this area since I only have the ports commit bit. If we implement the NOCLAMP flag in a more common place that covers other tunneling types, such as IFCAPBITS, then we would not need to reintroduce NOCLAMP for each tunneling type individually. However, I'm not sure if that's considered good practice; probably not.

Some suggestions for the manual pages.

sbin/ifconfig/ifconfig.8
2892–2893
share/man/man4/gif.4
207

Missing word?

227–232
264
284
sbin/ifconfig/ifconfig.8
2892–2893

I choose "a" here for consistency with the ignore_source flag just below.

share/man/man4/gif.4
227–232

Regarding the man page gif.4, it comes from D45854, which is already approved. I just replaced the flag name, link0 to noclamp. So, can we focus on the difference with D45854?

I'll make the suggested corrections if they're essential though.

share/man/man4/gif.4
227–232

Regarding the man page gif.4, it comes from D45854, which is already approved. I just replaced the flag name, link0 to noclamp. So, can we focus on the difference with D45854?

I'll make the suggested corrections if they're essential though.

I didn't see that review until just now. Had I seen it in time, I would have commented there instead of here. As for "essential", I think https://reviews.freebsd.org/D51297#inline-305594 at least is important to have for clarity, and the others would be good to have, perhaps in a follow-up review.

share/man/man4/gif.4
227–232

I see. Thank you for your time.

Reflect essential review comments on manpages

This revision now requires review to proceed.Jul 17 2025, 6:09 AM
sbin/ifconfig/ifconfig.8
2892–2893

It's wrong there too.

Consider "I would like to brush a bunny". This is any bunny. The most nonspecific article. Vs, "I would like to brush the bunny", implies that there is a specific bunny before us.

sbin/ifconfig/ifconfig.8
2892–2893

That makes sense, but I guessed there was a certain reason "a" was chosen when the description of ignore source was added. The existing one was also just wrong. Anyway, I will correct them. Thanks.

Correct grammatical articles

Any other comments? May I proceed to commit?

Manual pages look OK to me now.

This revision is now accepted and ready to land.Jul 18 2025, 1:22 AM
sbin/ifconfig/ifconfig.8
2889

What's this .T?

sbin/ifconfig/ifconfig.8
2889

This is a leftover from misusing .TH. I meant to delete it but accidentally left part of it. Thanks for the catch.

Remove an unintened leftover

This revision now requires review to proceed.Jul 18 2025, 3:01 AM

I think we're good to go now, right?

This revision was not accepted when it landed; it landed in state Needs Review.Jul 21 2025, 1:48 PM
This revision was automatically updated to reflect the committed changes.