diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-09-27 13:36:59 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-09-27 13:38:47 +0200 |
| commit | 77097921e09de99e0b66b43a541ec35004e64630 (patch) | |
| tree | c36633d782404ea31955254a2133cf9cf036d81e /src/libnm-platform/nm-platform.c | |
| parent | 0e7561c087918ef6b0e8a64155109d3b005e700c (diff) | |
| parent | 2bfcbfb13b1672c072e4f902260d2122b3e3c122 (diff) | |
Update upstream source from tag 'upstream/1.32.12'
Update to upstream version '1.32.12' with Debian dir 8a9c3ca7f117acef29e7880aa507a1c3ab742155
Diffstat (limited to 'src/libnm-platform/nm-platform.c')
| -rw-r--r-- | src/libnm-platform/nm-platform.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index 6c0d0015..b7a65df5 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -4304,6 +4304,7 @@ nm_platform_ip_route_get_prune_list(NMPlatform * self, CList * iter; NMPlatformIP4Route rt_local4; NMPlatformIP6Route rt_local6; + NMPlatformIP6Route rt_mcast6; const NMPlatformLink * pllink; const NMPlatformLnkVrf * lnk_vrf; guint32 local_table; @@ -4328,6 +4329,7 @@ nm_platform_ip_route_get_prune_list(NMPlatform * self, rt_local4.plen = 0; rt_local6.plen = 0; + rt_mcast6.plen = 0; routes_prune = g_ptr_array_new_full(head_entry->len, (GDestroyNotify) nm_dedup_multi_obj_unref); @@ -4420,6 +4422,43 @@ nm_platform_ip_route_get_prune_list(NMPlatform * self, == 0) continue; } + + /* Kernels < 5.11 add a route like: + * + * unicast ff00::/8 dev $IFACE proto boot scope global metric 256 pref medium + * + * to allow sending and receiving IPv6 multicast traffic. Don't remove it. + * Since kernel 5.11 the route looks like: + * + * multicast ff00::/8 dev $IFACE proto kernel metric 256 pref medium + * + * As NM ignores routes with rtm_type multicast, there is no need for the code + * below on newer kernels. + */ + if (nm_platform_ip_route_get_effective_table(&rt->rx) == local_table + && rt->rx.plen == 8 && rt->rx.rt_source == NM_IP_CONFIG_SOURCE_RTPROT_BOOT + && rt->rx.metric == 256 && rt->r6.rt_pref == NM_ICMPV6_ROUTER_PREF_MEDIUM + && IN6_IS_ADDR_UNSPECIFIED(&rt->r6.gateway)) { + if (rt_mcast6.plen == 0) { + rt_mcast6 = (NMPlatformIP6Route){ + .ifindex = ifindex, + .type_coerced = nm_platform_route_type_coerce(RTN_UNICAST), + .plen = 8, + .rt_source = NM_IP_CONFIG_SOURCE_RTPROT_BOOT, + .metric = 256, + .table_coerced = nm_platform_route_table_coerce(local_table), + .rt_pref = NM_ICMPV6_ROUTER_PREF_MEDIUM, + .gateway = IN6ADDR_ANY_INIT, + .network = {{{0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}}, + }; + } + + if (nm_platform_ip6_route_cmp(&rt->r6, + &rt_mcast6, + NM_PLATFORM_IP_ROUTE_CMP_TYPE_SEMANTICALLY) + == 0) + continue; + } } break; |