diff options
Diffstat (limited to 'src/network/networkd-routing-policy-rule.c')
-rw-r--r-- | src/network/networkd-routing-policy-rule.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index 90086f35a7..a2e72a7d7c 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -449,116 +449,116 @@ static int routing_policy_rule_set_netlink_message(const RoutingPolicyRule *rule if (rule->from_prefixlen > 0) { r = netlink_message_append_in_addr_union(m, FRA_SRC, rule->family, &rule->from); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_SRC attribute: %m"); + return r; r = sd_rtnl_message_routing_policy_rule_set_fib_src_prefixlen(m, rule->from_prefixlen); if (r < 0) - return log_link_error_errno(link, r, "Could not set source prefix length: %m"); + return r; } if (rule->to_prefixlen > 0) { r = netlink_message_append_in_addr_union(m, FRA_DST, rule->family, &rule->to); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_DST attribute: %m"); + return r; r = sd_rtnl_message_routing_policy_rule_set_fib_dst_prefixlen(m, rule->to_prefixlen); if (r < 0) - return log_link_error_errno(link, r, "Could not set destination prefix length: %m"); + return r; } r = sd_netlink_message_append_u32(m, FRA_PRIORITY, rule->priority); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_PRIORITY attribute: %m"); + return r; if (rule->tos > 0) { r = sd_rtnl_message_routing_policy_rule_set_tos(m, rule->tos); if (r < 0) - return log_link_error_errno(link, r, "Could not set IP rule TOS: %m"); + return r; } if (rule->table < 256) { r = sd_rtnl_message_routing_policy_rule_set_table(m, rule->table); if (r < 0) - return log_link_error_errno(link, r, "Could not set IP rule table: %m"); + return r; } else { r = sd_rtnl_message_routing_policy_rule_set_table(m, RT_TABLE_UNSPEC); if (r < 0) - return log_link_error_errno(link, r, "Could not set IP rule table: %m"); + return r; r = sd_netlink_message_append_u32(m, FRA_TABLE, rule->table); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_TABLE attribute: %m"); + return r; } if (rule->fwmark > 0) { r = sd_netlink_message_append_u32(m, FRA_FWMARK, rule->fwmark); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_FWMARK attribute: %m"); + return r; r = sd_netlink_message_append_u32(m, FRA_FWMASK, rule->fwmask); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_FWMASK attribute: %m"); + return r; } if (rule->iif) { r = sd_netlink_message_append_string(m, FRA_IIFNAME, rule->iif); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_IIFNAME attribute: %m"); + return r; } if (rule->oif) { r = sd_netlink_message_append_string(m, FRA_OIFNAME, rule->oif); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_OIFNAME attribute: %m"); + return r; } r = sd_netlink_message_append_u8(m, FRA_IP_PROTO, rule->ipproto); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_IP_PROTO attribute: %m"); + return r; r = sd_netlink_message_append_u8(m, FRA_PROTOCOL, rule->protocol); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_PROTOCOL attribute: %m"); + return r; if (rule->sport.start != 0 || rule->sport.end != 0) { r = sd_netlink_message_append_data(m, FRA_SPORT_RANGE, &rule->sport, sizeof(rule->sport)); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_SPORT_RANGE attribute: %m"); + return r; } if (rule->dport.start != 0 || rule->dport.end != 0) { r = sd_netlink_message_append_data(m, FRA_DPORT_RANGE, &rule->dport, sizeof(rule->dport)); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_DPORT_RANGE attribute: %m"); + return r; } if (rule->uid_range.start != UID_INVALID && rule->uid_range.end != UID_INVALID) { r = sd_netlink_message_append_data(m, FRA_UID_RANGE, &rule->uid_range, sizeof(rule->uid_range)); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_UID_RANGE attribute: %m"); + return r; } if (rule->invert_rule) { r = sd_rtnl_message_routing_policy_rule_set_flags(m, FIB_RULE_INVERT); if (r < 0) - return log_link_error_errno(link, r, "Could not append FIB_RULE_INVERT attribute: %m"); + return r; } if (rule->suppress_prefixlen >= 0) { r = sd_netlink_message_append_u32(m, FRA_SUPPRESS_PREFIXLEN, (uint32_t) rule->suppress_prefixlen); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_SUPPRESS_PREFIXLEN attribute: %m"); + return r; } if (rule->suppress_ifgroup >= 0) { r = sd_netlink_message_append_u32(m, FRA_SUPPRESS_IFGROUP, (uint32_t) rule->suppress_ifgroup); if (r < 0) - return log_link_error_errno(link, r, "Could not append FRA_SUPPRESS_IFGROUP attribute: %m"); + return r; } 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 r; return 0; } @@ -588,17 +588,17 @@ static int routing_policy_rule_remove(RoutingPolicyRule *rule) { r = sd_rtnl_message_new_routing_policy_rule(rule->manager->rtnl, &m, RTM_DELRULE, rule->family); if (r < 0) - return log_error_errno(r, "Could not allocate RTM_DELRULE message: %m"); + return log_error_errno(r, "Could not allocate netlink message: %m"); r = routing_policy_rule_set_netlink_message(rule, m, NULL); if (r < 0) - return r; + return log_error_errno(r, "Could not create netlink message: %m"); r = netlink_call_async(rule->manager->rtnl, NULL, m, routing_policy_rule_remove_handler, NULL, NULL); if (r < 0) - return log_error_errno(r, "Could not send rtnetlink message: %m"); + return log_error_errno(r, "Could not send netlink message: %m"); routing_policy_rule_enter_removing(rule); return 0; @@ -624,16 +624,16 @@ static int routing_policy_rule_configure( r = sd_rtnl_message_new_routing_policy_rule(link->manager->rtnl, &m, RTM_NEWRULE, rule->family); if (r < 0) - return log_link_error_errno(link, r, "Could not allocate RTM_NEWRULE message: %m"); + return log_link_error_errno(link, r, "Could not allocate netlink message: %m"); r = routing_policy_rule_set_netlink_message(rule, m, link); if (r < 0) - return r; + return log_error_errno(r, "Could not create netlink message: %m"); r = netlink_call_async(link->manager->rtnl, NULL, m, callback, link_netlink_destroy_callback, link); if (r < 0) - return log_link_error_errno(link, r, "Could not send rtnetlink message: %m"); + return log_link_error_errno(link, r, "Could not send netlink message: %m"); link_ref(link); |