Page MenuHomeFreeBSD

EtherIP: Fix passing the address family to gif(4)
ClosedPublic

Authored by zlei on Aug 1 2025, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 12:13 AM
Unknown Object (File)
Sat, Oct 11, 12:13 AM
Unknown Object (File)
Sat, Oct 11, 12:13 AM
Unknown Object (File)
Fri, Oct 10, 5:44 PM
Unknown Object (File)
Sat, Oct 4, 1:05 PM
Unknown Object (File)
Fri, Oct 3, 12:26 PM
Unknown Object (File)
Sat, Sep 27, 3:14 PM
Unknown Object (File)
Sat, Sep 27, 12:15 PM

Details

Summary

Given IPPROTO_IPV4, IPPROTO_IPV6 and IPPROTO_ETHERIP have different
protocol numbers, then it is perfect valid to tunnel IPv4, IPv6 and
Ethernet frames in IPv[46] datagrams by the same interface. Since
gif(4) has already utilized the inbound csum_data field to carry
address family, also teach bridge(4) to do that, rather than checking
if a gif(4) interface is member of a bridge(4) interface.

Without this fix, the IPv[46] in IPv[46] setup will not work when the
gif(4) interface is member of a bridge(4) interface, aka the EtherIP
setup, as the address family passed from gif_output() will be overwritten
with the wrong one AF_LINK by gif_transmit(), and end up with incorrectly
encapsulated packets.

PR: 227450
Tested by: meta
Fixes: 8a0308722372 gif(4): Assert that gif_output() isn't called for EtherIP
MFC after: 2 weeks

Diff Detail

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

Event Timeline

zlei requested review of this revision.Aug 1 2025, 4:17 PM
zlei edited the summary of this revision. (Show Details)

Again, this worked fine for me. I hope this will be merged soon and included in 15.0-RELEASE.

This revision is now accepted and ready to land.Aug 6 2025, 9:40 AM

Again, this worked fine for me. I hope this will be merged soon and included in 15.0-RELEASE.

Landed. Thanks for testing the fix !