macsec: Fix Macsec packet number attribute print
Subsystems (2)
PATCH 1/1 macsec: Fix Macsec packet number attribute print
From: Emeel Hakim <[email protected]>
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.
--- ip/ipmacsec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ip/ipmacsec.c +4 -4
@@ -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 ])));
Signature · 1 line
2.21.3
Quoted 10 lines · On Thu, Jan 19, 2023 at 01:53:02PM +0200, [email protected] wrote:
From: Emeel Hakim <[email protected]>
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 <[email protected]>
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 9 lines · On Thu, 19 Jan 2023 13:53:02 +0200 you wrote:
From: Emeel Hakim <[email protected]>
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.
[...]
Here is the summary with links:
- [iproute2,1/1] macsec: Fix Macsec packet number attribute print
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=55738f8ee1eb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html