]> git.puffer.fish Git - mirror/frr.git/commitdiff
pbrd: Fix installation and deletion in some cases
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 6 Apr 2018 15:41:10 +0000 (11:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 17 Apr 2018 22:40:17 +0000 (18:40 -0400)
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>
pbrd/pbr_nht.c
pbrd/pbr_zebra.c

index c58902cf5e664aee208941fe96f3ac3235294e69..1ba7d7e0a858364fd53701b2a08995aa98c12eed 100644 (file)
@@ -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);
 }
 
index a1a2d34ac1d8499d64e2f4604fdce407b44979fa..99caf4cb9af8321373d345550600db98175ac12f 100644 (file)
@@ -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);