gdhcp: set secs in a RFC 951- and 2131-compliant manner
authorGrant Erickson <marathon96@gmail.com>
Tue, 28 Feb 2012 16:30:00 +0000 (08:30 -0800)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 1 Mar 2012 12:45:23 +0000 (13:45 +0100)
commit95e15c09350acf58d4707056ae2614570883ef66
tree856edf9c177474388e8600af47388642ed96f0cf
parente8dbd3160116346eae8613c242dd8f4db3ed1781
gdhcp: set secs in a RFC 951- and 2131-compliant manner

This patch sets the BOOTP secs field in a RFC 951- and 2131-compliant
manner for DHCPv4 DISCOVER and REQUEST/SELECT packets.

Certain DHCP servers, such as that implemented in Mac OS X (< 10.7)
for its "Internet Sharing" feature, refuse to issue a DHCP lease to
clients that have not set a non-zero value in their DISCOVER or
REQUEST packets. In fact, based on http://hints.macworld.com/article.php?
story=20071223001432304, it's not non-zero but a value greater than four (4)
seconds to allow another "authoritative" DHCP server on the subnet to reply
first.

Side-by-side packet analysis of Mac OS X, iOS, Android, ISC and
Windows clients show that these clients set the BOOTP 'secs' field and
are successfully issued a DHCP lease by Mac OS X. By contrast, a
connman-based client will issue 10 back-to-back DISCOVER packets and
will not be returned a DHCP OFFER from the server.
gdhcp/client.c