diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-06 17:41:10 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-04-18 00:40:17 +0200 |
commit | 9b71ea4ba50d38f1d186e40af95a4eba2e46f9a0 (patch) | |
tree | 5bb946b06ce0847d250c7df0d007920ee62b5d6a /pbrd | |
parent | pbrd: Prevent attempt at re-install for several scenarios (diff) | |
download | frr-9b71ea4ba50d38f1d186e40af95a4eba2e46f9a0.tar.xz frr-9b71ea4ba50d38f1d186e40af95a4eba2e46f9a0.zip |
pbrd: Fix installation and deletion in some cases
When a nexthop group is modified do not assume that it
is not installed. The creation of the pnhgc is enough
to set the installed to false. If we are reinstalling
it is not needed to set it as not installed.
When a pbrms is being installed/removed check to see if it
is already installed/deleted and do the right thing from
there.
Ticket: CM-20371
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pbrd')
-rw-r--r-- | pbrd/pbr_nht.c | 2 | ||||
-rw-r--r-- | pbrd/pbr_zebra.c | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index c58902cf5..1ba7d7e0a 100644 --- a/pbrd/pbr_nht.c +++ b/pbrd/pbr_nht.c @@ -410,8 +410,6 @@ static void pbr_nht_install_nexthop_group(struct pbr_nexthop_group_cache *pnhgc, install_afi = pbr_nht_which_afi(nhg, nh_afi); - pnhgc->installed = false; - route_add(pnhgc, nhg, install_afi); } diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index a1a2d34ac..99caf4cb9 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -500,8 +500,20 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms, struct pbr_map *pbrm = pbrms->parent; struct stream *s; - DEBUGD(&pbr_dbg_zebra, "%s: for %s %d", __PRETTY_FUNCTION__, pbrm->name, - install); + DEBUGD(&pbr_dbg_zebra, "%s: for %s %d(%d)", + __PRETTY_FUNCTION__, pbrm->name, + install, pbrms->installed); + + /* + * If we are installed and asked to do so again + * just return. If we are not installed and asked + * and asked to delete just return; + */ + if (install && pbrms->installed) + return; + + if (!install && !pbrms->installed) + return; s = zclient->obuf; stream_reset(s); |