aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmeel Hakim <ehakim@nvidia.com>2023-01-19 13:53:02 +0200
committerStephen Hemminger <stephen@networkplumber.org>2023-01-25 10:23:43 -0800
commit55738f8ee1ebd5a83f66622e57e12805e8cc33df (patch)
tree7242e07ce276c364a211ce056ed2a3438dc1f0be
parentd7f81def84013202f27cf84ee455f644ff685443 (diff)
downloadiproute2-55738f8ee1ebd5a83f66622e57e12805e8cc33df.tar.gz
macsec: Fix Macsec packet number attribute print
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@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--ip/ipmacsec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c
index 8da7c3d3d..8b0d56665 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])));