diff options
author | Dan Williams <dcbw@redhat.com> | 2014-05-20 15:17:13 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-06-06 13:43:44 -0500 |
commit | ef2edfce4f6bc7074619d9309fe973938c4590c5 (patch) | |
tree | ad45e52090121c36b778f70df7707744df6d5224 | |
parent | 1856a1c315483965dd527a7ce856ea6f37b677e1 (diff) | |
download | NetworkManager-ef2edfce4f6bc7074619d9309fe973938c4590c5.tar.gz |
trivial: re-organize IPv6 /proc property util functions
-rw-r--r-- | src/devices/nm-device.c | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 2b8fa4a5e7..399bcfe94c 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -444,48 +444,6 @@ nm_device_ipv6_sysctl_set (NMDevice *self, const char *property, const char *val return nm_platform_sysctl_set (nm_utils_ip6_property_path (nm_device_get_ip_iface (self), property), value); } -static const char *ip6_properties_to_save[] = { - "accept_ra", - "accept_ra_defrtr", - "accept_ra_pinfo", - "accept_ra_rtr_pref", - "disable_ipv6", - "hop_limit", - "use_tempaddr", -}; - -static void -save_ip6_properties (NMDevice *self) -{ - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - const char *ifname = nm_device_get_ip_iface (self); - char *value; - int i; - - g_hash_table_remove_all (priv->ip6_saved_properties); - - for (i = 0; i < G_N_ELEMENTS (ip6_properties_to_save); i++) { - value = nm_platform_sysctl_get (nm_utils_ip6_property_path (ifname, ip6_properties_to_save[i])); - if (value) { - g_hash_table_insert (priv->ip6_saved_properties, - (char *) ip6_properties_to_save[i], - value); - } - } -} - -static void -restore_ip6_properties (NMDevice *self) -{ - NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - GHashTableIter iter; - gpointer key, value; - - g_hash_table_iter_init (&iter, priv->ip6_saved_properties); - while (g_hash_table_iter_next (&iter, &key, &value)) - nm_device_ipv6_sysctl_set (self, key, value); -} - static gboolean device_has_capability (NMDevice *device, NMDeviceCapabilities caps) { @@ -3714,6 +3672,48 @@ addrconf6_cleanup (NMDevice *self) /******************************************/ +static const char *ip6_properties_to_save[] = { + "accept_ra", + "accept_ra_defrtr", + "accept_ra_pinfo", + "accept_ra_rtr_pref", + "disable_ipv6", + "hop_limit", + "use_tempaddr", +}; + +static void +save_ip6_properties (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + const char *ifname = nm_device_get_ip_iface (self); + char *value; + int i; + + g_hash_table_remove_all (priv->ip6_saved_properties); + + for (i = 0; i < G_N_ELEMENTS (ip6_properties_to_save); i++) { + value = nm_platform_sysctl_get (nm_utils_ip6_property_path (ifname, ip6_properties_to_save[i])); + if (value) { + g_hash_table_insert (priv->ip6_saved_properties, + (char *) ip6_properties_to_save[i], + value); + } + } +} + +static void +restore_ip6_properties (NMDevice *self) +{ + NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, priv->ip6_saved_properties); + while (g_hash_table_iter_next (&iter, &key, &value)) + nm_device_ipv6_sysctl_set (self, key, value); +} + static NMSettingIP6ConfigPrivacy use_tempaddr_clamp (NMSettingIP6ConfigPrivacy use_tempaddr) { |