macsec: let the administrator set UP state even if lowerdev is down
authorSabrina Dubroca <sd@queasysnail.net>
Sun, 28 Oct 2018 08:33:10 +0000 (09:33 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Nov 2019 17:28:43 +0000 (18:28 +0100)
[ Upstream commit 07bddef9839378bd6f95b393cf24c420529b4ef1 ]

Currently, the kernel doesn't let the administrator set a macsec device
up unless its lower device is currently up. This is inconsistent, as a
macsec device that is up won't automatically go down when its lower
device goes down.

Now that linkstate propagation works, there's really no reason for this
limitation, so let's remove it.

Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Reported-by: Radu Rendec <radu.rendec@gmail.com>
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/macsec.c

index d2a3825376be503085a9b78d2c4b68b3e3e9c566..a48ed0873cc72383da8b2e5a42b54143b6a10222 100644 (file)
@@ -2798,9 +2798,6 @@ static int macsec_dev_open(struct net_device *dev)
        struct net_device *real_dev = macsec->real_dev;
        int err;
 
-       if (!(real_dev->flags & IFF_UP))
-               return -ENETDOWN;
-
        err = dev_uc_add(real_dev, dev->dev_addr);
        if (err < 0)
                return err;