923a60
From f0beebf7beb86a804a80e53794b6234da97f085b Mon Sep 17 00:00:00 2001
923a60
From: Susant Sahani <ssahani@users.noreply.github.com>
923a60
Date: Thu, 21 Apr 2016 06:06:33 +0530
923a60
Subject: [PATCH] networkd: respect DHCP UseRoutes option
923a60
923a60
This fixes #2282.
923a60
923a60
(cherry picked from commit 964b26fe2127d28713bccf03603900a7691216ba)
923a60
923a60
Resolves: #1663365
923a60
---
923a60
 src/network/networkd-dhcp4.c | 4 ++++
923a60
 1 file changed, 4 insertions(+)
923a60
923a60
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
923a60
index c3d0e3d39d..354c760ba9 100644
923a60
--- a/src/network/networkd-dhcp4.c
923a60
+++ b/src/network/networkd-dhcp4.c
923a60
@@ -58,6 +58,10 @@ static int link_set_dhcp_routes(Link *link) {
923a60
 
923a60
         assert(link);
923a60
         assert(link->dhcp_lease);
923a60
+        assert(link->network);
923a60
+
923a60
+        if (!link->network->dhcp_routes)
923a60
+                return 0;
923a60
 
923a60
         r = sd_dhcp_lease_get_router(link->dhcp_lease, &gateway);
923a60
         if (r < 0 && r != -ENOENT) {