Page MenuHomeFreeBSD

netlink: add interface notification on link status / flags change.
ClosedPublic

Authored by melifaro on Dec 3 2022, 5:11 PM.
Tags
None
Referenced Files
F147470696: D37597.id113793.diff
Wed, Mar 11, 6:39 AM
F147402630: D37597.id113981.diff
Tue, Mar 10, 4:55 PM
Unknown Object (File)
Mon, Mar 9, 5:25 PM
Unknown Object (File)
Mon, Mar 9, 11:38 AM
Unknown Object (File)
Sun, Mar 8, 10:16 PM
Unknown Object (File)
Sat, Mar 7, 6:40 AM
Unknown Object (File)
Sat, Mar 7, 4:53 AM
Unknown Object (File)
Fri, Mar 6, 3:50 PM
Subscribers

Details

Summary

Add more interface change notifications to netlink:

  1. Add link-state change notifications by subscribing to ifnet_link_event. In the Linux netlink model, link state is reported in 2 places: first is the IFLA_OPERSTATE, which stores state per RFC2863. The second is an IFF_LOWER_UP interface flag. As many applications rely on the latter, reserve 1 bit from if_flags, named as IFF_NETLINK_1. This flag is mapped to IFF_LOWER_UP in the netlink headers. This is done to avoid making applications think this flag is actually supported / presented in non-netlink outputs.
  2. Add flag change notifications, by hooking into rt_ifmsg(). In the netlink model, notification should include the bitmask for the change flags. Update rt_ifmsg() to include such bitmask

Diff Detail

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