From 750e814693050bc97391eec618aad9db798ee5e8 Mon Sep 17 00:00:00 2001 From: Paul Jakma Date: Tue, 22 Jul 2008 21:11:48 +0000 Subject: [bgpd] Fix triggerable crash when compiled with --disable-bgp-announce 2008-07-22 Paul Jakma * HACKING: Document preference for compiler conditional code, over cpp conditional. * configure.ac: DISABLE_BGP_ANNOUNCE always should be defined. * bgp_{packet,route,advertise}.c: change to compiler testing of DISABLE_BGP_ANNOUNCE, rather than cpp. 2008-07-22 MIYAJIMA Mitsuharu * bgp_packet.c: (bgp_update_packet_eor) Fix crash triggerable if a bgpd was compiled with --disable-bgp-announce and if GR is advertised by peer. --- bgpd/bgp_advertise.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'bgpd/bgp_advertise.c') diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index 73b868a8..870aab13 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -220,9 +220,8 @@ bgp_adj_out_set (struct bgp_node *rn, struct peer *peer, struct prefix *p, struct bgp_adj_out *adj = NULL; struct bgp_advertise *adv; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return; /* Look for adjacency information. */ if (rn) @@ -274,9 +273,8 @@ bgp_adj_out_unset (struct bgp_node *rn, struct peer *peer, struct prefix *p, struct bgp_adj_out *adj; struct bgp_advertise *adv; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return; /* Lookup existing adjacency, if it is not there return immediately. */ for (adj = rn->adj_out; adj; adj = adj->next) -- cgit v1.2.3