€•frŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/networking/operstates”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒC/var/lib/git/docbuild/linux/Documentation/networking/operstates.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒOperational States”h]”hŒOperational States”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ1. Introduction”h]”hŒ1. Introduction”…””}”(hhàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÝh²hh³hÇh´K ubhŒ paragraph”“”)”}”(hŒæLinux distinguishes between administrative and operational state of an interface. Administrative state is the result of "ip link set dev up or down" and reflects whether the administrator wants to use the device for traffic.”h]”hŒêLinux distinguishes between administrative and operational state of an interface. Administrative state is the result of “ip link set dev up or down†and reflects whether the administrator wants to use the device for traffic.”…””}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hhÝh²hubhï)”}”(hXUHowever, an interface is not usable just because the admin enabled it - ethernet requires to be plugged into the switch and, depending on a site's networking policy and configuration, an 802.1X authentication to be performed before user data can be transferred. Operational state shows the ability of an interface to transmit this user data.”h]”hXWHowever, an interface is not usable just because the admin enabled it - ethernet requires to be plugged into the switch and, depending on a site’s networking policy and configuration, an 802.1X authentication to be performed before user data can be transferred. Operational state shows the ability of an interface to transmit this user data.”…””}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubhï)”}”(hXGThanks to 802.1X, userspace must be granted the possibility to influence operational state. To accommodate this, operational state is split into two parts: Two flags that can be set by the driver only, and a RFC2863 compatible state that is derived from these flags, a policy, and changeable from userspace under certain rules.”h]”hXGThanks to 802.1X, userspace must be granted the possibility to influence operational state. To accommodate this, operational state is split into two parts: Two flags that can be set by the driver only, and a RFC2863 compatible state that is derived from these flags, a policy, and changeable from userspace under certain rules.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KhhÝh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ1. introduction”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ2. Querying from userspace”h]”hŒ2. Querying from userspace”…””}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj"h²hh³hÇh´Kubhï)”}”(hŒðBoth admin and operational state can be queried via the netlink operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK to be notified of updates while the interface is admin up. This is important for setting from userspace.”h]”hŒðBoth admin and operational state can be queried via the netlink operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK to be notified of updates while the interface is admin up. This is important for setting from userspace.”…””}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K hj"h²hubhï)”}”(hŒ%These values contain interface state:”h]”hŒ%These values contain interface state:”…””}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K%hj"h²hubhŒdefinition_list”“”)”}”(hhh]”(hŒdefinition_list_item”“”)”}”(hŒ4ifinfomsg::if_flags & IFF_UP: Interface is admin up ”h]”(hŒterm”“”)”}”(hŒifinfomsg::if_flags & IFF_UP:”h]”hŒifinfomsg::if_flags & IFF_UP:”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K(hjVubhŒ definition”“”)”}”(hhh]”hï)”}”(hŒInterface is admin up”h]”hŒInterface is admin up”…””}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K(hjlubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjVubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K(hjQubjU)”}”(hŒäifinfomsg::if_flags & IFF_RUNNING: Interface is in RFC2863 operational state UP or UNKNOWN. This is for backward compatibility, routing daemons, dhcp clients can use this flag to determine whether they should use the interface. ”h]”(j[)”}”(hŒ"ifinfomsg::if_flags & IFF_RUNNING:”h]”hŒ"ifinfomsg::if_flags & IFF_RUNNING:”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K-hj‰ubjk)”}”(hhh]”hï)”}”(hŒÀInterface is in RFC2863 operational state UP or UNKNOWN. This is for backward compatibility, routing daemons, dhcp clients can use this flag to determine whether they should use the interface.”h]”hŒÀInterface is in RFC2863 operational state UP or UNKNOWN. This is for backward compatibility, routing daemons, dhcp clients can use this flag to determine whether they should use the interface.”…””}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K+hj›ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhj‰ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K-hjQh²hubjU)”}”(hŒKifinfomsg::if_flags & IFF_LOWER_UP: Driver has signaled netif_carrier_on() ”h]”(j[)”}”(hŒ#ifinfomsg::if_flags & IFF_LOWER_UP:”h]”hŒ#ifinfomsg::if_flags & IFF_LOWER_UP:”…””}”(hj¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K0hj¸ubjk)”}”(hhh]”hï)”}”(hŒ&Driver has signaled netif_carrier_on()”h]”hŒ&Driver has signaled netif_carrier_on()”…””}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K0hjÊubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhj¸ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K0hjQh²hubjU)”}”(hŒJifinfomsg::if_flags & IFF_DORMANT: Driver has signaled netif_dormant_on() ”h]”(j[)”}”(hŒ"ifinfomsg::if_flags & IFF_DORMANT:”h]”hŒ"ifinfomsg::if_flags & IFF_DORMANT:”…””}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K3hjçubjk)”}”(hhh]”hï)”}”(hŒ&Driver has signaled netif_dormant_on()”h]”hŒ&Driver has signaled netif_dormant_on()”…””}”(hjüh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K3hjùubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjçubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K3hjQh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jOhj"h²hh³hÇh´NubhÉ)”}”(hhh]”(hÎ)”}”(hŒTLV IFLA_OPERSTATE”h]”hŒTLV IFLA_OPERSTATE”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K6ubhï)”}”(hŒBcontains RFC2863 state of the interface in numeric representation:”h]”hŒBcontains RFC2863 state of the interface in numeric representation:”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K8hjh²hubjP)”}”(hhh]”(jU)”}”(hŒÞIF_OPER_UNKNOWN (0): Interface is in unknown state, neither driver nor userspace has set operational state. Interface must be considered for user data as setting operational state has not been implemented in every driver. ”h]”(j[)”}”(hŒIF_OPER_UNKNOWN (0):”h]”hŒIF_OPER_UNKNOWN (0):”…””}”(hjBh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K=hj>ubjk)”}”(hhh]”hï)”}”(hŒÈInterface is in unknown state, neither driver nor userspace has set operational state. Interface must be considered for user data as setting operational state has not been implemented in every driver.”h]”hŒÈInterface is in unknown state, neither driver nor userspace has set operational state. Interface must be considered for user data as setting operational state has not been implemented in every driver.”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K;hjPubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhj>ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K=hj;ubjU)”}”(hŒ{IF_OPER_NOTPRESENT (1): Unused in current kernel (notpresent interfaces normally disappear), just a numerical placeholder. ”h]”(j[)”}”(hŒIF_OPER_NOTPRESENT (1):”h]”hŒIF_OPER_NOTPRESENT (1):”…””}”(hjqh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KAhjmubjk)”}”(hhh]”hï)”}”(hŒbUnused in current kernel (notpresent interfaces normally disappear), just a numerical placeholder.”h]”hŒbUnused in current kernel (notpresent interfaces normally disappear), just a numerical placeholder.”…””}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K@hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjmubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KAhj;h²hubjU)”}”(hŒwIF_OPER_DOWN (2): Interface is unable to transfer data on L1, f.e. ethernet is not plugged or interface is ADMIN down. ”h]”(j[)”}”(hŒIF_OPER_DOWN (2):”h]”hŒIF_OPER_DOWN (2):”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KEhjœubjk)”}”(hhh]”hï)”}”(hŒdInterface is unable to transfer data on L1, f.e. ethernet is not plugged or interface is ADMIN down.”h]”hŒdInterface is unable to transfer data on L1, f.e. ethernet is not plugged or interface is ADMIN down.”…””}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KDhj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjœubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KEhj;h²hubjU)”}”(hŒqIF_OPER_LOWERLAYERDOWN (3): Interfaces stacked on an interface that is IF_OPER_DOWN show this state (f.e. VLAN). ”h]”(j[)”}”(hŒIF_OPER_LOWERLAYERDOWN (3):”h]”hŒIF_OPER_LOWERLAYERDOWN (3):”…””}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KIhjËubjk)”}”(hhh]”hï)”}”(hŒTInterfaces stacked on an interface that is IF_OPER_DOWN show this state (f.e. VLAN).”h]”hŒTInterfaces stacked on an interface that is IF_OPER_DOWN show this state (f.e. VLAN).”…””}”(hjàh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KHhjÝubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjËubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KIhj;h²hubjU)”}”(hŒ¬IF_OPER_TESTING (4): Interface is in testing mode, for example executing driver self-tests or media (cable) test. It can't be used for normal traffic until tests complete. ”h]”(j[)”}”(hŒIF_OPER_TESTING (4):”h]”hŒIF_OPER_TESTING (4):”…””}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KNhjúubjk)”}”(hhh]”hï)”}”(hŒ–Interface is in testing mode, for example executing driver self-tests or media (cable) test. It can't be used for normal traffic until tests complete.”h]”hŒ˜Interface is in testing mode, for example executing driver self-tests or media (cable) test. It can’t be used for normal traffic until tests complete.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KLhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjúubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KNhj;h²hubjU)”}”(hŒwIF_OPER_DORMANT (5): Interface is L1 up, but waiting for an external event, f.e. for a protocol to establish. (802.1X) ”h]”(j[)”}”(hŒIF_OPER_DORMANT (5):”h]”hŒIF_OPER_DORMANT (5):”…””}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KRhj)ubjk)”}”(hhh]”hï)”}”(hŒaInterface is L1 up, but waiting for an external event, f.e. for a protocol to establish. (802.1X)”h]”hŒaInterface is L1 up, but waiting for an external event, f.e. for a protocol to establish. (802.1X)”…””}”(hj>h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KQhj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhj)ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KRhj;h²hubjU)”}”(hŒ=IF_OPER_UP (6): Interface is operational up and can be used. ”h]”(j[)”}”(hŒIF_OPER_UP (6):”h]”hŒIF_OPER_UP (6):”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KUhjXubjk)”}”(hhh]”hï)”}”(hŒ,Interface is operational up and can be used.”h]”hŒ,Interface is operational up and can be used.”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KUhjjubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjXubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KUhj;h²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jOhjh²hh³hÇh´Nubhï)”}”(hŒ'This TLV can also be queried via sysfs.”h]”hŒ'This TLV can also be queried via sysfs.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KWhjh²hubeh}”(h]”Œtlv-ifla-operstate”ah ]”h"]”Œtlv ifla_operstate”ah$]”h&]”uh1hÈhj"h²hh³hÇh´K6ubhÉ)”}”(hhh]”(hÎ)”}”(hŒTLV IFLA_LINKMODE”h]”hŒTLV IFLA_LINKMODE”…””}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj£h²hh³hÇh´KZubhï)”}”(hŒOcontains link policy. This is needed for userspace interaction described below.”h]”hŒOcontains link policy. This is needed for userspace interaction described below.”…””}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K\hj£h²hubhï)”}”(hŒ'This TLV can also be queried via sysfs.”h]”hŒ'This TLV can also be queried via sysfs.”…””}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K_hj£h²hubeh}”(h]”Œtlv-ifla-linkmode”ah ]”h"]”Œtlv ifla_linkmode”ah$]”h&]”uh1hÈhj"h²hh³hÇh´KZubeh}”(h]”Œquerying-from-userspace”ah ]”h"]”Œ2. querying from userspace”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒ3. Kernel driver API”h]”hŒ3. Kernel driver API”…””}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjàh²hh³hÇh´Kcubhï)”}”(hXBKernel drivers have access to two flags that map to IFF_LOWER_UP and IFF_DORMANT. These flags can be set from everywhere, even from interrupts. It is guaranteed that only the driver has write access, however, if different layers of the driver manipulate the same flag, the driver has to provide the synchronisation needed.”h]”hXBKernel drivers have access to two flags that map to IFF_LOWER_UP and IFF_DORMANT. These flags can be set from everywhere, even from interrupts. It is guaranteed that only the driver has write access, however, if different layers of the driver manipulate the same flag, the driver has to provide the synchronisation needed.”…””}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kehjàh²hubhï)”}”(hŒ.__LINK_STATE_NOCARRIER, maps to !IFF_LOWER_UP:”h]”hŒ.__LINK_STATE_NOCARRIER, maps to !IFF_LOWER_UP:”…””}”(hjÿh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kkhjàh²hubhï)”}”(hŒãThe driver uses netif_carrier_on() to clear and netif_carrier_off() to set this flag. On netif_carrier_off(), the scheduler stops sending packets. The name 'carrier' and the inversion are historical, think of it as lower layer.”h]”hŒçThe driver uses netif_carrier_on() to clear and netif_carrier_off() to set this flag. On netif_carrier_off(), the scheduler stops sending packets. The name ‘carrier’ and the inversion are historical, think of it as lower layer.”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kmhjàh²hubhï)”}”(hŒ¯Note that for certain kind of soft-devices, which are not managing any real hardware, it is possible to set this bit from userspace. One should use TLV IFLA_CARRIER to do so.”h]”hŒ¯Note that for certain kind of soft-devices, which are not managing any real hardware, it is possible to set this bit from userspace. One should use TLV IFLA_CARRIER to do so.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Krhjàh²hubhï)”}”(hŒ1netif_carrier_ok() can be used to query that bit.”h]”hŒ1netif_carrier_ok() can be used to query that bit.”…””}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kvhjàh²hubhï)”}”(hŒ*__LINK_STATE_DORMANT, maps to IFF_DORMANT:”h]”hŒ*__LINK_STATE_DORMANT, maps to IFF_DORMANT:”…””}”(hj7h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kxhjàh²hubhï)”}”(hXSet by the driver to express that the device cannot yet be used because some driver controlled protocol establishment has to complete. Corresponding functions are netif_dormant_on() to set the flag, netif_dormant_off() to clear it and netif_dormant() to query.”h]”hXSet by the driver to express that the device cannot yet be used because some driver controlled protocol establishment has to complete. Corresponding functions are netif_dormant_on() to set the flag, netif_dormant_off() to clear it and netif_dormant() to query.”…””}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kzhjàh²hubhï)”}”(hŒ®On device allocation, both flags __LINK_STATE_NOCARRIER and __LINK_STATE_DORMANT are cleared, so the effective state is equivalent to netif_carrier_ok() and !netif_dormant().”h]”hŒ®On device allocation, both flags __LINK_STATE_NOCARRIER and __LINK_STATE_DORMANT are cleared, so the effective state is equivalent to netif_carrier_ok() and !netif_dormant().”…””}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Khjàh²hubhï)”}”(hŒŽWhenever the driver CHANGES one of these flags, a workqueue event is scheduled to translate the flag combination to IFLA_OPERSTATE as follows:”h]”hŒŽWhenever the driver CHANGES one of these flags, a workqueue event is scheduled to translate the flag combination to IFLA_OPERSTATE as follows:”…””}”(hjah²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K„hjàh²hubjP)”}”(hhh]”(jU)”}”(hŒª!netif_carrier_ok(): IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN otherwise. Kernel can recognise stacked interfaces because their ifindex != iflink. ”h]”(j[)”}”(hŒ!netif_carrier_ok():”h]”hŒ!netif_carrier_ok():”…””}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K‹hjrubjk)”}”(hhh]”hï)”}”(hŒ”IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN otherwise. Kernel can recognise stacked interfaces because their ifindex != iflink.”h]”hŒ”IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN otherwise. Kernel can recognise stacked interfaces because their ifindex != iflink.”…””}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‰hj„ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjrubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K‹hjoubjU)”}”(hŒ7netif_carrier_ok() && netif_dormant(): IF_OPER_DORMANT ”h]”(j[)”}”(hŒ&netif_carrier_ok() && netif_dormant():”h]”hŒ&netif_carrier_ok() && netif_dormant():”…””}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´KŽhj¡ubjk)”}”(hhh]”hï)”}”(hŒIF_OPER_DORMANT”h]”hŒIF_OPER_DORMANT”…””}”(hj¶h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´KŽhj³ubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhj¡ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´KŽhjoh²hubjU)”}”(hŒÉnetif_carrier_ok() && !netif_dormant(): IF_OPER_UP if userspace interaction is disabled. Otherwise IF_OPER_DORMANT with the possibility for userspace to initiate the IF_OPER_UP transition afterwards. ”h]”(j[)”}”(hŒ'netif_carrier_ok() && !netif_dormant():”h]”hŒ'netif_carrier_ok() && !netif_dormant():”…””}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jZh³hÇh´K”hjÐubjk)”}”(hhh]”hï)”}”(hŒŸIF_OPER_UP if userspace interaction is disabled. Otherwise IF_OPER_DORMANT with the possibility for userspace to initiate the IF_OPER_UP transition afterwards.”h]”hŒŸIF_OPER_UP if userspace interaction is disabled. Otherwise IF_OPER_DORMANT with the possibility for userspace to initiate the IF_OPER_UP transition afterwards.”…””}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K‘hjâubah}”(h]”h ]”h"]”h$]”h&]”uh1jjhjÐubeh}”(h]”h ]”h"]”h$]”h&]”uh1jTh³hÇh´K”hjoh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1jOhjàh²hh³hÇh´Nubeh}”(h]”Œkernel-driver-api”ah ]”h"]”Œ3. kernel driver api”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KcubhÉ)”}”(hhh]”(hÎ)”}”(hŒ4. Setting from userspace”h]”hŒ4. Setting from userspace”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj h²hh³hÇh´K—ubhï)”}”(hX:Applications have to use the netlink interface to influence the RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1 via RTM_SETLINK instructs the kernel that an interface should go to IF_OPER_DORMANT instead of IF_OPER_UP when the combination netif_carrier_ok() && !netif_dormant() is set by the driver. Afterwards, the userspace application can set IFLA_OPERSTATE to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set netif_carrier_off() or netif_dormant_on(). Changes made by userspace are multicasted on the netlink group RTNLGRP_LINK.”h]”hX:Applications have to use the netlink interface to influence the RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1 via RTM_SETLINK instructs the kernel that an interface should go to IF_OPER_DORMANT instead of IF_OPER_UP when the combination netif_carrier_ok() && !netif_dormant() is set by the driver. Afterwards, the userspace application can set IFLA_OPERSTATE to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set netif_carrier_off() or netif_dormant_on(). Changes made by userspace are multicasted on the netlink group RTNLGRP_LINK.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K™hj h²hubhï)”}”(hŒESo basically a 802.1X supplicant interacts with the kernel like this:”h]”hŒESo basically a 802.1X supplicant interacts with the kernel like this:”…””}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K£hj h²hubhŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒsubscribe to RTNLGRP_LINK”h]”hï)”}”(hjCh]”hŒsubscribe to RTNLGRP_LINK”…””}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¥hjAubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒ&set IFLA_LINKMODE to 1 via RTM_SETLINK”h]”hï)”}”(hjZh]”hŒ&set IFLA_LINKMODE to 1 via RTM_SETLINK”…””}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¦hjXubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒ+query RTM_GETLINK once to get initial state”h]”hï)”}”(hjqh]”hŒ+query RTM_GETLINK once to get initial state”…””}”(hjsh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K§hjoubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒhif initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until netlink multicast signals this state”h]”hï)”}”(hŒhif initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until netlink multicast signals this state”h]”hŒhif initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until netlink multicast signals this state”…””}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K¨hj†ubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒ2do 802.1X, eventually abort if flags go down again”h]”hï)”}”(hj h]”hŒ2do 802.1X, eventually abort if flags go down again”…””}”(hj¢h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kªhjžubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒesend RTM_SETLINK to set operstate to IF_OPER_UP if authentication succeeds, IF_OPER_DORMANT otherwise”h]”hï)”}”(hŒesend RTM_SETLINK to set operstate to IF_OPER_UP if authentication succeeds, IF_OPER_DORMANT otherwise”h]”hŒesend RTM_SETLINK to set operstate to IF_OPER_UP if authentication succeeds, IF_OPER_DORMANT otherwise”…””}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K«hjµubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒAsee how operstate and IFF_RUNNING is echoed via netlink multicast”h]”hï)”}”(hjÏh]”hŒAsee how operstate and IFF_RUNNING is echoed via netlink multicast”…””}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K­hjÍubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒFset interface back to IF_OPER_DORMANT if 802.1X reauthentication fails”h]”hï)”}”(hŒFset interface back to IF_OPER_DORMANT if 802.1X reauthentication fails”h]”hŒFset interface back to IF_OPER_DORMANT if 802.1X reauthentication fails”…””}”(hjèh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K®hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubj@)”}”(hŒ;restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag ”h]”hï)”}”(hŒ:restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag”h]”hŒ:restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K°hjüubah}”(h]”h ]”h"]”h$]”h&]”uh1j?hj<h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j:h³hÇh´K¥hj h²hubhï)”}”(hŒZif supplicant goes down, bring back IFLA_LINKMODE to 0 and IFLA_OPERSTATE to a sane value.”h]”hŒZif supplicant goes down, bring back IFLA_LINKMODE to 0 and IFLA_OPERSTATE to a sane value.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´K²hj h²hubhï)”}”(hŒ¸A routing daemon or dhcp client just needs to care for IFF_RUNNING or waiting for operstate to go IF_OPER_UP/IF_OPER_UNKNOWN before considering the interface / querying a DHCP address.”h]”hŒ¸A routing daemon or dhcp client just needs to care for IFF_RUNNING or waiting for operstate to go IF_OPER_UP/IF_OPER_UNKNOWN before considering the interface / querying a DHCP address.”…””}”(hj*h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kµhj h²hubhï)”}”(hŒ\For technical questions and/or comments please e-mail to Stefan Rompf (stefan at loplof.de).”h]”hŒ\For technical questions and/or comments please e-mail to Stefan Rompf (stefan at loplof.de).”…””}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hîh³hÇh´Kºhj h²hubeh}”(h]”Œsetting-from-userspace”ah ]”h"]”Œ4. setting from userspace”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K—ubeh}”(h]”Œoperational-states”ah ]”h"]”Œoperational states”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jyŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jSjPjjjÝjÚj jjÕjÒj jjKjHuŒ nametypes”}”(jS‰j‰j݉j ‰jÕ‰j ‰jK‰uh}”(jPhÊjhÝjÚj"jjjÒj£jjàjHj uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.