summaryrefslogtreecommitdiffstats
path: root/bgpd/bgpd.h
diff options
context:
space:
mode:
authorvivek <vivek@cumulusnetworks.com>2016-01-22 19:56:48 +0100
committervivek <vivek@cumulusnetworks.com>2016-01-22 19:56:48 +0100
commit96885f16b0838d3324db86153d50e27fe2cef3a6 (patch)
tree48f7add4fe5fb036d43d6e8652d72bbf3eaa360c /bgpd/bgpd.h
parentospf6d: Fix double increment of Sequence Number (diff)
downloadfrr-96885f16b0838d3324db86153d50e27fe2cef3a6.tar.xz
frr-96885f16b0838d3324db86153d50e27fe2cef3a6.zip
BGP: Rework iteration of peer_af_array
While processing references to the macro PEERAF_FOREACH(), aggressive loop optimization by gcc 4.9.x (probably 4.8 and greater) was resulting in the generated code not checking on the index as well as eliminating some code. This was leading to a dereference of invalid memory when a BGP peer came up. The fix is to scrap this convoluted macro. Two other changes done are to eliminate overloading of "afindex" and make the loop iterator an integer. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Dave Olson <olson@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-8889 Reviewed By: CCR-4018 Testing Done: Verified failure scenario Note: This code was added as part of update-groups implementation; when upstreaming update-groups, this patch should also be included.
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r--bgpd/bgpd.h6
1 files changed, 0 insertions, 6 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 14ebf840a..7af51f304 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -840,12 +840,6 @@ struct bgp_nlri
bgp_size_t length;
};
-#define PEERAF_FOREACH(peer, paf, afi) \
- for ((afi) = BGP_AF_START, (paf) = (peer)->peer_af_array[(afi)]; \
- (afi) < BGP_AF_MAX; \
- (afi)++, (paf) = (peer)->peer_af_array[(afi)]) \
- if ((paf) != NULL) \
-
/* BGP versions. */
#define BGP_VERSION_4 4