diff options
Diffstat (limited to 'zebra/zebra_pbr.c')
| -rw-r--r-- | zebra/zebra_pbr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 27daa2d807..758365d716 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -111,6 +111,7 @@ int zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2) struct pbr_rule_unique_lookup { struct zebra_pbr_rule *rule; uint32_t unique; + struct interface *ifp; }; static int pbr_rule_lookup_unique_walker(struct hash_backet *b, void *data) @@ -118,7 +119,7 @@ static int pbr_rule_lookup_unique_walker(struct hash_backet *b, void *data) struct pbr_rule_unique_lookup *pul = data; struct zebra_pbr_rule *rule = b->data; - if (pul->unique == rule->rule.unique) { + if (pul->unique == rule->rule.unique && pul->ifp == rule->ifp) { pul->rule = rule; return HASHWALK_ABORT; } @@ -127,11 +128,13 @@ static int pbr_rule_lookup_unique_walker(struct hash_backet *b, void *data) } static struct zebra_pbr_rule *pbr_rule_lookup_unique(struct zebra_ns *zns, - uint32_t unique) + uint32_t unique, + struct interface *ifp) { struct pbr_rule_unique_lookup pul; pul.unique = unique; + pul.ifp = ifp; pul.rule = NULL; hash_walk(zns->rules_hash, &pbr_rule_lookup_unique_walker, &pul); @@ -275,7 +278,7 @@ static void *pbr_rule_alloc_intern(void *arg) void zebra_pbr_add_rule(struct zebra_ns *zns, struct zebra_pbr_rule *rule) { struct zebra_pbr_rule *unique = - pbr_rule_lookup_unique(zns, rule->rule.unique); + pbr_rule_lookup_unique(zns, rule->rule.unique, rule->ifp); (void)hash_get(zns->rules_hash, rule, pbr_rule_alloc_intern); kernel_add_pbr_rule(rule); @@ -493,8 +496,10 @@ void kernel_pbr_rule_add_del_status(struct zebra_pbr_rule *rule, zsend_rule_notify_owner(rule, ZAPI_RULE_FAIL_INSTALL); break; case SOUTHBOUND_DELETE_SUCCESS: + zsend_rule_notify_owner(rule, ZAPI_RULE_REMOVED); break; case SOUTHBOUND_DELETE_FAILURE: + zsend_rule_notify_owner(rule, ZAPI_RULE_REMOVED); break; } } |
