chiark / gitweb /
dhcp: Add DHCP discover sending
authorPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 9 Dec 2013 21:43:19 +0000 (23:43 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 12 Dec 2013 16:43:34 +0000 (11:43 -0500)
commit46a66b794a00e0f34981ac25dbf2eae2423b6215
treea7015981a327512cb35688e2ab432d33f699d7c6
parent8b4a96932de0c56048fbd7f7386090dc202704f7
dhcp: Add DHCP discover sending

On starting the client, use the supplied interface mac address and create
a transaction id. Puzzle together an IP/UDP/DHCP Discover message, compute
checksums and send it out as a raw packet.

Create an additional function that constructs default options common to
all DHCP messages.

Set the DHCP Client ID option as noticed by Grant Erickson in ConnMan
commit b18d9798b3a0ae46ed87d6d2be8d5a474bf3ab1e:

   "Some Internet gateways and Wi-Fi access points are unhappy when the
    DHCPv4 client-id option (61) is missing and will refuse to issue a
    DHCP lease."
src/libsystemd-dhcp/dhcp-client.c
src/libsystemd-dhcp/dhcp-protocol.h
src/systemd/sd-dhcp-client.h