Set the tvbuff length for ARP packets, so the Ethernet dissector knows
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 19 Nov 2000 01:00:20 +0000 (01:00 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 19 Nov 2000 01:00:20 +0000 (01:00 +0000)
how much of the packet is padding.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2663 f5534014-38df-0310-8fa8-9805f1628bb7

packet-arp.c

index ce238186631d4c3cc452102bd3e7805e2e0cae52..20ed13d1ea83ecf163f29430050b7ac0bfdca4d4 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-arp.c
  * Routines for ARP packet disassembly
  *
- * $Id: packet-arp.c,v 1.35 2000/11/17 21:00:35 gram Exp $
+ * $Id: packet-arp.c,v 1.36 2000/11/19 01:00:20 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -414,6 +414,11 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 
   tot_len = MIN_ATMARP_HEADER_SIZE + ar_shtl + ar_ssl + ar_spln +
                                ar_thtl + ar_tsl + ar_tpln;
+  
+  /* Adjust the length of this tvbuff to include only the ARP datagram.
+     Our caller may use that to determine how much of its packet
+     was padding. */
+  tvb_set_reported_length(tvb, tot_len);
 
   /* Extract the addresses.  */
   sha_offset = MIN_ATMARP_HEADER_SIZE;
@@ -459,7 +464,7 @@ dissect_atmarp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   tpa_offset = tsa_offset + ar_tsl;
   tpa_val = tvb_get_ptr(tvb, tpa_offset, ar_tpln);
   tpa_str = arpproaddr_to_str(tpa_val, ar_tpln, ar_pro);
-  
+
   if (check_col(pinfo->fd, COL_PROTOCOL)) {
     switch (ar_op) {
 
@@ -594,6 +599,11 @@ dissect_arp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   ar_op  = tvb_get_ntohs(tvb, AR_OP);
 
   tot_len = MIN_ARP_HEADER_SIZE + ar_hln*2 + ar_pln*2;
+  
+  /* Adjust the length of this tvbuff to include only the ARP datagram.
+     Our caller may use that to determine how much of its packet
+     was padding. */
+  tvb_set_reported_length(tvb, tot_len);
 
   /* Extract the addresses.  */
   sha_offset = MIN_ARP_HEADER_SIZE;