libsystemd-dhcp: Use be32_t for IP addresses in network order.
libsystemd-dhcp: Return proper error if bind fails

This also fixes a minor indentation damage.

[tomegun: use close_noint_nofail() instead and drop 'err' variables]
libsystemd-dhcp: Return proper error on OOM
libsystemd-dhcp: Unref event source before closing socket
libsystemd-dhcp: Fix receiving of other message when expecting Ack

When a DHCP Nak is received, return a DHCP_EVENT_NO_LEASE event. If
some other DHCP message is received or an error happens when parsing
options, return -ENOMSG in order to ignore the packet. There may be
more than one server serving the same subnet, each server will send
its Offer to the client.
libsystemd-dhcp: Fix checksum computation for buffer with odd size

Fix off-by-one error and notice that summing may need more than one
round for the result to be in the lower 16 bits.
libsystemd-dhcp: Check test result without casting value
libsystemd-dhcp: Add functions for sending unicast UDP messages

Create a helper functions setting up an unicast DHCP UDP socket and
sending data. Add function stubs for the test program.

[tomegun: initialize structs when allocating, and drop unneccesary 'err']
libsystemd-dhcp: Handle T1 Renewing timeout

Expiration of T1 timeout takes the client to the Rebinding state,
where it attempts to renew its lease. Start by opening a DCHP unicast
socket as there now is a proper IP address set.

Compute the resend timer as half of the remaining time down to a
minimum of 60 seconds (RFC2131). Modify DHCP Request sending to send
only UDP DHCP data when unicasting. Also modify DHCP Ack/Nak
receiving such that the client_receive_ack() takes care of using
either the full IP, UDP, DHCP packet or only the DHCP payload
depending whether the client is in Requesting or Renewing state.
Finally always report DHCP_EVENT_IP_ACQUIRE from Requesting state
and only DHCP_EVENT_IP_CHANGE if the IP address was modified when
the lease was renewed.
libsystemd-dhcp: Factor out common code initializing events

Factor out common code from timeout T1 handling and starting of
the DHCP client.
libsystemd-dhcp: Handle T2 Rebinding timeout

Reuse existing functionality when adding T2 Rebinding support.
libsystemd-dhcp: add some asserts