net: decode AF_PACKET protocols in socket syscall

* net.c (SYS_FUNC(socket)) <AF_PACKET>: Decode using ethernet_protocols
xlat.
This commit is contained in:
Eugene Syromyatnikov 2018-08-27 15:20:33 +02:00
parent 849d1ea8ac
commit 9964dc7dc4

8
net.c
View File

@ -86,6 +86,7 @@
#define XLAT_MACROS_ONLY
# include "xlat/addrfams.h"
# include "xlat/ethernet_protocols.h"
#undef XLAT_MACROS_ONLY
#include "xlat/ax25_protocols.h"
#include "xlat/irda_protocols.h"
@ -155,6 +156,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;