From 4e857e33fca0f6f92fdc378593b7bd102f2a6572 Mon Sep 17 00:00:00 2001 From: Fernando Fernandez Mancera Date: Fri, 11 Nov 2022 15:27:38 +0100 Subject: [PATCH] core: set routing rule protocol properly When creating NMPlatformRoutingRule from NMIPRouteRule object, the protocol is being set to RTPROT_UNSPEC. According to linux kernel documentation FRA_PROTOCOL indicates the originator of the rule. In this case the route rule is coming from a connection and therefore the originator of the rule is the user. The correct value is RTPROT_STATIC which means the rule is installed by the administrator. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1457 Fixes: 3f9347745b30 ('core: add handling of IP routing rules to NMDevice') (cherry picked from commit 82009e21d28b5f3d61b9e1e3cebbf2dd94e8f32a) --- src/core/NetworkManagerUtils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/NetworkManagerUtils.c b/src/core/NetworkManagerUtils.c index 8b0b484583..f5b7666b0e 100644 --- a/src/core/NetworkManagerUtils.c +++ b/src/core/NetworkManagerUtils.c @@ -978,6 +978,7 @@ nm_ip_routing_rule_to_platform(const NMIPRoutingRule *rule, NMPlatformRoutingRul .start = uid_range_start, .end = uid_range_end, }, + .protocol = RTPROT_STATIC, }; nm_ip_routing_rule_get_xifname_bin(rule, TRUE, out_pl->iifname);