diff options
author | paul <paul> | 2008-07-22 21:11:48 +0000 |
---|---|---|
committer | paul <paul> | 2008-07-22 21:11:48 +0000 |
commit | d0cee3d3d7267f8f5c1d1ffd5c5fd8802a9db987 (patch) | |
tree | b621bcb7b53d309820d6b4a1c855da6a4755c7c5 /bgpd/bgp_packet.c | |
parent | 42f57d1707f9da733ca2113bf8d9b176bf088ecf (diff) | |
download | quagga-d0cee3d3d7267f8f5c1d1ffd5c5fd8802a9db987.tar.bz2 quagga-d0cee3d3d7267f8f5c1d1ffd5c5fd8802a9db987.tar.xz |
[bgpd] Fix triggerable crash when compiled with --disable-bgp-announce
2008-07-22 Paul Jakma <paul.jakma@sun.com>
* 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 <miyajima.mitsuharu@anchor.jp>
* 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.
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r-- | bgpd/bgp_packet.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 623fd9ec..4d7f32de 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -235,9 +235,8 @@ bgp_update_packet_eor (struct peer *peer, afi_t afi, safi_t safi) struct stream *s; struct stream *packet; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return NULL; if (BGP_DEBUG (normal, NORMAL)) zlog_debug ("send End-of-RIB for %s to %s", afi_safi_print (afi, safi), peer->host); @@ -369,9 +368,8 @@ bgp_default_update_send (struct peer *peer, struct attr *attr, char attrstr[BUFSIZ]; char buf[BUFSIZ]; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return; if (afi == AFI_IP) str2prefix ("0.0.0.0/0", &p); @@ -438,9 +436,8 @@ bgp_default_withdraw_send (struct peer *peer, afi_t afi, safi_t safi) bgp_size_t total_attr_len; char buf[BUFSIZ]; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return; if (afi == AFI_IP) str2prefix ("0.0.0.0/0", &p); @@ -958,9 +955,8 @@ bgp_route_refresh_send (struct peer *peer, afi_t afi, safi_t safi, struct bgp_filter *filter; int orf_refresh = 0; -#ifdef DISABLE_BGP_ANNOUNCE - return; -#endif /* DISABLE_BGP_ANNOUNCE */ + if (DISABLE_BGP_ANNOUNCE) + return; filter = &peer->filter[afi][safi]; |