The current implement of ip_input() reject packets destined for 169.254.0.0/16, but not those original from 169.254.0.0/16 link-local addresses.
Fix to fully respect RFC 3927 section 2.7.
PR: 255388
Differential D29968
Do not forward datagrams original from 169.254.0.0/16 link-local addresses zlei on Apr 25 2021, 9:38 AM. Authored by Tags Referenced Files
Details
The current implement of ip_input() reject packets destined for 169.254.0.0/16, but not those original from 169.254.0.0/16 link-local addresses. Fix to fully respect RFC 3927 section 2.7. PR: 255388 Set up an instance net.inet.ip.forwarding=1, input packets with source address 169.254.0.0/16 , netstat -s -p ip should show increasing packets not forwardable
Diff Detail
Event TimelineComment Actions Moving the code down fixes a couple of problems, but it introduces a new one: multicasts from link-locals can be forwarded if we are a multicast router. Maybe add a separate check in that section? We should still receive such multicasts. Comment Actions RFC 3927 2.7: Do not forward IPv4 packets with a Link-Local source address even if they have a multicast destination address.
Comment Actions This is my first differential, and I'm not familiar with Phabricator. Got it. I'll add full context.
Comment Actions
Update as @donner suggested. Comment Actions So we are currently handle all multicast packets from LL sources as locally handled streams regardless of the destination.
Comment Actions I would still like to see the "169.254.0.0/16" changed to IN_LINKLOCAL, purpose of macro is to locate this value one place and one place only, scattering this string in the code undoes that. Comment Actions I am accepting this without the IPSTAT_INC(ips_forward) issue being fixed, as it looks to me as if that is an existing and separate problem in the code. Probably a walk through should be done to see that ips_forward and ips_cantforward are all done correctly.
Comment Actions Re: avoiding ntohl(): that would be possible, but probably not within the scope of this change. Comment Actions Friendly ping @donner , there're changes since your first acceptance, do you have any objections? Comment Actions Hi, since I do not have access to the src repository, could someone check in the diff please ? |