chiark / gitweb /
sd-dhcp-client: add fallback subnet masks
authorTom Gundersen <teg@jklm.no>
Wed, 19 Mar 2014 15:05:44 +0000 (16:05 +0100)
committerTom Gundersen <teg@jklm.no>
Fri, 21 Mar 2014 16:52:42 +0000 (17:52 +0100)
commit9e64dd72765ddc2583554ebed24eb2c824564838
tree85f7e9394a093269adfa6ca917b203221b38bba8
parent022446adf99b84c59a88c2e614033ccde13c395c
sd-dhcp-client: add fallback subnet masks

The DHCP RFC does not require the DHCP server to send a subnet mask, so if it
is missing, let's try to use the default subnet masks based on address class.
In case the class the address belongs to does not have a default subnet mask,
we fail as before.

Also improve logging when handling invalid dhcp messages, and simply ignore them
rather than stop the whole dhcp client.
src/libsystemd-network/dhcp-lease-internal.h
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp-lease.c