summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-05-18 16:14:46 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-05-25 15:49:38 +0200
commitb5c4010508e224f63a6d72853e663f85b8c009e7 (patch)
tree625c27f6ad33cb50164194a860d03a10edcdba4d /bgpd
parentbgpd: add missing ecommunity flowspec to display (diff)
downloadfrr-b5c4010508e224f63a6d72853e663f85b8c009e7.tar.xz
frr-b5c4010508e224f63a6d72853e663f85b8c009e7.zip
bgpd: do not account twice references to rule context
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>
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_zebra.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index fccdd8f12..360a496e4 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -2564,6 +2564,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;
@@ -2580,9 +2581,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;
}
}