diff options
| author | hannes <hannes> | 2003-12-29 19:05:37 +0000 |
|---|---|---|
| committer | hannes <hannes> | 2003-12-29 19:05:37 +0000 |
| commit | 69b12b33d454c54058a4b46948ce34c78c8cbebc (patch) | |
| tree | 018eda2c84774f8060edf1b4571f0ab8e19e1fd6 /print-ether.c | |
| parent | 388842b5e4f834e769951b1c25fc206c96563e42 (diff) | |
| download | tcpdump-69b12b33d454c54058a4b46948ce34c78c8cbebc.tar.gz | |
print ethertypes in hex and fix qflag handling for unknown ethertypes
Diffstat (limited to 'print-ether.c')
| -rw-r--r-- | print-ether.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/print-ether.c b/print-ether.c index 0eaaf03b..e6f759b5 100644 --- a/print-ether.c +++ b/print-ether.c @@ -20,7 +20,7 @@ */ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.86 2003-12-29 09:29:29 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.87 2003-12-29 19:05:37 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -87,8 +87,14 @@ ether_hdr_print(register const u_char *bp, u_int length) if (ntohs(ep->ether_type) <= ETHERMTU) (void)printf(", 802.3"); else - (void)printf(", ethertype %s", - tok2str(ethertype_values,"0x%04x", ntohs(ep->ether_type))); + (void)printf(", ethertype %s (0x%04x)", + tok2str(ethertype_values,"Unknown", ntohs(ep->ether_type)), + ntohs(ep->ether_type)); + } else { + if (ntohs(ep->ether_type) <= ETHERMTU) + (void)printf(", 802.3"); + else + (void)printf(", %s", tok2str(ethertype_values,"Unknown Ethertype (0x%04x)", ntohs(ep->ether_type))); } (void)printf(", length %u: ", length); |
