diff options
| author | Stephen Worley <sworley@nvidia.com> | 2021-01-11 17:30:21 -0500 |
|---|---|---|
| committer | Stephen Worley <sworley@nvidia.com> | 2021-02-01 13:32:37 -0500 |
| commit | f7692085cb040e1900986e9eb02d30a196be1e98 (patch) | |
| tree | f9b403abfa3f0b03997105e583e83e81617ce120 /zebra/zebra_pbr.c | |
| parent | 8eeca5a201fce3930d1ede9b7385bf6325f255ce (diff) | |
zebra: move pbr hash create after update release
Move the pbr hash creation to be after the update release
and dplane install. Now that rules are installed in a separate
dplane pthread, we can have scenarios where we have an interface
flapping and we install/remove rules sufficiently fast enough we
could issue what we think is an update for an identical rule and
end up releasing the rule right after we created it and sent it to
the dplane. This solves the problem of recving duplicate rules
during interface flapping.
Signed-off-by: Stephen Worley <sworley@nvidia.com>
Diffstat (limited to 'zebra/zebra_pbr.c')
| -rw-r--r-- | zebra/zebra_pbr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 924aed023d..87ab900092 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -500,8 +500,6 @@ void zebra_pbr_add_rule(struct zebra_pbr_rule *rule) */ found = pbr_rule_lookup_unique(rule); - (void)hash_get(zrouter.rules_hash, rule, pbr_rule_alloc_intern); - /* If found, this is an update */ if (found) { if (IS_ZEBRA_DEBUG_PBR) @@ -526,6 +524,8 @@ void zebra_pbr_add_rule(struct zebra_pbr_rule *rule) (void)dplane_pbr_rule_add(rule); } + + (void)hash_get(zrouter.rules_hash, rule, pbr_rule_alloc_intern); } void zebra_pbr_del_rule(struct zebra_pbr_rule *rule) |
