Bug 2215 - BusyBox 1.17.0 fails to retrieve IP from DHCP
Summary: BusyBox 1.17.0 fails to retrieve IP from DHCP
Status: RESOLVED WORKSFORME
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-13 17:49 UTC by Jonas Christoffersen
Modified: 2010-08-11 22:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments
The output of running BB1.16.1 manually (293 bytes, application/octet-stream)
2010-07-13 17:49 UTC, Jonas Christoffersen
Details
The output of running BB1.17.1 manually (174 bytes, application/octet-stream)
2010-07-13 17:50 UTC, Jonas Christoffersen
Details
Wireshark-dump of udhcpc 1.16.1 (9.88 KB, application/octet-stream)
2010-07-13 17:54 UTC, Jonas Christoffersen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Christoffersen 2010-07-13 17:49:44 UTC
Created attachment 2221 [details]
The output of running BB1.16.1 manually

NOTE: This problem occurs in version 1.17.0

I tried to run MicroCore mc3.0rc1 (http://tinycorelinux.com/), That is runnimg BusyBox 1.17.0

On boot it runs '/bin/udhcpc -b -i eth0 -h box -p /var/run/udhcpc.etho.pid' and fails

I tried to mount the CD of and old release (mc3.0alpha5), running BB1.16.1, and run it manually, and it worked. (see attachment1 [details])

I then tried vesion 1.17.0 manually, but again it failed (see attachment 2)

I then ran wireshark, and found, that the 2 packages were not identical. It is some flags that are not identical (see attachment 3 [details] and 4)

The distribution is running under VMWare on Win 7
Comment 1 Jonas Christoffersen 2010-07-13 17:50:28 UTC
Created attachment 2227 [details]
The output of running BB1.17.1 manually
Comment 2 Jonas Christoffersen 2010-07-13 17:54:23 UTC
Created attachment 2233 [details]
Wireshark-dump of udhcpc 1.16.1
Comment 3 Jonas Christoffersen 2010-07-13 18:02:19 UTC
(In reply to comment #2)
> Created attachment 2233 [details]
> Wireshark-dump of udhcpc 1.16.1

And the dump of version 1.17.0 is available at:
http://batnas.dk/BB1.17.0.pcap
Comment 4 Denys Vlasenko 2010-07-14 04:40:12 UTC
Here is 1.16.1 request packet:

19:51:48.642325 IP (tos 0x0, ttl  64, id 0, offset 0, flags [none], proto: UDP (17), length: 576)
 0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok]
 BOOTP/DHCP, Request from 00:0c:29:25:6b:ae (oui Unknown), length: 548, xid:0xa11106b, flags: [Broadcast] (0x8000)
          Client Ethernet Address: 00:0c:29:25:6b:ae (oui Unknown)
          Vendor-rfc1048:
            DHCP:DISCOVER
            CID:[ether]00:0c:29:25:6b:ae
            HN:"box"
            VC:"udhcp 1.16.1"
            MSZ:576
            PR:SM+DG+NS+HN+DN+BR+NTP
        0x0000:  4500 0240 0000 0000 4011 78ae 0000 0000  E..@....@.x.....
        0x0010:  ffff ffff 0044 0043 022c 576d 0101 0600  .....D.C.,Wm....
        0x0020:  0a11 106b 0000 8000 0000 0000 0000 0000  ...k............
        0x0030:  0000 0000 0000 0000 000c 2925 6bae 0000  ..........)%k...
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
...
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 013d  ........c.Sc5..=
        0x0110:  0701 000c 2925 6bae 0c03 626f 783c 0c75  ....)%k...box<.u
        0x0120:  6468 6370 2031 2e31 362e 3139 0202 4037  dhcp.1.16.19..@7
        0x0130:  0701 0306 0c0f 1c2a ff00 0000 0000 0000  .......*........
        0x0140:  0000 0000 0000 0000 0000 0000 0000 0000  ................
...
        0x0230:  0000 0000 0000 0000 0000 0000 0000 0000  ................

and 1.17.0 request packet:

19:52:46.847263 IP (tos 0x0, ttl  64, id 0, offset 0, flags [none], proto: UDP (17), length: 313)
 0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok]
 BOOTP/DHCP, Request from 00:0c:29:25:6b:ae (oui Unknown), length: 285, xid:0x4cbb4e39, flags: [none] (0x0000)
          Client Ethernet Address: 00:0c:29:25:6b:ae (oui Unknown)
          Vendor-rfc1048:
            DHCP:DISCOVER
            CID:[ether]00:0c:29:25:6b:ae
            HN:"box"
            VC:"udhcp 1.17.0"
            MSZ:576
            PR:SM+DG+NS+HN+DN+BR+NTP
        0x0000:  4500 0139 0000 0000 4011 79b5 0000 0000  E..9....@.y.....
        0x0010:  ffff ffff 0044 0043 0125 5903 0101 0600  .....D.C.%Y.....
        0x0020:  4cbb 4e39 0000 0000 0000 0000 0000 0000  L.N9............
        0x0030:  0000 0000 0000 0000 000c 2925 6bae 0000  ..........)%k...
        0x0040:  0000 0000 0000 0000 0000 0000 0000 0000  ................
...
        0x00f0:  0000 0000 0000 0000 0000 0000 0000 0000  ................
        0x0100:  0000 0000 0000 0000 6382 5363 3501 013d  ........c.Sc5..=
        0x0110:  0701 000c 2925 6bae 0c03 626f 783c 0c75  ....)%k...box<.u
        0x0120:  6468 6370 2031 2e31 372e 3039 0202 4037  dhcp.1.17.09..@7
        0x0130:  0701 0306 0c0f 1c2a ff                   .......*.

As you see, it is shorter. But this should be ok - Windows also uses unpadded packets. Ideas so far:
* old packet has bcast flag in dhcp header. (1) Why? and (2) why new one doesn't?
* maybe your server insists on packets rounded up to 2 or 4 byte boundary in size?
Comment 5 Denys Vlasenko 2010-07-14 04:58:35 UTC
* Old packet has bcast flag in dhcp header -
That's really interesting. How it ended up set? There is no code in dhcpc to set it. No way. Maybe tinycorelinux use patched busybox source?

* Maybe your server insists on packets rounded up to 2 or 4 byte boundary in
size? -
You can test this theory by making hostname longer. Instead of -h box, try -h box1, then -h box12345. If one of those work, then we have this bug nailed.
Comment 6 Denys Vlasenko 2010-08-05 13:16:46 UTC
Any news?
Comment 7 Denys Vlasenko 2010-08-11 22:03:57 UTC
Closing for the lack of feedback from reporter