lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.5 021/151] net: macsec: update SCI upon MAC address change.
    Date
    From: Dmitry Bogdanov <dbogdanov@marvell.com>

    [ 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>
    ---
    drivers/net/macsec.c | 11 ++++++-----
    1 file changed, 6 insertions(+), 5 deletions(-)

    --- a/drivers/net/macsec.c
    +++ b/drivers/net/macsec.c
    @@ -532,6 +532,11 @@ static struct macsec_eth_header *macsec_
    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 u32 tx_sa_update_pn(struct macsec_tx_sa *tx_sa, struct macsec_secy *secy)
    {
    u32 pn;
    @@ -2903,6 +2908,7 @@ static int macsec_set_mac_address(struct

    out:
    ether_addr_copy(dev->dev_addr, addr->sa_data);
    + macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
    return 0;
    }

    @@ -3176,11 +3182,6 @@ static bool sci_exists(struct net_device
    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);

    \
     
     \ /
      Last update: 2020-03-17 12:17    [W:6.422 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site