summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-04-04 09:56:19 +0200
committerThomas Haller <thaller@redhat.com>2022-04-04 09:56:19 +0200
commit588ac2e2e4bad91a66939afc09fd43fe0041631d (patch)
tree8892f754f663de13156d0f24168ce70b8d229d90
parentd1dfcc4c9d50e37fd9ab3805c9251d2e0f8b5517 (diff)
downloadNetworkManager-588ac2e2e4bad91a66939afc09fd43fe0041631d.tar.gz
dhcp: add code comment to lease_parse_routes()
-rw-r--r--src/core/dhcp/nm-dhcp-nettools.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/dhcp/nm-dhcp-nettools.c b/src/core/dhcp/nm-dhcp-nettools.c
index d7fbe35615..a1a057ba79 100644
--- a/src/core/dhcp/nm-dhcp-nettools.c
+++ b/src/core/dhcp/nm-dhcp-nettools.c
@@ -343,6 +343,17 @@ lease_parse_routes(NDhcp4ClientLease *lease,
int r;
guint i;
+ /* Routes can be in option 33 (static-route), 121 (classless-static-route) and 249 (a non-standard classless-static-route).
+ * Option 249 (Microsoft Classless Static Route), is described here:
+ * https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dhcpe/f9c19c79-1c7f-4746-b555-0c0fc523f3f9
+ *
+ * We will anyway parse all these 3 options and add them to the "options" hash (as distinct entries).
+ * We will however also parse one of the options into the "l3cd" for configuring routing.
+ * Thereby we prefer 121 over 249 over 33.
+ *
+ * Preferring 121 over 33 is defined by RFC 3443.
+ * Preferring 121 over 249 over 33 is made up as it makes sense (the MS docs are not very clear).
+ */
for (i = 0; i < 2; i++) {
const guint8 option_code = (i == 0) ? NM_DHCP_OPTION_DHCP4_CLASSLESS_STATIC_ROUTE
: NM_DHCP_OPTION_DHCP4_PRIVATE_CLASSLESS_STATIC_ROUTE;