HomeFreeBSD

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

Description

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

  • 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.
  • 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.

Differential Revision: https://reviews.freebsd.org/D37597

Details

Provenance
melifaroAuthored on Dec 3 2022, 5:10 PM
Differential Revision
D37597: netlink: add interface notification on link status / flags change.
Parents
rG0ca90ed42a49: MFV: xz 5.2.9
Branches
Unknown
Tags
Unknown