]> git.baikalelectronics.ru Git - kernel.git/commit
macsec: fix secy->n_rx_sc accounting
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 2 Nov 2022 21:33:14 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2022 10:43:56 +0000 (10:43 +0000)
commitfd11c66c5e17bd006620a7aae4e98d77c7308f1a
tree62983380cbd7b22b8f7ecf0b5b70f58f8d7aebe0
parentc327b118c8b042acbd53083cfdee75d19f73b308
macsec: fix secy->n_rx_sc accounting

secy->n_rx_sc is supposed to be the number of _active_ rxsc's within a
secy. This is then used by macsec_send_sci to help decide if we should
add the SCI to the header or not.

This logic is currently broken when we create a new RXSC and turn it
off at creation, as create_rx_sc always sets ->active to true (and
immediately uses that to increment n_rx_sc), and only later
macsec_add_rxsc sets rx_sc->active.

Fixes: 4453af01ee3c ("macsec: introduce IEEE 802.1AE driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macsec.c