From 2b8d8fe92a0fd5c0e019677c13028e0a456ea8f2 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 29 Apr 2024 11:30:34 +0200 Subject: [PATCH] platform: don't set RTM_F_LOOKUP_TABLE for IPv6 RTM_F_LOOKUP_TABLE is only needed for IPv4. IPv6 dumps with the flag are rejected in strict mode. --- src/libnm-platform/nm-linux-platform.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index 5b595a9b71..fd23612fd6 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -337,6 +337,11 @@ struct _ifla_vf_vlan_info { #define BRIDGE_VLAN_INFO_RANGE_END (1 << 4) /* VLAN is end of vlan range */ #endif +/* Appeared in kernel 4.2 dated August 2015 */ +#ifndef RTM_F_LOOKUP_TABLE +#define RTM_F_LOOKUP_TABLE 0x1000 /* set rtm_table to FIB lookup result */ +#endif + /*****************************************************************************/ #define PSCHED_TIME_UNITS_PER_SEC 1000000 @@ -10307,7 +10312,7 @@ ip_route_get(NMPlatform *platform, .r.rtm_family = addr_family, .r.rtm_tos = 0, .r.rtm_dst_len = IS_IPv4 ? 32 : 128, - .r.rtm_flags = 0x1000 /* RTM_F_LOOKUP_TABLE */, + .r.rtm_flags = IS_IPv4 ? RTM_F_LOOKUP_TABLE : 0, }; nm_clear_pointer(&route, nmp_object_unref);