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)
Tue, Aug 26, 8:32 PM
Unknown Object (File)
Tue, Aug 26, 8:00 PM
Unknown Object (File)
Tue, Aug 26, 11:33 AM
Unknown Object (File)
Tue, Aug 26, 11:08 AM
Unknown Object (File)
Sun, Aug 10, 3:16 PM
Unknown Object (File)
Tue, Aug 5, 6:35 PM
Unknown Object (File)
Jul 29 2025, 1:56 AM
Unknown Object (File)
Jul 24 2025, 4:36 AM

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 :-)