[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230119115302.28067-1-ehakim@nvidia.com>
Date: Thu, 19 Jan 2023 13:53:02 +0200
From: <ehakim@...dia.com>
To: <sd@...asysnail.net>
CC: <dsahern@...nel.org>, <netdev@...r.kernel.org>,
Emeel Hakim <ehakim@...dia.com>
Subject: [PATCH iproute2 1/1] macsec: Fix Macsec packet number attribute print
From: Emeel Hakim <ehakim@...dia.com>
Currently Macsec print routines uses a 32 bit print routine
to print out the value of the packet number (PN) attribute, a
miss use of the 32 bit print routine is causing a miss print of
only the 32 least significant bit (LSB) of an extended packet
number (XPN) which is a 64 bit attribute.
Fixes: 6ce23b7c2d79 ("macsec: add Extended Packet Number support")
Signed-off-by: Emeel Hakim <ehakim@...dia.com>
---
ip/ipmacsec.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
index 8da7c3d3..8b0d5666 100644
--- a/ip/ipmacsec.c
+++ b/ip/ipmacsec.c
@@ -938,8 +938,8 @@ static void print_tx_sc(const char *prefix, __u64 sci, __u8 encoding_sa,
print_uint(PRINT_ANY, "an", "%d:",
rta_getattr_u8(sa_attr[MACSEC_SA_ATTR_AN]));
if (is_xpn) {
- print_uint(PRINT_ANY, "pn", " PN %u,",
- rta_getattr_u64(sa_attr[MACSEC_SA_ATTR_PN]));
+ print_lluint(PRINT_ANY, "pn", " PN %llu,",
+ rta_getattr_u64(sa_attr[MACSEC_SA_ATTR_PN]));
print_0xhex(PRINT_ANY, "ssci",
"SSCI %08x",
ntohl(rta_getattr_u32(sa_attr[MACSEC_SA_ATTR_SSCI])));
@@ -1015,8 +1015,8 @@ static void print_rx_sc(const char *prefix, __be64 sci, __u8 active,
print_uint(PRINT_ANY, "an", "%u:",
rta_getattr_u8(sa_attr[MACSEC_SA_ATTR_AN]));
if (is_xpn) {
- print_uint(PRINT_ANY, "pn", " PN %u,",
- rta_getattr_u64(sa_attr[MACSEC_SA_ATTR_PN]));
+ print_lluint(PRINT_ANY, "pn", " PN %llu,",
+ rta_getattr_u64(sa_attr[MACSEC_SA_ATTR_PN]));
print_0xhex(PRINT_ANY, "ssci",
"SSCI %08x",
ntohl(rta_getattr_u32(sa_attr[MACSEC_SA_ATTR_SSCI])));
--
2.21.3
Powered by blists - more mailing lists