device: move setting v4_commit_first_time/v6_commit_first_time to the end of merge_and_apply()

This commit is contained in:
Thomas Haller 2015-07-22 11:56:05 +02:00
parent ad03cdbc73
commit cbd246c9b0

View file

@ -3316,10 +3316,6 @@ ip4_config_merge_and_apply (NMDevice *self,
priv->default_route.v4_has = FALSE;
priv->default_route.v4_is_assumed = TRUE;
routes_full_sync = commit
&& priv->v4_commit_first_time
&& !nm_device_uses_assumed_connection (self);
if (!commit) {
/* during a non-commit event, we always pickup whatever is configured. */
goto END_ADD_DEFAULT_ROUTE;
@ -3345,7 +3341,6 @@ ip4_config_merge_and_apply (NMDevice *self,
/* we are about to commit (for a non-assumed connection). Enforce whatever we have
* configured. */
priv->v4_commit_first_time = FALSE;
priv->default_route.v4_is_assumed = FALSE;
if (!connection_has_default_route)
@ -3399,8 +3394,15 @@ END_ADD_DEFAULT_ROUTE:
NM_DEVICE_GET_CLASS (self)->ip4_config_pre_commit (self, composite);
}
routes_full_sync = commit
&& priv->v4_commit_first_time
&& !nm_device_uses_assumed_connection (self);
success = nm_device_set_ip4_config (self, composite, default_route_metric, commit, routes_full_sync, out_reason);
g_object_unref (composite);
if (commit)
priv->v4_commit_first_time = FALSE;
return success;
}
@ -3935,10 +3937,6 @@ ip6_config_merge_and_apply (NMDevice *self,
priv->default_route.v6_has = FALSE;
priv->default_route.v6_is_assumed = TRUE;
routes_full_sync = commit
&& priv->v6_commit_first_time
&& !nm_device_uses_assumed_connection (self);
if (!commit) {
/* during a non-commit event, we always pickup whatever is configured. */
goto END_ADD_DEFAULT_ROUTE;
@ -3964,7 +3962,6 @@ ip6_config_merge_and_apply (NMDevice *self,
/* we are about to commit (for a non-assumed connection). Enforce whatever we have
* configured. */
priv->v6_commit_first_time = FALSE;
priv->default_route.v6_is_assumed = FALSE;
if (!connection_has_default_route)
@ -4021,8 +4018,14 @@ END_ADD_DEFAULT_ROUTE:
NM_DEVICE_GET_CLASS (self)->ip6_config_pre_commit (self, composite);
}
routes_full_sync = commit
&& priv->v6_commit_first_time
&& !nm_device_uses_assumed_connection (self);
success = nm_device_set_ip6_config (self, composite, commit, routes_full_sync, out_reason);
g_object_unref (composite);
if (commit)
priv->v6_commit_first_time = FALSE;
return success;
}