diff options
| author | Stephen Worley <sworley@nvidia.com> | 2022-05-25 12:29:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-25 12:29:27 -0400 |
| commit | 1ebae15eaff974b4ac264cebef2a0fd273bbb2da (patch) | |
| tree | c60e02de60976200218d16392759e45ea29b901a /zebra/zapi_msg.c | |
| parent | ad5124419f9d7723cc91548e63fbfb4f844e20ce (diff) | |
| parent | c9250e28e816d73de2f1647f44847f855eae8b7c (diff) | |
Merge pull request #11244 from pguibert6WIND/flowspec_added_twice
zebra: avoid pbr iptable added twice when used with flowspec
Diffstat (limited to 'zebra/zapi_msg.c')
| -rw-r--r-- | zebra/zapi_msg.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 408d420be6..9a30c2b78f 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -876,9 +876,24 @@ void zsend_iptable_notify_owner(const struct zebra_dplane_ctx *ctx, struct stream *s; struct zebra_pbr_iptable ipt; uint16_t cmd = ZEBRA_IPTABLE_NOTIFY_OWNER; + struct zebra_pbr_iptable *ipt_hash; + enum dplane_op_e op = dplane_ctx_get_op(ctx); dplane_ctx_get_pbr_iptable(ctx, &ipt); + ipt_hash = hash_lookup(zrouter.iptable_hash, &ipt); + if (ipt_hash) { + if (op == DPLANE_OP_IPTABLE_ADD && + CHECK_FLAG(ipt_hash->internal_flags, + IPTABLE_INSTALL_QUEUED)) + UNSET_FLAG(ipt_hash->internal_flags, + IPTABLE_INSTALL_QUEUED); + else if (op == DPLANE_OP_IPTABLE_DELETE && + CHECK_FLAG(ipt_hash->internal_flags, + IPTABLE_UNINSTALL_QUEUED)) + UNSET_FLAG(ipt_hash->internal_flags, + IPTABLE_UNINSTALL_QUEUED); + } if (IS_ZEBRA_DEBUG_PACKET) zlog_debug("%s: Notifying %s id %u note %u", __func__, zserv_command_string(cmd), ipt.unique, note); |
