net: macsec: update SCI upon MAC address change.
SCI should be updated, because it contains MAC in its first 6 octets.
Fixes: c09440f7dc
("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>
This commit is contained in:
parent
7d7195a026
commit
6fc498bc82
@ -424,6 +424,11 @@ static struct macsec_eth_header *macsec_ethhdr(struct sk_buff *skb)
|
||||
return (struct macsec_eth_header *)skb_mac_header(skb);
|
||||
}
|
||||
|
||||
static sci_t dev_to_sci(struct net_device *dev, __be16 port)
|
||||
{
|
||||
return make_sci(dev->dev_addr, port);
|
||||
}
|
||||
|
||||
static void __macsec_pn_wrapped(struct macsec_secy *secy,
|
||||
struct macsec_tx_sa *tx_sa)
|
||||
{
|
||||
@ -3268,6 +3273,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;
|
||||
}
|
||||
|
||||
@ -3593,11 +3599,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);
|
||||
|
Loading…
Reference in New Issue
Block a user