Use "int"s, not "guint16"s, as packet offsets (using values shorter
[obnox/wireshark/wip.git] / plugins / docsis / packet-dsaack.c
index e4a3f194fabc7f5d6250f80012bac9b085404bd1..0723fedb5ed22324d733e1f471d98d1df06e99cc 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for Dynamic Service Addition Acknowledge dissection
  * Copyright 2002, Anand V. Narwani <anand[AT]narwani.org>
  *
- * $Id: packet-dsaack.c,v 1.5 2003/05/28 14:52:52 gerald Exp $
+ * $Id: packet-dsaack.c,v 1.6 2003/12/13 03:18:38 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -60,13 +60,11 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
   proto_item *it;
   proto_tree *dsaack_tree;
   guint16 transid;
-  guint16 tlv_data_len;
   guint8 response;
   tvbuff_t *next_tvb;
 
   transid = tvb_get_ntohs (tvb, 0);
   response = tvb_get_guint8 (tvb, 2);
-  tlv_data_len = tvb_length_remaining (tvb, 3);
 
   if (check_col (pinfo->cinfo, COL_INFO))
     {
@@ -79,8 +77,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
   if (tree)
     {
       it =
-       proto_tree_add_protocol_format (tree, proto_docsis_dsaack, tvb, 0,
-                                       tvb_length_remaining (tvb, 0),
+       proto_tree_add_protocol_format (tree, proto_docsis_dsaack, tvb, 0, -1,
                                        "DSA Acknowledge");
       dsaack_tree = proto_item_add_subtree (it, ett_docsis_dsaack);
       proto_tree_add_item (dsaack_tree, hf_docsis_dsaack_tranid, tvb, 0, 2,
@@ -89,7 +86,7 @@ dissect_dsaack (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                           FALSE);
 
       /* Call Dissector for Appendix C TLV's */
-      next_tvb = tvb_new_subset (tvb, 3, tlv_data_len, tlv_data_len);
+      next_tvb = tvb_new_subset (tvb, 3, -1, -1);
       call_dissector (docsis_tlv_handle, next_tvb, pinfo, dsaack_tree);
     }
 }