mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
Nvethernet: changes to receive lpn in enable SA
Enhancement to receive lowest_pn from supplicant as part of receive AN enable. Also accept pn_window as 0 from supplicant Bug 3371004 Change-Id: Ic9b90ea902b9f450fc29a397f93be5cca01e9e87 Signed-off-by: Sanath Kumar Gampa <sgampa@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2619948 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Mahesh Patil <maheshp@nvidia.com> Reviewed-by: Bhadram Varka <vbhadram@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Revanth Kumar Uppala
parent
5a66fdbf00
commit
a43d0166c5
@@ -599,6 +599,9 @@ static int parse_sa_config(struct nlattr **attrs, struct nlattr **tb_sa,
|
||||
if (tb_sa[NV_MACSEC_SA_ATTR_PN]) {
|
||||
sc_info->next_pn = nla_get_u32(tb_sa[NV_MACSEC_SA_ATTR_PN]);
|
||||
}
|
||||
if (tb_sa[NV_MACSEC_SA_ATTR_LOWEST_PN]) {
|
||||
sc_info->lowest_pn = nla_get_u32(tb_sa[NV_MACSEC_SA_ATTR_LOWEST_PN]);
|
||||
}
|
||||
if (tb_sa[NV_MACSEC_SA_ATTR_KEY]) {
|
||||
memcpy(sc_info->sak, nla_data(tb_sa[NV_MACSEC_SA_ATTR_KEY]),
|
||||
sizeof(sc_info->sak));
|
||||
@@ -731,11 +734,12 @@ static int macsec_en_rx_sa(struct sk_buff *skb, struct genl_info *info)
|
||||
"\tsci: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"
|
||||
"\tan: %u\n"
|
||||
"\tpn: %u\n"
|
||||
"\tlowest pn: %u\n"
|
||||
"\twindow: %u",
|
||||
__func__,
|
||||
rx_sa.sci[0], rx_sa.sci[1], rx_sa.sci[2], rx_sa.sci[3],
|
||||
rx_sa.sci[4], rx_sa.sci[5], rx_sa.sci[6], rx_sa.sci[7],
|
||||
rx_sa.curr_an, rx_sa.next_pn, rx_sa.pn_window);
|
||||
rx_sa.curr_an, rx_sa.next_pn, rx_sa.lowest_pn, rx_sa.pn_window);
|
||||
pr_err("\tkey: ");
|
||||
for (i = 0; i < 16; i++) {
|
||||
pr_cont(" %02x", rx_sa.sak[i]);
|
||||
@@ -1124,11 +1128,7 @@ static int macsec_set_replay_prot(struct sk_buff *skb, struct genl_info *info)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (window != 0) {
|
||||
macsec_pdata->pn_window = window;
|
||||
} else {
|
||||
macsec_pdata->pn_window = OSI_PN_MAX_DEFAULT;
|
||||
}
|
||||
macsec_pdata->pn_window = window;
|
||||
|
||||
exit:
|
||||
PRINT_EXIT();
|
||||
|
||||
@@ -58,6 +58,7 @@ enum nv_macsec_sa_attrs {
|
||||
NV_MACSEC_SA_ATTR_SCI,
|
||||
NV_MACSEC_SA_ATTR_AN,
|
||||
NV_MACSEC_SA_ATTR_PN,
|
||||
NV_MACSEC_SA_ATTR_LOWEST_PN,
|
||||
NV_MACSEC_SA_ATTR_KEY,
|
||||
__NV_MACSEC_SA_ATTR_END,
|
||||
NUM_NV_MACSEC_SA_ATTR = __NV_MACSEC_SA_ATTR_END,
|
||||
@@ -107,6 +108,7 @@ static const struct nla_policy nv_macsec_sa_genl_policy[NUM_NV_MACSEC_SA_ATTR] =
|
||||
.len = 8, }, /* SCI is 64bit */
|
||||
[NV_MACSEC_SA_ATTR_AN] = { .type = NLA_U8 },
|
||||
[NV_MACSEC_SA_ATTR_PN] = { .type = NLA_U32 },
|
||||
[NV_MACSEC_SA_ATTR_LOWEST_PN] = { .type = NLA_U32 },
|
||||
[NV_MACSEC_SA_ATTR_KEY] = { .type = NLA_BINARY,
|
||||
.len = OSI_KEY_LEN_128,},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user