Skip to content

Commit 80df470

Browse files
qsndavem330
authored andcommitted
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: dcb780f ("net: macsec: add nla support for changing the offloading selection") Signed-off-by: Sabrina Dubroca <[email protected]> Reviewed-by: Antoine Tenart <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 73a4b31 commit 80df470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/macsec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ static bool macsec_is_configured(struct macsec_dev *macsec)
25712571
struct macsec_tx_sc *tx_sc = &secy->tx_sc;
25722572
int i;
25732573

2574-
if (secy->n_rx_sc > 0)
2574+
if (secy->rx_sc)
25752575
return true;
25762576

25772577
for (i = 0; i < MACSEC_NUM_AN; i++)

0 commit comments

Comments
 (0)