richardphibel / rpms / systemd

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