diff options
author | Dmitry Bogdanov <dbogdanov@marvell.com> | 2020-03-10 18:22:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-18 09:14:12 +0300 |
commit | 28cedae50965a504c3dffaa7ecdbc0a6f056543f (patch) | |
tree | 9e7cc20a333afa63b18b6b45e5d311983de3ff42 /drivers | |
parent | 7aa760f0f545dc859d1f273e6d52dfac4c07f45e (diff) | |
download | linux-28cedae50965a504c3dffaa7ecdbc0a6f056543f.tar.xz |
net: macsec: update SCI upon MAC address change.
[ Upstream commit 6fc498bc82929ee23aa2f35a828c6178dfd3f823 ]
SCI should be updated, because it contains MAC in its first 6 octets.
Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Dmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/macsec.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 10a8ef2d025a..76dbe5f62932 100644 --- a/drivers/net/macsec.c +++ b/drivers/net/macsec.c @@ -2886,6 +2886,11 @@ static void macsec_dev_set_rx_mode(struct net_device *dev) dev_uc_sync(real_dev, dev); } +static sci_t dev_to_sci(struct net_device *dev, __be16 port) +{ + return make_sci(dev->dev_addr, port); +} + static int macsec_set_mac_address(struct net_device *dev, void *p) { struct macsec_dev *macsec = macsec_priv(dev); @@ -2907,6 +2912,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p) out: ether_addr_copy(dev->dev_addr, addr->sa_data); + macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES); return 0; } @@ -3188,11 +3194,6 @@ static bool sci_exists(struct net_device *dev, sci_t sci) return false; } -static sci_t dev_to_sci(struct net_device *dev, __be16 port) -{ - return make_sci(dev->dev_addr, port); -} - static int macsec_add_dev(struct net_device *dev, sci_t sci, u8 icv_len) { struct macsec_dev *macsec = macsec_priv(dev); |