Page MenuHomeFreeBSD

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

Authored by zlei on Tue, Mar 4, 7:02 AM.
Tags
None
Referenced Files
F112547935: D49226.diff
Wed, Mar 19, 4:56 PM
F112534476: D49226.id151833.diff
Wed, Mar 19, 11:53 AM
Unknown Object (File)
Wed, Mar 12, 8:34 PM
Unknown Object (File)
Sat, Mar 8, 5:00 PM
Unknown Object (File)
Fri, Mar 7, 3:48 PM
Unknown Object (File)
Fri, Mar 7, 2:01 PM
Unknown Object (File)
Fri, Mar 7, 10:21 AM
Unknown Object (File)
Fri, Mar 7, 7:05 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 Skipped
Unit
Tests Skipped

Event Timeline

zlei requested review of this revision.Tue, Mar 4, 7:02 AM
This revision is now accepted and ready to land.Thu, Mar 6, 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 :-)