From: Eugene Syromyatnikov Date: Mon, 27 Aug 2018 13:20:33 +0000 (+0200) Subject: net: decode AF_PACKET protocols in socket syscall X-Git-Tag: v4.25~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38e0f556022f9b38b401c63201b95a95fdefa91d;p=strace net: decode AF_PACKET protocols in socket syscall * net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode. (SYS_FUNC(socket)) : Decode using ethernet_protocols xlat. --- diff --git a/net.c b/net.c index 66dde0f4..58296b9c 100644 --- a/net.c +++ b/net.c @@ -86,6 +86,7 @@ #define XLAT_MACROS_ONLY # include "xlat/addrfams.h" +# include "xlat/ethernet_protocols.h" #undef XLAT_MACROS_ONLY #include "xlat/irda_protocols.h" #include "xlat/can_protocols.h" @@ -148,6 +149,13 @@ SYS_FUNC(socket) printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); break; + case AF_PACKET: + tprints("htons("); + printxval_searchn(ethernet_protocols, ethernet_protocols_size, + ntohs(tcp->u_arg[2]), "ETH_P_???"); + tprints(")"); + break; + case AF_IRDA: printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???"); break;