Wireshark-bugs: [Wireshark-bugs] [Bug 7047] bootp dissector issue with dhp option 82 - suboption
Date: Mon, 9 Apr 2012 06:53:15 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7047

Pascal Quantin <pascal.quantin@xxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pascal.quantin@xxxxxxxxx

--- Comment #4 from Pascal Quantin <pascal.quantin@xxxxxxxxx> 2012-04-09 06:53:15 PDT ---
After a quick look at the trunk source code, it appears that the loop condition
is still the same as in trunk-1.6:

while (suboptoff < optend)

I guess it should instead check how many bytes are consumed compared to the
subopt_len variable. Something like:
Index: epan/dissectors/packet-bootp.c
===================================================================
--- epan/dissectors/packet-bootp.c      (revision 41986)
+++ epan/dissectors/packet-bootp.c      (working copy)
@@ -2387,3 +2387,3 @@
                case 9:
-                       while (suboptoff < optend) {
+                       while ((suboptoff-optoff) < (subopt_len + 2)) {
                                enterprise = tvb_get_ntohl(tvb, suboptoff);

With the patch above, I get the following decoding:

User Datagram Protocol, Src Port: bootps (67), Dst Port: bootps (67)
Bootstrap Protocol
    Message type: Boot Request (1)
    Hardware type: Ethernet
    Hardware address length: 6
    Hops: 2
    Transaction ID: 0xbfa2e08c
    Seconds elapsed: 12
    Bootp flags: 0x0000 (Unicast)
    Client IP address: 0.0.0.0 (0.0.0.0)
    Your (client) IP address: 0.0.0.0 (0.0.0.0)
    Next server IP address: 0.0.0.0 (0.0.0.0)
    Relay agent IP address: 10.110.54.242 (10.110.54.242)
    Client MAC address: Intel_9c:9c:34 (00:18:de:9c:9c:34)
    Client hardware address padding: 00000000000000000000
    Server host name not given
    Boot file name not given
    Magic cookie: DHCP
    Option: (53) DHCP Message Type
        Length: 1
        DHCP: Discover (1)
    Option: (116) DHCP Auto-Configuration
        Length: 1
        DHCP Auto-Configuration: AutoConfigure (1)
    Option: (61) Client identifier
        Length: 7
        Hardware type: Ethernet
        Client MAC address: Intel_9c:9c:34 (00:18:de:9c:9c:34)
    Option: (50) Requested IP Address
        Length: 4
        Requested IP Address: 94.238.32.252 (94.238.32.252)
    Option: (12) Host Name
        Length: 8
        Host Name: btw49154
    Option: (60) Vendor class identifier
        Length: 8
        Vendor class identifier: MSFT 5.0
    Option: (55) Parameter Request List
        Length: 11
        Parameter Request List Item: (1) Subnet Mask
        Parameter Request List Item: (15) Domain Name
        Parameter Request List Item: (3) Router
        Parameter Request List Item: (6) Domain Name Server
        Parameter Request List Item: (44) NetBIOS over TCP/IP Name Server
        Parameter Request List Item: (46) NetBIOS over TCP/IP Node Type
        Parameter Request List Item: (47) NetBIOS over TCP/IP Scope
        Parameter Request List Item: (31) Perform Router Discover
        Parameter Request List Item: (33) Static Route
        Parameter Request List Item: (249) Private/Classless Static Route
(Microsoft)
        Parameter Request List Item: (43) Vendor-Specific Information
    Option: (43) Vendor-Specific Information
        Length: 2
    Option: (82) Agent Information Option
        Length: 72
        Option 82 Suboption: (9) Vendor-Specific Information
            Length: 41
            Enterprise: ciscoSystems (9)
                Data Length: 36
            Value: 0a220a6efb45521c010948536e6574776f726b020f313131...
        Option 82 Suboption: (1) Agent Circuit ID
            Length: 4
            Agent Circuit ID: 00000000
        Option 82 Suboption: (6) Subscriber ID
            Length: 9
            Subscriber ID: WALLY-LNS
        Option 82 Suboption: (150) Unknown
            Length: 4
            Value: 59566840
        Option 82 Suboption: (152) Unknown
            Length: 4
            Value: 5956684e
    Option: (255) End
        Option End: 255

Is this what you expect?

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.