aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/phy
diff options
context:
space:
mode:
authorGravatar Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> 2023-10-05 21:06:35 +0300
committerGravatar Paolo Abeni <pabeni@redhat.com> 2023-10-10 10:30:31 +0200
commite0a8c918daa58700609ebd45e3fcd49965be8bbc (patch)
tree147947adb99a56608f160ef487b828cac7a4a0e2 /drivers/net/phy
parentocteontx2-pf: mcs: update PN only when update_pn is true (diff)
downloadlinux-e0a8c918daa58700609ebd45e3fcd49965be8bbc.tar.gz
linux-e0a8c918daa58700609ebd45e3fcd49965be8bbc.tar.bz2
linux-e0a8c918daa58700609ebd45e3fcd49965be8bbc.zip
net: phy: mscc: macsec: reject PN update requests
Updating the PN is not supported. Return -EINVAL if update_pn is true. The following command succeeded, but it should fail because the driver does not update the PN: ip macsec set macsec0 tx sa 0 pn 232 on Fixes: 28c5107aa904 ("net: phy: mscc: macsec support") Signed-off-by: Radu Pirea (NXP OSS) <radu-nicolae.pirea@oss.nxp.com> Reviewed-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/phy')
-rw-r--r--drivers/net/phy/mscc/mscc_macsec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/phy/mscc/mscc_macsec.c b/drivers/net/phy/mscc/mscc_macsec.c
index 018253a573b8..4f39ba63a9a9 100644
--- a/drivers/net/phy/mscc/mscc_macsec.c
+++ b/drivers/net/phy/mscc/mscc_macsec.c
@@ -849,6 +849,9 @@ static int vsc8584_macsec_upd_rxsa(struct macsec_context *ctx)
struct macsec_flow *flow;
int ret;
+ if (ctx->sa.update_pn)
+ return -EINVAL;
+
flow = vsc8584_macsec_find_flow(ctx, MACSEC_INGR);
if (IS_ERR(flow))
return PTR_ERR(flow);
@@ -900,6 +903,9 @@ static int vsc8584_macsec_upd_txsa(struct macsec_context *ctx)
struct macsec_flow *flow;
int ret;
+ if (ctx->sa.update_pn)
+ return -EINVAL;
+
flow = vsc8584_macsec_find_flow(ctx, MACSEC_EGR);
if (IS_ERR(flow))
return PTR_ERR(flow);