Netatalk / netatalk

Netatalk is a Free and Open Source AFP fileserver. A *NIX or BSD system running Netatalk is capable of serving many Macintosh clients simultaneously as an AppleShare file server.
https://netatalk.io
GNU General Public License v2.0
354 stars 87 forks source link

atalkd: Don't send NBP Reply packets from the loopback interface #1734

Closed NJRoadfan closed 1 week ago

NJRoadfan commented 1 week ago

In Linux 6.9+, NBP Reply packets can appear to come from the loopback interface, which has an address of 0.0. This address is invalid on Phase 2 AppleTalk networks and should never appear. One minor benefit is less traffic is generated when doing NBP Lookups. Fixes #1731 without breaking anything additional.

NJRoadfan commented 1 week ago

OK. New patch just filters out packets from the loopback adapter. One can't suppress the duplicate packets. It is by design if multiple interfaces are on the same zone. Some sort of split horizon logic would need to be done, but its not worth the effort over the minimum additional traffic. This patch fixes the biggest problem, which is packets from the loopback interface leaking onto the network.

Note, this wasn't tested on NetBSD or pre-6.9 Linux kernels. There should be no regressions though. At the worst, its still sending the extra reply from the loopback, but with the address of the server's interface as before.

rdmark commented 1 week ago

@NJRoadfan Is this ready for review now?