diff options
author | Dan Williams <dcbw@redhat.com> | 2014-08-13 14:24:45 -0500 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2014-08-29 16:03:36 -0500 |
commit | 17e323fd22ec8b47893a5f44bcdf30dca93b11f8 (patch) | |
tree | 148edcb29b9627da336e8d7e5b7c141d97d44d10 | |
parent | 7c9d4e8f5a0f4d64ae0ec218928ca2641ae7e9c9 (diff) | |
download | NetworkManager-17e323fd22ec8b47893a5f44bcdf30dca93b11f8.tar.gz |
core: sync IPv6 pre-commit hook with IPv4 behavior
The IPv4 pre-commit hook was called right before the config was
committed, while the IPv6 one was called before commit in only
one case (from nm_device_activate_ip6_config_commit). The IPv4
behavior is the intended behavior.
Note that this doesn't have any actual effect yet, since nothing
actually implements the IPv6 pre-commit hook
-rw-r--r-- | src/devices/nm-device.c | 10 | ||||
-rw-r--r-- | src/devices/nm-device.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 7edd2a7310..738b490815 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -3054,6 +3054,12 @@ ip6_config_merge_and_apply (NMDevice *self, nm_ip6_config_addresses_sort (composite, priv->rdisc ? priv->rdisc_use_tempaddr : NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN); + /* Allow setting MTU etc */ + if (commit) { + if (NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit) + NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit (self, composite); + } + success = nm_device_set_ip6_config (self, composite, commit, out_reason); g_object_unref (composite); return success; @@ -4626,10 +4632,6 @@ nm_device_activate_ip6_config_commit (gpointer user_data) /* Device should be up before we can do anything with it */ g_warn_if_fail (nm_platform_link_is_up (nm_device_get_ip_ifindex (self))); - /* Allow setting MTU etc */ - if (NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit) - NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit (self); - if (ip6_config_merge_and_apply (self, TRUE, &reason)) { /* If IPv6 wasn't the first IP to complete, and DHCP was used, * then ensure dispatcher scripts get the DHCP lease information. diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h index e570803fa8..3ac3fd6897 100644 --- a/src/devices/nm-device.h +++ b/src/devices/nm-device.h @@ -180,7 +180,7 @@ typedef struct { /* Called right before IP config is set; use for setting MTU etc */ void (* ip4_config_pre_commit) (NMDevice *self, NMIP4Config *config); - void (* ip6_config_pre_commit) (NMDevice *self); + void (* ip6_config_pre_commit) (NMDevice *self, NMIP6Config *config); void (* deactivate) (NMDevice *self); |