Page MenuHomeFreeBSD

bridge: Fix assigning IP addresses to the gif(4) interface
ClosedPublic

Authored by zlei on Aug 28 2025, 8:47 AM.
Tags
None
Referenced Files
F133433203: D52200.diff
Sat, Oct 25, 6:28 PM
Unknown Object (File)
Sun, Oct 12, 1:01 PM
Unknown Object (File)
Fri, Oct 10, 4:01 PM
Unknown Object (File)
Fri, Oct 10, 4:01 PM
Unknown Object (File)
Fri, Oct 10, 4:01 PM
Unknown Object (File)
Fri, Oct 10, 10:01 AM
Unknown Object (File)
Sat, Oct 4, 1:51 AM
Unknown Object (File)
Thu, Sep 25, 11:33 PM

Details

Summary

When setting the sysctl net.link.bridge.member_ifaddrs to 1,
bridge(4) can eliminate unnecessary walk of the member
member list to determine whether the inbound unicast packets are for us
or not.

Well when a gif(4) interface is member of a bridge(4) interface, it acts
as the tunnel endpoint to tunnel Ethernet frames over IP network, aka
the EtherIP protocol, so the IP addresses configured on it are independent
of the bridge(4) interface or other bridge(4) members, hence the sysctl
net.link.bridge.member_ifaddrs should not have any influnce over gif(4)
interfaces's behavior of assigning IP addresses.

Add regression test for gif as a bridge member.

[1] 0a1294f6c610 bridge: allow IP addresses on members to be disabled

PR: 227450
Reported by: Siva Mahadevan <me@svmhdvn.name>
MFC after: 2 weeks
Fixes: 0a1294f6c610 bridge: allow IP addresses on members to be disabled

Diff Detail

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

Event Timeline

zlei requested review of this revision.Aug 28 2025, 8:47 AM

The sysctl net.link.bridge.member_ifaddrs does not affect gif(4) interface as a member of bridge(4) interface. Shall the man doc be updated to reflect the reality, so users are not confused ?

sys/net/if_bridge.c
1450 ↗(On Diff #161099)

Surely Ethernet like .

The sysctl net.link.bridge.member_ifaddrs does not affect gif(4) interface as a member of bridge(4) interface. Shall the man doc be updated to reflect the reality, so users are not confused ?

yes, this behaviour is quite strange and should be documented somewhere, but i don't know if it belongs in bridge.4 rather than gif.4. as i mentioned in the other review, the interaction between gif and bridge is not really documented anywhere at all.

that aside, this change looks fine: bridge doesn't care about IP addresses on gif members, so we do not need to prohibit that.

This revision is now accepted and ready to land.Aug 28 2025, 12:20 PM
sys/netinet/in.c
526 ↗(On Diff #161099)

it might be cleaner to handle this by adding an argument to bridge_member_ifaddrs(), that would avoid exposing implementation details of bridge to inet/inet6 stack.

zlei marked an inline comment as done.Aug 28 2025, 4:34 PM
zlei added inline comments.
sys/netinet/in.c
526 ↗(On Diff #161099)

Given the plan is to remove the sysctl net.link.bridge.member_ifaddrs in 16, I think the current approach is fine enough.

sys/netinet/in.c
526 ↗(On Diff #161099)

this may not happen until 17.0, but given it's slated to be removed at some point anyway, i'm fine with this approach.