]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "net: macsec: update SCI upon MAC address change."
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 17 Aug 2022 12:54:36 +0000 (14:54 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 19 Aug 2022 23:50:36 +0000 (16:50 -0700)
commitbec53d311170ed1df88b7423e5f71bb018b70369
tree6853ae0db1837ee3c7ba4a6df816c607f92e9a3b
parentf98aa48e4f143c4654725178a4f3163e9b872584
Revert "net: macsec: update SCI upon MAC address change."

This reverts commit ed3cb35c7ab1edb3181aa14dfc9c69aee62c45a6.

Commit ed3cb35c7ab1 states:

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

That's not entirely correct. The SCI can be based on the MAC address,
but doesn't have to be. We can also use any 64-bit number as the
SCI. When the SCI based on the MAC address, it uses a 16-bit "port
number" provided by userspace, which commit ed3cb35c7ab1 overwrites
with 1.

In addition, changing the SCI after macsec has been setup can just
confuse the receiver. If we configure the RXSC on the peer based on
the original SCI, we should keep the same SCI on TX.

When the macsec device is being managed by a userspace key negotiation
daemon such as wpa_supplicant, commit ed3cb35c7ab1 would also
overwrite the SCI defined by userspace.

Fixes: ed3cb35c7ab1 ("net: macsec: update SCI upon MAC address change.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/9b1a9d28327e7eb54550a92eebda45d25e54dd0d.1660667033.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/macsec.c