]> git.baikalelectronics.ru Git - kernel.git/commit
macsec: fix detection of RXSCs when toggling offloading
authorSabrina Dubroca <sd@queasysnail.net>
Wed, 2 Nov 2022 21:33:15 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Nov 2022 10:43:56 +0000 (10:43 +0000)
commitcbd6d661283dfd47728fb14eb32c2d5f2173deb8
tree6acbb17cae9d4a447bca2902524d1dde987b01e1
parentfd11c66c5e17bd006620a7aae4e98d77c7308f1a
macsec: fix detection of RXSCs when toggling offloading

macsec_is_configured incorrectly uses secy->n_rx_sc to check if some
RXSCs exist. secy->n_rx_sc only counts the number of active RXSCs, but
there can also be inactive SCs as well, which may be stored in the
driver (in case we're disabling offloading), or would have to be
pushed to the device (in case we're trying to enable offloading).

As long as RXSCs active on creation and never turned off, the issue is
not visible.

Fixes: 846a87f53410 ("net: macsec: add nla support for changing the offloading selection")
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