net/netutil: check actual IP forwarding sysctls on FreeBSD - #20732
Draft
mminkus wants to merge 1 commit into
Draft
net/netutil: check actual IP forwarding sysctls on FreeBSD#20732mminkus wants to merge 1 commit into
mminkus wants to merge 1 commit into
Conversation
CheckIPForwarding unconditionally returned a "not currently officially supported" warning on FreeBSD without ever reading the forwarding sysctls. Subnet routers on FreeBSD therefore got a spurious "IP forwarding is disabled" health warning and admin console banner even with net.inet.ip.forwarding=1 and net.inet6.ip6.forwarding=1 set. Read the sysctls instead, and only warn for the protocols actually required by the advertised routes. FreeBSD has no per-interface forwarding knob, so only the global sysctls are checked. dragonfly, netbsd and openbsd keep the previous unsupported warning. Updates tailscale#5573 Signed-off-by: Martin Minkus <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On FreeBSD,
CheckIPForwardingcurrently returns "IP forwarding is not supported on this OS" regardless of the machine's actual configuration, so a FreeBSD subnet router with forwarding correctly enabled still reports an unhealthy state, and one with forwarding disabled gets no warning that its subnet routes will not work.Read the real sysctls instead:
net.inet.ip.forwardingfor IPv4net.inet6.ip6.forwardingfor IPv6and report only on the address families the node actually advertises routes for, matching the existing Linux behavior.
Tests cover the protocol-selection logic and the no-routes case.
Split out per @bradfitz's request in #19312. This is independent of the rest of that work -- it applies to
mainas-is and does not depend on the FreeBSD native-routing branch.