From 4c8ec560fa6f4f1235f754cb0f177d7cde89fb7b Mon Sep 17 00:00:00 2001 From: Sanath Kumar Gampa Date: Tue, 14 Jun 2022 11:00:35 +0530 Subject: [PATCH] nvethernet:macsec:Replay protection enable config Issue: Replay protection is enabled by default though disabled from supplicant configuration Fix: If replay protection is enabled from supplcant use maximum PN window Bug 3673458 Change-Id: I5a2c3f0b6bca56831afb0e5f635dbdd8e8bc4db8 Signed-off-by: Sanath Kumar Gampa Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2728326 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/net/ethernet/nvidia/nvethernet/macsec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/macsec.c b/drivers/net/ethernet/nvidia/nvethernet/macsec.c index fbf2daa8..b335d39a 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/macsec.c +++ b/drivers/net/ethernet/nvidia/nvethernet/macsec.c @@ -1391,7 +1391,13 @@ static int macsec_set_replay_prot(struct sk_buff *skb, struct genl_info *info) goto exit; } - macsec_pdata->pn_window = window; + /* If Replay protection is disabled from supplicant use maximum + * PN window as replay protecion is already enabled in macsec_init + */ + if (replay_prot == OSI_ENABLE) + macsec_pdata->pn_window = window; + else + macsec_pdata->pn_window = OSI_PN_MAX_DEFAULT; exit: PRINT_EXIT();