network: fix return value of routing_policy_rule_get()

To distinguish source of rule.
This commit is contained in:
Yu Watanabe 2018-11-01 23:38:01 +09:00
parent a6276f0f3f
commit e6b65ab760
2 changed files with 2 additions and 2 deletions

View file

@ -785,7 +785,7 @@ static int link_set_routing_policy_rule(Link *link) {
LIST_FOREACH(rules, rule, link->network->rules) {
r = routing_policy_rule_get(link->manager, rule->family, &rule->from, rule->from_prefixlen, &rule->to,
rule->to_prefixlen, rule->tos, rule->fwmark, rule->table, rule->iif, rule->oif, &rrule);
if (r == 1) {
if (r == 0) {
(void) routing_policy_rule_make_local(link->manager, rrule);
continue;
}

View file

@ -188,7 +188,7 @@ int routing_policy_rule_get(Manager *m,
if (existing) {
if (ret)
*ret = existing;
return 1;
return 0;
}
return -ENOENT;