@@ -22,8 +22,9 @@ and changeable from userspace under certain rules.
22
22
2. Querying from userspace
23
23
24
24
Both 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.
27
28
28
29
These values contain interface state:
29
30
@@ -101,8 +102,9 @@ because some driver controlled protocol establishment has to
101
102
complete. Corresponding functions are netif_dormant_on() to set the
102
103
flag, netif_dormant_off() to clear it and netif_dormant() to query.
103
104
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().
106
108
107
109
108
110
Whenever the driver CHANGES one of these flags, a workqueue event is
@@ -133,11 +135,11 @@ netif_carrier_ok() && !netif_dormant() is set by the
133
135
driver. Afterwards, the userspace application can set IFLA_OPERSTATE
134
136
to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set
135
137
netif_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 .
137
139
138
140
So basically a 802.1X supplicant interacts with the kernel like this:
139
141
140
- -subscribe to RTMGRP_LINK
142
+ -subscribe to RTNLGRP_LINK
141
143
-set IFLA_LINKMODE to 1 via RTM_SETLINK
142
144
-query RTM_GETLINK once to get initial state
143
145
-if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until
0 commit comments