diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 7343c9cf5f..d8f33cfb86 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -10563,13 +10563,15 @@ _dev_ipll6_start(NMDevice *self) const char * stable_id; stable_id = _prop_get_connection_stable_id(self, connection, &stable_type); - priv->ipll_data_6.v6.ipv6ll = nm_l3_ipv6ll_new_stable_privacy(priv->l3cfg, - assume, - stable_type, - ifname, - stable_id, - _dev_ipll6_state_change_cb, - self); + priv->ipll_data_6.v6.ipv6ll = + nm_l3_ipv6ll_new_stable_privacy(priv->l3cfg, + assume, + stable_type, + ifname, + stable_id, + nm_device_get_route_table(self, AF_INET6), + _dev_ipll6_state_change_cb, + self); } else { NMUtilsIPv6IfaceId iid; @@ -10579,7 +10581,12 @@ _dev_ipll6_start(NMDevice *self) } priv->ipll_data_6.v6.ipv6ll = - nm_l3_ipv6ll_new_token(priv->l3cfg, assume, &iid, _dev_ipll6_state_change_cb, self); + nm_l3_ipv6ll_new_token(priv->l3cfg, + assume, + &iid, + nm_device_get_route_table(self, AF_INET6), + _dev_ipll6_state_change_cb, + self); } llstate = nm_l3_ipv6ll_get_state(priv->ipll_data_6.v6.ipv6ll, &lladdr); diff --git a/src/core/nm-l3-config-data.c b/src/core/nm-l3-config-data.c index deec665d1d..da933d5d04 100644 --- a/src/core/nm-l3-config-data.c +++ b/src/core/nm-l3-config-data.c @@ -2489,6 +2489,7 @@ nm_l3_config_data_add_dependent_device_routes(NML3ConfigData * self, .network = *a6, .plen = plen, }; + nm_platform_ip_route_normalize(addr_family, &rx.rx); nm_l3_config_data_add_route(self, addr_family, NULL, &rx.rx); } diff --git a/src/core/nm-l3-ipv6ll.c b/src/core/nm-l3-ipv6ll.c index 143873213d..17008c7ead 100644 --- a/src/core/nm-l3-ipv6ll.c +++ b/src/core/nm-l3-ipv6ll.c @@ -51,6 +51,8 @@ struct _NML3IPv6LL { * with the configuration. */ const NML3ConfigData *l3cd; + guint32 route_table; + /* "assume" means that we first look whether there is any suitable * IPv6 address on the device, and in that case, try to use that * instead of generating a new one. Otherwise, we always try to @@ -410,7 +412,7 @@ _lladdr_handle_changed(NML3IPv6LL *self) l3cd, NM_L3CFG_CONFIG_PRIORITY_IPV6LL, 0, - 0, + self->route_table, NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP4, NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6, 0, @@ -624,6 +626,7 @@ _nm_l3_ipv6ll_new(NML3Cfg * l3cfg, const char * ifname, const char * network_id, const NMUtilsIPv6IfaceId *token_iid, + guint32 route_table, NML3IPv6LLNotifyFcn notify_fcn, gpointer user_data) { @@ -647,6 +650,7 @@ _nm_l3_ipv6ll_new(NML3Cfg * l3cfg, .cur_lladdr_obj = NULL, .cur_lladdr = IN6ADDR_ANY_INIT, .assume = assume, + .route_table = route_table, .addrgen = { .stable_type = stable_type, diff --git a/src/core/nm-l3-ipv6ll.h b/src/core/nm-l3-ipv6ll.h index 770a4268a3..3a4f4b4376 100644 --- a/src/core/nm-l3-ipv6ll.h +++ b/src/core/nm-l3-ipv6ll.h @@ -48,6 +48,7 @@ NML3IPv6LL *_nm_l3_ipv6ll_new(NML3Cfg * l3cfg, const char * ifname, const char * network_id, const NMUtilsIPv6IfaceId *token_iid, + guint32 route_table, NML3IPv6LLNotifyFcn notify_fcn, gpointer user_data); @@ -57,6 +58,7 @@ nm_l3_ipv6ll_new_stable_privacy(NML3Cfg * l3cfg, NMUtilsStableType stable_type, const char * ifname, const char * network_id, + guint32 route_table, NML3IPv6LLNotifyFcn notify_fcn, gpointer user_data) { @@ -67,6 +69,7 @@ nm_l3_ipv6ll_new_stable_privacy(NML3Cfg * l3cfg, ifname, network_id, NULL, + route_table, notify_fcn, user_data); } @@ -75,6 +78,7 @@ static inline NML3IPv6LL * nm_l3_ipv6ll_new_token(NML3Cfg * l3cfg, gboolean assume, const NMUtilsIPv6IfaceId *token_iid, + guint32 route_table, NML3IPv6LLNotifyFcn notify_fcn, gpointer user_data) { @@ -84,6 +88,7 @@ nm_l3_ipv6ll_new_token(NML3Cfg * l3cfg, NULL, NULL, token_iid, + route_table, notify_fcn, user_data); } diff --git a/src/core/tests/test-l3cfg.c b/src/core/tests/test-l3cfg.c index b5c85b8224..f02b0f037c 100644 --- a/src/core/tests/test-l3cfg.c +++ b/src/core/tests/test-l3cfg.c @@ -1025,6 +1025,7 @@ test_l3_ipv6ll(gconstpointer test_data) NM_UTILS_STABLE_TYPE_UUID, tdata->f->ifname0, "b6a5b934-c649-43dc-a524-3dfdb74f9419", + 0, _test_l3_ipv6ll_callback_changed, tdata);