]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: Fixup Table when L3MasterDevice is set on routing policy rule 33853/head
authorNick Cao <nickcao@nichi.co>
Sun, 28 Jul 2024 14:07:19 +0000 (10:07 -0400)
committerNick Cao <nickcao@nichi.co>
Sun, 28 Jul 2024 18:02:07 +0000 (14:02 -0400)
src/network/networkd-routing-policy-rule.c

index 886b4da8e0a774207d150254982177a6b17e8fe6..c6b3779908496d0f0597e55c56d4984c51c8497e 100644 (file)
@@ -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;
 }