]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: do not set action for RTM_GETRULE message
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 May 2021 13:32:00 +0000 (22:32 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 May 2021 23:26:00 +0000 (08:26 +0900)
Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no rule
will be dumped.

src/libsystemd/sd-netlink/rtnl-message.c
src/network/networkd-routing-policy-rule.c

index 681c32aed14177c982f315f67c770d5630499fbb..5dba9c573426b5d915e305ae18393241efbea270 100644 (file)
@@ -858,7 +858,6 @@ int sd_rtnl_message_new_routing_policy_rule(sd_netlink *rtnl, sd_netlink_message
 
         frh = NLMSG_DATA((*ret)->hdr);
         frh->family = ifal_family;
-        frh->action = FR_ACT_TO_TBL;
 
         return 0;
 }
index d65e198333a2a967c7130247222b82ae088dc9b7..3860f6df30f2c7ecd2a0dead02b648848a7efa16 100644 (file)
@@ -508,11 +508,9 @@ static int routing_policy_rule_set_netlink_message(const RoutingPolicyRule *rule
                         return log_link_error_errno(link, r, "Could not append FRA_SUPPRESS_PREFIXLEN attribute: %m");
         }
 
-        if (rule->type != FR_ACT_TO_TBL) {
-                r = sd_rtnl_message_routing_policy_rule_set_fib_type(m, rule->type);
-                if (r < 0)
-                        return log_link_error_errno(link, r, "Could not append FIB rule type attribute: %m");
-        }
+        r = sd_rtnl_message_routing_policy_rule_set_fib_type(m, rule->type);
+        if (r < 0)
+                return log_link_error_errno(link, r, "Could not append FIB rule type attribute: %m");
 
         return 0;
 }