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>
This commit is contained in:
Andrew Lunn
2020-04-20 00:11:50 +02:00
committed by David S. Miller
parent 749d22e8f6
commit eec517cdb4
5 changed files with 65 additions and 3 deletions

View File

@@ -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)