summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-routing-policy-rule.c
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2024-07-28 16:07:19 +0200
committerNick Cao <nickcao@nichi.co>2024-07-28 20:02:07 +0200
commit615af2c77d996b2ba6e6d17d376f7a221c0e5822 (patch)
tree5c643eeb6dde38fe0b04b9f47017f7db36ec6cf6 /src/network/networkd-routing-policy-rule.c
parentman: network: move note about L3MasterDevice to the correct section (diff)
downloadsystemd-615af2c77d996b2ba6e6d17d376f7a221c0e5822.tar.xz
systemd-615af2c77d996b2ba6e6d17d376f7a221c0e5822.zip
network: Fixup Table when L3MasterDevice is set on routing policy rule
Diffstat (limited to '')
-rw-r--r--src/network/networkd-routing-policy-rule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c
index 886b4da8e0..c6b3779908 100644
--- a/src/network/networkd-routing-policy-rule.c
+++ b/src/network/networkd-routing-policy-rule.c
@@ -483,9 +483,7 @@ static int routing_policy_rule_set_netlink_message(const RoutingPolicyRule *rule
return r;
}
- if (rule->l3mdev)
- r = sd_rtnl_message_routing_policy_rule_set_table(m, RT_TABLE_UNSPEC);
- else if (rule->table < 256)
+ if (rule->table < 256)
r = sd_rtnl_message_routing_policy_rule_set_table(m, rule->table);
else {
r = sd_rtnl_message_routing_policy_rule_set_table(m, RT_TABLE_UNSPEC);
@@ -1784,6 +1782,9 @@ static int routing_policy_rule_section_verify(RoutingPolicyRule *rule) {
/* rule->family can be AF_UNSPEC only when Family=both. */
}
+ if (rule->l3mdev)
+ rule->table = RT_TABLE_UNSPEC;
+
return 0;
}