daandemeyer / rpms / systemd

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