@@ -22,8 +22,9 @@ and changeable from userspace under certain rules.
22222. Querying from userspace
2323
2424Both admin and operational state can be queried via the netlink
25- operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK
26- to be notified of updates. This is important for setting from userspace.
25+ operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK
26+ to be notified of updates while the interface is admin up. This is
27+ important for setting from userspace.
2728
2829These values contain interface state:
2930
@@ -101,8 +102,9 @@ because some driver controlled protocol establishment has to
101102complete. Corresponding functions are netif_dormant_on() to set the
102103flag, netif_dormant_off() to clear it and netif_dormant() to query.
103104
104- On device allocation, networking core sets the flags equivalent to
105- netif_carrier_ok() and !netif_dormant().
105+ On device allocation, both flags __LINK_STATE_NOCARRIER and
106+ __LINK_STATE_DORMANT are cleared, so the effective state is equivalent
107+ to netif_carrier_ok() and !netif_dormant().
106108
107109
108110Whenever the driver CHANGES one of these flags, a workqueue event is
@@ -133,11 +135,11 @@ netif_carrier_ok() && !netif_dormant() is set by the
133135driver. Afterwards, the userspace application can set IFLA_OPERSTATE
134136to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
135137netif_carrier_off() or netif_dormant_on(). Changes made by userspace
136- are multicasted on the netlink group RTMGRP_LINK .
138+ are multicasted on the netlink group RTNLGRP_LINK .
137139
138140So basically a 802.1X supplicant interacts with the kernel like this:
139141
140- -subscribe to RTMGRP_LINK
142+ -subscribe to RTNLGRP_LINK
141143-set IFLA_LINKMODE to 1 via RTM_SETLINK
142144-query RTM_GETLINK once to get initial state
143145-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until
0 commit comments