From 624347baf784a265e92487f673bdd62ac2b010f6 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 16 Mar 2017 14:37:54 +0100 Subject: [PATCH] device: on reapply reset commit_first_time flag Based on this flag, we decide that: - if we are not gonna commit the first time and the connection is configured with never-default, we would not remove a default route added externally. During a reapply, we however want to get rid of an externally configured default route. --- src/devices/nm-device.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index aabea840ea..88fbe78692 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -302,6 +302,9 @@ typedef struct _NMDevicePrivate { bool up:1; /* IFF_UP */ + bool v4_commit_first_time:1; + bool v6_commit_first_time:1; + /* Generic DHCP stuff */ guint32 dhcp_timeout; char * dhcp_anycast_address; @@ -332,9 +335,6 @@ typedef struct _NMDevicePrivate { NMPlatformIP6Route v6; } default_route; - bool v4_commit_first_time; - bool v6_commit_first_time; - /* DHCPv4 tracking */ struct { NMDhcpClient * client; @@ -8676,6 +8676,9 @@ check_and_reapply_connection (NMDevice *self, } else con_old = con_new = applied; + priv->v4_commit_first_time = TRUE; + priv->v6_commit_first_time = TRUE; + /************************************************************************** * Reapply changes *************************************************************************/