mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 12:20:23 +01:00
routes/trival: add argument @routes_full_sync to IP config commit
The argument is still unused, so no behavioral change yet.
(cherry picked from commit 6124f5b94a)
This commit is contained in:
parent
b159b668b3
commit
49a7418d33
7 changed files with 16 additions and 10 deletions
|
|
@ -6345,6 +6345,7 @@ nm_device_set_ip4_config (NMDevice *self,
|
|||
* FIXME: this is wrong in case where "assumed" means "take-over-seamlessly". In this
|
||||
* case, we should manage the device route, for example on new DHCP lease. */
|
||||
success = nm_ip4_config_commit (new_config, ip_ifindex,
|
||||
TRUE,
|
||||
assumed ? (gint64) -1 : (gint64) default_route_metric);
|
||||
if (!success)
|
||||
reason_local = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
|
||||
|
|
@ -6471,7 +6472,9 @@ nm_device_set_ip6_config (NMDevice *self,
|
|||
/* Always commit to nm-platform to update lifetimes */
|
||||
if (commit && new_config) {
|
||||
nm_device_ipv6_set_mtu (self, priv->ip6_mtu);
|
||||
success = nm_ip6_config_commit (new_config, ip_ifindex);
|
||||
success = nm_ip6_config_commit (new_config,
|
||||
ip_ifindex,
|
||||
TRUE);
|
||||
if (!success)
|
||||
reason_local = NM_DEVICE_STATE_REASON_CONFIG_FAILED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ dhcp4_state_changed (NMDhcpClient *client,
|
|||
nm_ip4_config_subtract (existing, last_config);
|
||||
|
||||
nm_ip4_config_merge (existing, ip4_config);
|
||||
if (!nm_ip4_config_commit (existing, ifindex, global_opt.priority_v4))
|
||||
if (!nm_ip4_config_commit (existing, ifindex, TRUE, global_opt.priority_v4))
|
||||
nm_log_warn (LOGD_DHCP4, "(%s): failed to apply DHCPv4 config", global_opt.ifname);
|
||||
|
||||
if (last_config)
|
||||
|
|
@ -241,7 +241,7 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, gpointer user_da
|
|||
nm_ip6_config_subtract (existing, last_config);
|
||||
|
||||
nm_ip6_config_merge (existing, ip6_config);
|
||||
if (!nm_ip6_config_commit (existing, ifindex))
|
||||
if (!nm_ip6_config_commit (existing, ifindex, TRUE))
|
||||
nm_log_warn (LOGD_IP6, "(%s): failed to apply IPv6 config", global_opt.ifname);
|
||||
|
||||
if (last_config)
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf)
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gint64 default_route_metric)
|
||||
nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_full_sync, gint64 default_route_metric)
|
||||
{
|
||||
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
|
||||
int i;
|
||||
|
|
@ -323,7 +323,7 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gint64 default_rou
|
|||
|
||||
nm_route_manager_ip4_route_register_device_route_purge_list (nm_route_manager_get (), device_route_purge_list);
|
||||
|
||||
success = nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes, default_route_metric < 0, TRUE);
|
||||
success = nm_route_manager_ip4_route_sync (nm_route_manager_get (), ifindex, routes, default_route_metric < 0, routes_full_sync);
|
||||
g_array_unref (routes);
|
||||
if (!success)
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const char * nm_ip4_config_get_dbus_path (const NMIP4Config *config);
|
|||
|
||||
/* Integration with nm-platform and nm-setting */
|
||||
NMIP4Config *nm_ip4_config_capture (int ifindex, gboolean capture_resolv_conf);
|
||||
gboolean nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gint64 default_route_metric);
|
||||
gboolean nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_full_sync, gint64 default_route_metric);
|
||||
void nm_ip4_config_merge_setting (NMIP4Config *config, NMSettingIPConfig *setting, guint32 default_route_metric);
|
||||
NMSetting *nm_ip4_config_create_setting (const NMIP4Config *config);
|
||||
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6Co
|
|||
}
|
||||
|
||||
gboolean
|
||||
nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
|
||||
nm_ip6_config_commit (const NMIP6Config *config, int ifindex, gboolean routes_full_sync)
|
||||
{
|
||||
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (config);
|
||||
int i;
|
||||
|
|
@ -398,7 +398,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
|
|||
g_array_append_vals (routes, route, 1);
|
||||
}
|
||||
|
||||
success = nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes, TRUE, TRUE);
|
||||
success = nm_route_manager_ip6_route_sync (nm_route_manager_get (), ifindex, routes, TRUE, routes_full_sync);
|
||||
g_array_unref (routes);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ const char * nm_ip6_config_get_dbus_path (const NMIP6Config *config);
|
|||
|
||||
/* Integration with nm-platform and nm-setting */
|
||||
NMIP6Config *nm_ip6_config_capture (int ifindex, gboolean capture_resolv_conf, NMSettingIP6ConfigPrivacy use_temporary);
|
||||
gboolean nm_ip6_config_commit (const NMIP6Config *config, int ifindex);
|
||||
gboolean nm_ip6_config_commit (const NMIP6Config *config, int ifindex, gboolean routes_full_sync);
|
||||
void nm_ip6_config_merge_setting (NMIP6Config *config, NMSettingIPConfig *setting, guint32 default_route_metric);
|
||||
NMSetting *nm_ip6_config_create_setting (const NMIP6Config *config);
|
||||
|
||||
|
|
|
|||
|
|
@ -969,12 +969,15 @@ nm_vpn_connection_apply_config (NMVpnConnection *connection)
|
|||
|
||||
if (priv->ip4_config) {
|
||||
if (!nm_ip4_config_commit (priv->ip4_config, priv->ip_ifindex,
|
||||
TRUE,
|
||||
nm_vpn_connection_get_ip4_route_metric (connection)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (priv->ip6_config) {
|
||||
if (!nm_ip6_config_commit (priv->ip6_config, priv->ip_ifindex))
|
||||
if (!nm_ip6_config_commit (priv->ip6_config,
|
||||
priv->ip_ifindex,
|
||||
TRUE))
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue