From 9e64dd72765ddc2583554ebed24eb2c824564838 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Wed, 19 Mar 2014 16:05:44 +0100 Subject: 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 | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libsystemd-network/dhcp-lease-internal.h') diff --git a/src/libsystemd-network/dhcp-lease-internal.h b/src/libsystemd-network/dhcp-lease-internal.h index 70f1aa15e4..e478902e0e 100644 --- a/src/libsystemd-network/dhcp-lease-internal.h +++ b/src/libsystemd-network/dhcp-lease-internal.h @@ -57,5 +57,7 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, int dhcp_lease_save(sd_dhcp_lease *lease, const char *lease_file); int dhcp_lease_load(const char *lease_file, sd_dhcp_lease **ret); +int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease *lease); + DEFINE_TRIVIAL_CLEANUP_FUNC(sd_dhcp_lease*, sd_dhcp_lease_unref); #define _cleanup_dhcp_lease_unref_ _cleanup_(sd_dhcp_lease_unrefp) -- cgit v1.2.3-54-g00ecf