Page MenuHomeFreeBSD

netlink: Fix getting route scope of interface's IPv4 addresses
ClosedPublic

Authored by zlei on Mar 4 2025, 7:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 9, 5:33 AM
Unknown Object (File)
Sat, Apr 5, 2:05 AM
Unknown Object (File)
Fri, Apr 4, 4:14 AM
Unknown Object (File)
Sat, Mar 22, 12:20 AM
Unknown Object (File)
Fri, Mar 21, 7:41 PM
Unknown Object (File)
Mar 21 2025, 12:16 AM
Unknown Object (File)
Mar 20 2025, 12:53 PM
Unknown Object (File)
Mar 19 2025, 8:13 PM

Details

Summary
netlink: Fix getting route scope of interface's IPv4 addresses

sin_addr of a `struct sockaddr_in` is stored in network byte order, but
IN_LOOPBACK() and IN_LINKLOCAL() want the host order.

Fixes:  7e5bf68495cc netlink: add netlink support
MFC after:      3 days
tests/netlink: Assert the route scope of interfaces's addresses

While here, add IPv4 link-local address to cover RT_SCOPE_LINK case.

MFC after:      3 days

Diff Detail

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

Event Timeline

zlei requested review of this revision.Mar 4 2025, 7:02 AM
This revision is now accepted and ready to land.Mar 6 2025, 9:17 AM

Zhenlei, please go forward with Alexander's review, don't wait on me. Thanks!

Zhenlei, please go forward with Alexander's review, don't wait on me. Thanks!

Yeah, I'm going to commit today (UTC+8). I'm not familiar with Python. The fix is simple but I spent a lot time on the tests :-)