summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-11-19 15:17:32 +0100
committerDan Winship <danw@redhat.com>2014-11-21 14:10:10 -0500
commitf5bdb598931bfc7923dd0725e758688fcd28f127 (patch)
treef73a00535cdd764e9880bad0dda98ec0e2b958b8
parentdbdc7167961c003837c7c354436e8f849f4eef87 (diff)
downloadNetworkManager-danw/dhcp-internal-fixup-bgo7402777.tar.gz
dhcp: pass device specific route metric to nm_dhcp_systemd_get_lease_ip_configs()danw/dhcp-internal-fixup-bgo7402777
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/devices/nm-device.c3
-rw-r--r--src/dhcp-manager/nm-dhcp-client.h3
-rw-r--r--src/dhcp-manager/nm-dhcp-dhclient.c3
-rw-r--r--src/dhcp-manager/nm-dhcp-manager.c5
-rw-r--r--src/dhcp-manager/nm-dhcp-manager.h3
-rw-r--r--src/dhcp-manager/nm-dhcp-systemd.c5
6 files changed, 14 insertions, 8 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 56ecfcaf4b..8e7e710d2e 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -6281,7 +6281,8 @@ find_ip4_lease_config (NMDevice *self,
leases = nm_dhcp_manager_get_lease_ip_configs (nm_dhcp_manager_get (),
ip_iface,
nm_connection_get_uuid (connection),
- FALSE);
+ FALSE,
+ nm_device_get_ip4_route_metric (self));
for (liter = leases; liter && !found; liter = liter->next) {
NMIP4Config *lease_config = liter->data;
const NMPlatformIP4Address *address = nm_ip4_config_get_address (lease_config, 0);
diff --git a/src/dhcp-manager/nm-dhcp-client.h b/src/dhcp-manager/nm-dhcp-client.h
index 3329fe38f3..0876061f8a 100644
--- a/src/dhcp-manager/nm-dhcp-client.h
+++ b/src/dhcp-manager/nm-dhcp-client.h
@@ -101,7 +101,8 @@ typedef const char *(*NMDhcpClientGetPathFunc) (void);
typedef GSList * (*NMDhcpClientGetLeaseConfigsFunc) (const char *iface,
const char *uuid,
- gboolean ipv6);
+ gboolean ipv6,
+ guint32 default_route_metric);
void _nm_dhcp_client_register (GType gtype,
const char *name,
diff --git a/src/dhcp-manager/nm-dhcp-dhclient.c b/src/dhcp-manager/nm-dhcp-dhclient.c
index 31e48331ec..504e8d5d17 100644
--- a/src/dhcp-manager/nm-dhcp-dhclient.c
+++ b/src/dhcp-manager/nm-dhcp-dhclient.c
@@ -127,7 +127,8 @@ get_dhclient_leasefile (const char *iface,
static GSList *
nm_dhcp_dhclient_get_lease_ip_configs (const char *iface,
const char *uuid,
- gboolean ipv6)
+ gboolean ipv6,
+ guint32 default_route_metric)
{
char *contents = NULL;
char *leasefile;
diff --git a/src/dhcp-manager/nm-dhcp-manager.c b/src/dhcp-manager/nm-dhcp-manager.c
index 9d3ff9a9b2..f936f45c58 100644
--- a/src/dhcp-manager/nm-dhcp-manager.c
+++ b/src/dhcp-manager/nm-dhcp-manager.c
@@ -354,7 +354,8 @@ GSList *
nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
const char *iface,
const char *uuid,
- gboolean ipv6)
+ gboolean ipv6,
+ guint32 default_route_metric)
{
ClientDesc *desc;
@@ -364,7 +365,7 @@ nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
desc = find_client_desc (NULL, NM_DHCP_MANAGER_GET_PRIVATE (self)->client_type);
if (desc && desc->get_lease_configs_func)
- return desc->get_lease_configs_func (iface, uuid, ipv6);
+ return desc->get_lease_configs_func (iface, uuid, ipv6, default_route_metric);
return NULL;
}
diff --git a/src/dhcp-manager/nm-dhcp-manager.h b/src/dhcp-manager/nm-dhcp-manager.h
index cf5519fbf8..bf6cc7786a 100644
--- a/src/dhcp-manager/nm-dhcp-manager.h
+++ b/src/dhcp-manager/nm-dhcp-manager.h
@@ -80,7 +80,8 @@ NMDhcpClient * nm_dhcp_manager_start_ip6 (NMDhcpManager *manager,
GSList * nm_dhcp_manager_get_lease_ip_configs (NMDhcpManager *self,
const char *iface,
const char *uuid,
- gboolean ipv6);
+ gboolean ipv6,
+ guint32 default_route_metric);
/* For testing only */
extern const char* nm_dhcp_helper_path;
diff --git a/src/dhcp-manager/nm-dhcp-systemd.c b/src/dhcp-manager/nm-dhcp-systemd.c
index 8e554a6bdc..d9b98635a1 100644
--- a/src/dhcp-manager/nm-dhcp-systemd.c
+++ b/src/dhcp-manager/nm-dhcp-systemd.c
@@ -372,7 +372,8 @@ get_leasefile_path (const char *iface, const char *uuid, gboolean ipv6)
static GSList *
nm_dhcp_systemd_get_lease_ip_configs (const char *iface,
const char *uuid,
- gboolean ipv6)
+ gboolean ipv6,
+ guint32 default_route_metric)
{
GSList *leases = NULL;
gs_free char *path = NULL;
@@ -386,7 +387,7 @@ nm_dhcp_systemd_get_lease_ip_configs (const char *iface,
path = get_leasefile_path (iface, uuid, FALSE);
r = sd_dhcp_lease_load (&lease, path);
if (r == 0 && lease) {
- ip4_config = lease_to_ip4_config (lease, NULL, 0, FALSE, NULL);
+ ip4_config = lease_to_ip4_config (lease, NULL, default_route_metric, FALSE, NULL);
if (ip4_config)
leases = g_slist_append (leases, ip4_config);
}