NetworkManager/shared/nm-utils
Thomas Haller 9a6a354013 dhcp: fix static-route handling for intenal client and support multiple default routes
Preface: RFC 3442 (The Classless Static Route Option for Dynamic Host
Configuration Protocol (DHCP) version 4) states:

   If the DHCP server returns both a Classless Static Routes option and
   a Router option, the DHCP client MUST ignore the Router option.

   Similarly, if the DHCP server returns both a Classless Static Routes
   option and a Static Routes option, the DHCP client MUST ignore the
   Static Routes option.

Changes:

- sd_dhcp_lease_get_routes() returns the combination of both option 33
(static routes) and 121 (classless static routes). If classless static
routes are provided, the state routes must be ignored.

- we collect the options hash that we expose on D-Bus. For that purpose,
we must not merge both option types as classless static routes. Instead,
we want to expose the values like we received them originally: as two
different options.

- we continue our deviation from RFC 3442, when receiving classless static
routes with option 3 (Router), we only ignore the router if we didn't
already receive a default route via classless static routes.

- in the past, NetworkManager treated the default route specially, and
one device could only have one default route. That limitation was
already (partly) lifted by commit 5c299454b4
(core: rework tracking of gateway/default-route in ip-config). However,
from DHCP we still would only accept one default route. Fix that for
internal client. Installing multiple default routes might make sense, as
kernel apparently can skip unreachable routers (as it notes via ICMP
messages) (rh#1634657).

https://bugzilla.redhat.com/show_bug.cgi?id=1634657
2018-12-19 09:23:08 +01:00
..
tests shared: allow optional trailing comma in NM_MAKE_STRV() 2018-12-01 15:16:48 +01:00
c-list-util.c shared: implement c_list_sort() as non-recursive merge-sort 2018-01-03 16:41:47 +01:00
c-list-util.h shared: drop duplicate c-list.h header 2018-04-18 15:22:14 +02:00
nm-c-list.h shared: drop duplicate c-list.h header 2018-04-18 15:22:14 +02:00
nm-compat.c all: avoid g_memdup() 2018-09-07 11:24:17 +02:00
nm-compat.h shared/compat: add compat for nm_setting_vpn_get_data_keys() and nm_setting_vpn_get_secret_keys() 2017-11-23 14:44:25 +01:00
nm-dedup-multi.c Fix typos 2018-09-30 21:14:55 +02:00
nm-dedup-multi.h Fix typos 2018-09-30 21:14:55 +02:00
nm-enum-utils.c all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
nm-enum-utils.h all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
nm-glib.h shared/gsystem-local-alloc: merge "gsystem-local-alloc.h" into "nm-macros-shared.h" 2018-07-18 10:21:27 +02:00
nm-hash-utils.c shared: expose siphash24() related functionality in nm-hash-utils.h 2018-12-12 12:51:47 +01:00
nm-hash-utils.h shared: expose siphash24() related functionality in nm-hash-utils.h 2018-12-12 12:51:47 +01:00
nm-io-utils.c Fix typos 2018-09-30 21:14:55 +02:00
nm-io-utils.h shared: move file-get-contents and file-set-contents helper to shared/ 2018-09-04 07:38:30 +02:00
nm-jansson.h all: require jansson 2.5 2018-01-18 11:45:24 +01:00
nm-macros-internal.h dhcp: fix static-route handling for intenal client and support multiple default routes 2018-12-19 09:23:08 +01:00
nm-obj.h all: replace "it's" with "its" where needed 2018-04-18 14:14:07 +02:00
nm-random-utils.c Fix typos 2018-09-30 21:14:55 +02:00
nm-random-utils.h shared: split random and hash utils 2017-10-17 20:02:59 +02:00
nm-secret-utils.c shared: add nm-secret-utils.h helper 2018-09-04 07:38:30 +02:00
nm-secret-utils.h shared: avoid invoking g_free() with NULL from gs_free cleanup attribute 2018-10-04 10:58:50 +02:00
nm-shared-utils.c shared: add nm_utils_error_is_notfound() helper 2018-12-12 08:22:12 +01:00
nm-shared-utils.h shared: add nm_utils_error_is_notfound() helper 2018-12-12 08:22:12 +01:00
nm-test-utils.h shared/tests: add helper functions to convert IP address to string 2018-12-19 09:23:08 +01:00
nm-time-utils.c shared: thread safe initialization of nm_utils_get_monotonic_timestamp*() 2018-11-28 16:13:04 +01:00
nm-time-utils.h shared: move nm_utils_get_monotonic_timestamp*() to shared/nm-utils. 2018-10-18 12:16:55 +02:00
nm-udev-utils.c udev: remove unneeded NULL checks 2018-12-12 14:18:53 +01:00
nm-udev-utils.h udev: add and use nm_udev_utils_property_decode() function 2017-03-22 12:41:06 +01:00
nm-vpn-editor-plugin-call.h shared: include "gsystem-local-alloc.h" from "nm-glib.h" 2016-06-16 10:45:54 +02:00
nm-vpn-plugin-macros.h shared: add nm_utils_syslog_coerce_from_nm() util 2016-09-19 15:35:33 +02:00
nm-vpn-plugin-utils.c shared/vpn-plugin-utils: load the editor from the same place as plugin 2018-10-24 15:12:43 +02:00
nm-vpn-plugin-utils.h shared: add "nm-utils/nm-vpn-plugin-utils.h" 2016-06-16 10:45:54 +02:00
unaligned.h systemd: update code from upstream (2018-11-23) 2018-11-23 10:53:12 +01:00