summaryrefslogtreecommitdiff
path: root/src/network/networkd-routing-policy-rule.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-02-24 10:48:53 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-02-25 11:01:50 +0900
commita79a8d16d5b5f8709361d8deb42fc84ff2fe9c30 (patch)
treee178b7c082a8680ba18e3acba7ee712cf5aa518b /src/network/networkd-routing-policy-rule.c
parentcae162a79cf57a41f35e5525a25061b1f7f6459c (diff)
downloadsystemd-a79a8d16d5b5f8709361d8deb42fc84ff2fe9c30.tar.gz
network: drop detailed log messages
This also renames netlink message `req` -> `m` for preparation of later commits. Follow-ups for #22014.
Diffstat (limited to 'src/network/networkd-routing-policy-rule.c')
-rw-r--r--src/network/networkd-routing-policy-rule.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c
index a17d74e316..be2a0ac0c3 100644
--- a/src/network/networkd-routing-policy-rule.c
+++ b/src/network/networkd-routing-policy-rule.c
@@ -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 netlink message: %m");
+ return log_warning_errno(r, "Could not allocate netlink message: %m");
r = routing_policy_rule_set_netlink_message(rule, m, NULL);
if (r < 0)
- return log_error_errno(r, "Could not create netlink message: %m");
+ return log_warning_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 netlink message: %m");
+ return log_warning_errno(r, "Could not send netlink message: %m");
routing_policy_rule_enter_removing(rule);
return 0;
@@ -624,21 +624,19 @@ 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 netlink message: %m");
+ return r;
r = routing_policy_rule_set_netlink_message(rule, m, link);
if (r < 0)
- return log_error_errno(r, "Could not create netlink message: %m");
+ return r;
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 netlink message: %m");
+ return r;
link_ref(link);
-
- routing_policy_rule_enter_configuring(rule);
- return r;
+ return 0;
}
static void manager_mark_routing_policy_rules(Manager *m, bool foreign, const Link *except) {
@@ -859,20 +857,24 @@ int link_request_static_routing_policy_rules(Link *link) {
}
int request_process_routing_policy_rule(Request *req) {
+ RoutingPolicyRule *rule;
+ Link *link;
int r;
assert(req);
- assert(req->link);
- assert(req->rule);
assert(req->type == REQUEST_TYPE_ROUTING_POLICY_RULE);
- if (!link_is_ready_to_configure(req->link, false))
+ link = ASSERT_PTR(req->link);
+ rule = ASSERT_PTR(req->rule);
+
+ if (!link_is_ready_to_configure(link, false))
return 0;
- r = routing_policy_rule_configure(req->rule, req->link, req->netlink_handler);
+ r = routing_policy_rule_configure(rule, link, req->netlink_handler);
if (r < 0)
- return r;
+ return log_link_warning_errno(link, r, "Failed to configure routing policy rule: %m");
+ routing_policy_rule_enter_configuring(rule);
return 1;
}