Commit fc094dab authored by Dmitry Bogdanov's avatar Dmitry Bogdanov Committed by Greg Kroah-Hartman

net: macsec: update SCI upon MAC address change.

[ Upstream commit 6fc498bc ]

SCI should be updated, because it contains MAC in its first 6 octets.

Fixes: c09440f7 ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: default avatarDmitry Bogdanov <dbogdanov@marvell.com>
Signed-off-by: default avatarMark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: default avatarIgor Russkikh <irusskikh@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d80c781
...@@ -2871,6 +2871,11 @@ static void macsec_dev_set_rx_mode(struct net_device *dev) ...@@ -2871,6 +2871,11 @@ static void macsec_dev_set_rx_mode(struct net_device *dev)
dev_uc_sync(real_dev, 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) static int macsec_set_mac_address(struct net_device *dev, void *p)
{ {
struct macsec_dev *macsec = macsec_priv(dev); struct macsec_dev *macsec = macsec_priv(dev);
...@@ -2892,6 +2897,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p) ...@@ -2892,6 +2897,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p)
out: out:
ether_addr_copy(dev->dev_addr, addr->sa_data); ether_addr_copy(dev->dev_addr, addr->sa_data);
macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
return 0; return 0;
} }
...@@ -3160,11 +3166,6 @@ static bool sci_exists(struct net_device *dev, sci_t sci) ...@@ -3160,11 +3166,6 @@ static bool sci_exists(struct net_device *dev, sci_t sci)
return false; 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) static int macsec_add_dev(struct net_device *dev, sci_t sci, u8 icv_len)
{ {
struct macsec_dev *macsec = macsec_priv(dev); struct macsec_dev *macsec = macsec_priv(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment