Package: systemd
Version: 215-12
Severity: important

The check for a running v4 dhcp client is using DHCP_SUPPORT_V6
flag instead of DHCP_SUPPORT_V4.

As a result, when the carrier was lost, systemd was not cleaning up the
relevant addresses and routes. If the carrier was regained in another
environment, with a different subnet and gateway, the system would end
up with multiple addresses and default gateways and thus a broken
network configuration.

This bug was introduced in v215 (ed942a9e), and was fixed from v216 as a
side effect of ba179154. The attached patch fixes that until debian
moves to the latest systemd version.

The above scenario happened quite regularly on my laptop when switching
locations. For the record, I am using systemd-networkd.service and
wpa_supplicant@wlan0.service handling authentication.

>From ec01bba6278d43891f7dbaa49456b72aa6afb13b Mon Sep 17 00:00:00 2001
From: Christos Trochalakis <yati...@ideopolis.gr>
Date: Sat, 7 Feb 2015 09:23:19 +0200
Subject: [PATCH] networkd: link - fix stopping v4 dhcpclient when the carrier
 is lost

The check for a running v4 dhcpclient was using DHCP_SUPPORT_V6 flag
instead of DHCP_SUPPORT_V4.

As a result, when the carrier was lost systemd was not cleaning up the
relevant addresses and routes. If the carrier was regained in another
environment, with a different subnet and gateway, the system would end
up with multiple addresses and default gateways and thus a broken
network configuration. This scenario can be easily reproduced with wifi
links.
---
 src/network/networkd-link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 14c0417..cb435e2 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -206,7 +206,7 @@ static int link_stop_clients(Link *link) {
         if (!link->network)
                 return 0;
 
-        if (IN_SET(link->network->dhcp, DHCP_SUPPORT_BOTH, DHCP_SUPPORT_V6)) {
+        if (IN_SET(link->network->dhcp, DHCP_SUPPORT_BOTH, DHCP_SUPPORT_V4)) {
                 assert(link->dhcp_client);
 
                 k = sd_dhcp_client_stop(link->dhcp_client);
-- 
2.1.4

Reply via email to