summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2016-04-21 06:06:33 +0530
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-20 20:36:33 -0400
commit964b26fe2127d28713bccf03603900a7691216ba (patch)
tree3f4164333b26c5552ba15e7056cc95bc7f037822 /src
parent439689c6ec48faba67565562d75701d5736567e7 (diff)
networkd: respect DHCP UseRoutes option (#3075)
This fixes #2282.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-dhcp4.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c
index 0589ebf227..c5b61abc9e 100644
--- a/src/network/networkd-dhcp4.c
+++ b/src/network/networkd-dhcp4.c
@@ -57,6 +57,10 @@ static int link_set_dhcp_routes(Link *link) {
assert(link);
assert(link->dhcp_lease);
+ assert(link->network);
+
+ if (!link->network->dhcp_use_routes)
+ return 0;
r = sd_dhcp_lease_get_router(link->dhcp_lease, &gateway);
if (r < 0 && r != -ENODATA)