1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00

sd-netlink: do not set action for RTM_GETRULE message

Otherwise, when NETLINK_GET_STRICT_CHK socket option is enabled, no rule
will be dumped.
This commit is contained in:
Yu Watanabe 2021-05-24 22:32:00 +09:00
parent f318f64388
commit 3ca619061d
2 changed files with 3 additions and 6 deletions

View 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;
}

View 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;
}