summaryrefslogtreecommitdiff
path: root/src/devices/nm-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/nm-device.c')
-rw-r--r--src/devices/nm-device.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 9e9d037fd8..d9d9eea280 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -12824,11 +12824,15 @@ nm_device_set_proxy_config (NMDevice *self, const char *pac_url)
/* IP Configuration stuff */
NMDhcpConfig *
-nm_device_get_dhcp4_config (NMDevice *self)
+nm_device_get_dhcp_config (NMDevice *self, int addr_family)
{
+ const gboolean IS_IPv4 = (addr_family == AF_INET);
+
g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
- return NM_DEVICE_GET_PRIVATE (self)->dhcp_data_4.config;
+ nm_assert_addr_family (addr_family);
+
+ return NM_DEVICE_GET_PRIVATE (self)->dhcp_data_x[IS_IPv4].config;
}
NMIP4Config *
@@ -13082,14 +13086,6 @@ nm_device_replace_vpn6_config (NMDevice *self, NMIP6Config *old, NMIP6Config *co
_LOGW (LOGD_IP6, "failed to set VPN routes for device");
}
-NMDhcpConfig *
-nm_device_get_dhcp6_config (NMDevice *self)
-{
- g_return_val_if_fail (NM_IS_DEVICE (self), NULL);
-
- return NM_DEVICE_GET_PRIVATE (self)->dhcp_data_6.config;
-}
-
NMIP6Config *
nm_device_get_ip6_config (NMDevice *self)
{