diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-12-29 04:16:57 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-12-29 04:16:57 +0000 |
commit | 5bcb17c724b7c1958a0f36d2a421fa7e6da9345e (patch) | |
tree | e462fe7b56e8626dcfee449e8761a52e236906a1 /packet-arp.c | |
parent | 00828b3f2bfe8523886257e54e37d34f18155f7d (diff) | |
download | wireshark-5bcb17c724b7c1958a0f36d2a421fa7e6da9345e.tar.gz wireshark-5bcb17c724b7c1958a0f36d2a421fa7e6da9345e.tar.bz2 wireshark-5bcb17c724b7c1958a0f36d2a421fa7e6da9345e.zip |
If we get an exception when dissecting a packet, append "[Short Frame]"
or "[Malformed Frame]" to the Info column.
Make some dissectors set the Protocol column and clear the Info column
before fetching anything from the tvbuff they were handed, so that if
the frame is short or malformed, it'll be marked as being the right
top-level protocol, and the Info column won't have cruft left over from
the previous protocol.
svn path=/trunk/; revision=2800
Diffstat (limited to 'packet-arp.c')
-rw-r--r-- | packet-arp.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/packet-arp.c b/packet-arp.c index 3b8448049b..a25ab8a77a 100644 --- a/packet-arp.c +++ b/packet-arp.c @@ -1,7 +1,7 @@ /* packet-arp.c * Routines for ARP packet disassembly * - * $Id: packet-arp.c,v 1.38 2000/11/30 10:42:50 guy Exp $ + * $Id: packet-arp.c,v 1.39 2000/12/29 04:16:57 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -651,6 +651,17 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) pinfo->current_proto = "ARP"; + /* Call it ARP, for now, so that if we throw an exception before + we decide whether it's ARP or RARP or IARP or ATMARP, it shows + up in the packet list as ARP. + + Clear the Info column so that, if we throw an exception, it + shows up as a short or malformed ARP frame. */ + if (check_col(pinfo->fd, COL_PROTOCOL)) + col_set_str(pinfo->fd, COL_PROTOCOL, "ARP"); + if (check_col(pinfo->fd, COL_INFO)) + col_clear(pinfo->fd, COL_INFO); + ar_hrd = tvb_get_ntohs(tvb, AR_HRD); if (ar_hrd == ARPHRD_ATM2225) { dissect_atmarp(tvb, pinfo, tree); |