diff options
author | Andrew Lunn <andrew@lunn.ch> | 2020-04-20 00:11:50 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-04-20 12:43:24 -0700 |
commit | eec517cdb4810b3843eb7707971de3164088bff1 (patch) | |
tree | 082f3cf957cf9da4dfba2d2f57b36387faa8e9dc /net/core/rtnetlink.c | |
parent | 749d22e8f6d5645ed066ec434c0ce5327987c699 (diff) | |
download | linux-eec517cdb4810b3843eb7707971de3164088bff1.tar.bz2 |
net: Add IF_OPER_TESTING
RFC 2863 defines the operational state testing. Add support for this
state, both as a IF_LINK_MODE_ and __LINK_STATE_.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 709ebbf8ab5b..d6f4f4a9e8ba 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -829,11 +829,18 @@ static void set_operstate(struct net_device *dev, unsigned char transition) switch (transition) { case IF_OPER_UP: if ((operstate == IF_OPER_DORMANT || + operstate == IF_OPER_TESTING || operstate == IF_OPER_UNKNOWN) && - !netif_dormant(dev)) + !netif_dormant(dev) && !netif_testing(dev)) operstate = IF_OPER_UP; break; + case IF_OPER_TESTING: + if (operstate == IF_OPER_UP || + operstate == IF_OPER_UNKNOWN) + operstate = IF_OPER_TESTING; + break; + case IF_OPER_DORMANT: if (operstate == IF_OPER_UP || operstate == IF_OPER_UNKNOWN) |