diff options
author | Paul Jakma <paul.jakma@sun.com> | 2008-07-22 21:11:48 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2008-07-22 21:11:48 +0000 |
commit | 750e814693050bc97391eec618aad9db798ee5e8 (patch) | |
tree | 03d3e27a68b0593002d8f73609235919c030e426 /HACKING | |
parent | 851a1a5c146b346d8b8f58fe3924baa5c208f865 (diff) |
[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 'HACKING')
-rw-r--r-- | HACKING | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -1,5 +1,5 @@ -*- mode: text; -*- -$Id: HACKING,v 1.21 2005/11/10 10:21:19 paul Exp $ +$Id$ GUIDELINES FOR HACKING ON QUAGGA @@ -75,6 +75,28 @@ release. See also below regarding SHARED LIBRARY VERSIONING. +COMPILE-TIME CONDITIONAL CODE + +Please think very carefully before making code conditional at compile time, +as it increases maintenance burdens and user confusion. In particular, +please avoid gratuitious --enable-.... switches to the configure script - +typically code should be good enough to be in Quagga, or it shouldn't be +there at all. + +When code must be compile-time conditional, try have the compiler make it +conditional rather than the C pre-processor. I.e. this: + + if (SOME_SYMBOL) + frobnicate(); + +rather than: + + #ifdef SOME_SYMBOL + frobnicate (); + #endif /* SOME_SYMBOL */ + +Note that the former approach requires ensuring that SOME_SYMBOL will be +defined (watch your AC_DEFINEs). CHANGELOG |