]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: do not account twice references to rule context
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 18 May 2018 14:14:46 +0000 (16:14 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 31 May 2018 15:44:40 +0000 (17:44 +0200)
When rule add transaction is sent from bgpd to zebra, the reference
context must not be incremented while the confirmation message of
install has not been sent back; unless if the transaction failed to be
sent.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd/bgp_zebra.c

index a13de38a347e42895754cc995586a1027b793314..bc3f2a0756607f2ad0c3dc359754b1c23fbdf9fd 100644 (file)
@@ -2578,6 +2578,7 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,
                          bool install)
 {
        struct stream *s;
+       int ret = 0;
 
        if (pbm->install_iptable_in_progress)
                return;
@@ -2594,9 +2595,12 @@ void bgp_send_pbr_iptable(struct bgp_pbr_action *pba,
        bgp_encode_pbr_iptable_match(s, pba, pbm);
 
        stream_putw_at(s, 0, stream_get_endp(s));
-       if (!zclient_send_message(zclient) && install) {
-               pbm->install_iptable_in_progress = true;
-               pba->refcnt++;
+       ret = zclient_send_message(zclient);
+       if (install) {
+               if (ret)
+                       pba->refcnt++;
+               else
+                       pbm->install_iptable_in_progress = true;
        }
 }