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: 3f9347745b ('core: add handling of IP routing rules to NMDevice')
(cherry picked from commit 82009e21d2)
This commit is contained in:
Fernando Fernandez Mancera 2022-11-11 15:27:38 +01:00
parent 86a30b9900
commit 4e857e33fc

View file

@ -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);