Wireshark-bugs: [Wireshark-bugs] [Bug 1935] New: Wireshark does not parse dhcpv6 vendor-specific

Date: Tue, 23 Oct 2007 12:37:01 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1935

           Summary: Wireshark does not parse dhcpv6 vendor-specific option
                    properly
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: jlange6648@xxxxxxxxx


Build Information:
wireshark 0.99.7 (SVN Rev 23253)

Copyright 1998-2007 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled with GTK+ 2.10.6, with GLib 2.12.4, with libpcap 0.9.4, with libz
1.2.3, with libpcre 6.7, without SMI, without ADNS, without Lua, with GnuTLS
1.4.4, with Gcrypt 1.2.3, without Kerberos, without PortAudio, without AirPcap.

Running on Linux 2.6.18.8-0.7-default, with libpcap version 0.9.4.

Built using gcc 4.1.2 20061115 (prerelease) (SUSE Linux).

--
RFC3315 says that the vendor-specific information option must encapsulate each
option in the format code/length/value.  The current dhcpv6 dissector does not
differentiate these fields, it just puts it all together as one option-data
field. Attached is a patch that addresses this issue.


Index: epan/dissectors/packet-dhcpv6.c
===================================================================
--- epan/dissectors/packet-dhcpv6.c     (revision 23253)
+++ epan/dissectors/packet-dhcpv6.c     (working copy)
@@ -609,9 +609,10 @@
          proto_tree_add_text(subtree, tvb, off, 4,
                              "enterprise-number: %u",
                              tvb_get_ntohl(tvb, off));
-         if (optlen > 4) {
-           proto_tree_add_text(subtree, tvb, off+4, optlen-4,
-                               "option-data");
+         if (optlen >= 4) {
+           proto_tree_add_text(subtree, tvb, off+4, 2, "option code: %d",
tvb_get_ntohs(tvb, off+4));
+           proto_tree_add_text(subtree, tvb, off+6, 2, "option length: %d",
tvb_get_ntohs(tvb, off+6));
+           proto_tree_add_text(subtree, tvb, off+8, optlen-8, "option-data");
          }
          break;
        case OPTION_INTERFACE_ID:


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.