diff options
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device.c | 16 | ||||
-rw-r--r-- | src/devices/nm-device.h | 3 |
2 files changed, 7 insertions, 12 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) { diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index b00f2e6c30..28f86e825e 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -504,8 +504,7 @@ const char * nm_device_get_initial_hw_address (NMDevice *dev); NMProxyConfig * nm_device_get_proxy_config (NMDevice *dev); -NMDhcpConfig * nm_device_get_dhcp4_config (NMDevice *dev); -NMDhcpConfig * nm_device_get_dhcp6_config (NMDevice *dev); +NMDhcpConfig * nm_device_get_dhcp_config (NMDevice *dev, int addr_family); NMIP4Config * nm_device_get_ip4_config (NMDevice *dev); void nm_device_replace_vpn4_config (NMDevice *dev, NMIP4Config *old, |