summaryrefslogtreecommitdiff
path: root/bgpd
AgeCommit message (Collapse)Author
2009-06-18[BGP/cleanup] main program cleanupStephen Hemminger
Check result of daemon() call to fix warning Make local variables static
2009-06-18[bgpd/cleanup] make message lists read onlyStephen Hemminger
2009-06-18[bgpd] add comment that bgp_capability_receive is exported for unit-testsPaul Jakma
2009-06-18[cleanup] Fix compile warningsStephen Hemminger
Fix printf format warning and make capability table 'const static'
2009-06-18[bgpd/cleanup] BGP make attribute variables localStephen Hemminger
Message lists can be read-only, and hash tables are local to this code.
2009-06-18[bgpd/cleanup] Make BGP FSM table read-only staticStephen Hemminger
The finite state machine table is immutable.
2009-06-18[bgpd] reference count the BGP instanceStephen Hemminger
When a BGP instance is deleted with lots of routes and neighbors it is possible for the peer rsclient queue to run after bgp_delete has been called. This would lead to bgpd crashing, see https://bugzilla.vyatta.com/show_bug.cgi?id=3436 The fix is to add reference counting to the BGP instance and defer actual freeing until all references are gone. This patch also fixes a memory leak where the self-reference peer instance was being created but never freed. The check in bgp_clear_route is no longer valid because it is possible for it to be called when peer is in Deleted state during cleanup.
2009-06-18[bgpd] Make declarations matchStephen Hemminger
These variables are const.
2009-06-12[cleanup] Make command nodes staticStephen Hemminger
The cmd_nodes used to configure vty, can mostly be static so (basic data hiding 101).
2009-06-12[cleanup] functions taking no args should be declared with void argsStephen Hemminger
Use Ansi-C prototypes rather than old K&R method of declaring function without arguments
2009-06-12[cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger
Simple conversion of XMALLOC/memset to XCALLOC
2009-06-09[bgpd] Fixed as-path prepend/exclude ASN handlingDenis Ovsienko
- aspath_gettoken(): use as_t to fix 4-byte ASN scanning (bug #484) - set_aspath_prepend_cmd(): use CMD_AS_RANGE in message to match actual range - no_set_aspath_prepend_val_cmd(): idem - set_aspath_exclude_cmd(): idem - no_set_aspath_exclude_val_cmd(): idem
2009-06-02Merge remote branch 'origin/master'Paul Jakma
2009-06-02[snmp] Compiler warning fixes for when "--enable-snmp" is configured.Chris Caputo
Compiled on 32-bit and 64-bit linux gcc 4.1.2 platforms. No run-time testing on 32-bit and limited run-time testing on 64-bit.
2009-06-02[bgp] Fix crash on SIGHUP, deref of freed workqueuesSteve Hill
* lib/workqueue.c: free-ing workqueues had never been tested obviously, queue's thread was not being stopped * bgpd/bgpd.c: null out freed workqueues, to prevent acting on freed workqueues
2009-06-01[trivia] Fixed typos in communities text (#334)Denis Ovsienko
2009-05-29[bgpd] 64-bit bugfix in community_del_val by Jeremy Jackson <jerj@coplanar.net>Andrew J. Schorr
* bgpd/bgp_community.c: (community_del_val) Fix bug in memcpy that was using the wrong size on architectures where a pointer is not 32 bits.
2009-05-08Fix bgp ipv4/ipv6 accept handlingStephen Hemminger
When bgp calls getaddrinfo, it gets both ipv6 and ipv4 addresses. Unless IPV6_ONLY is set on Linux, only the ipv6 bind will succeed, and the IPV4 connections will come in as mapped connections on the IPV6 socket.
2009-04-30[bgpd] AS4 bugfix by Chris Caputo <ccaputo@alt.net>Denis Ovsienko
* bgpd/bgp_aspath.c: (aspath_make_str_count) "assert (len < str_size)" was getting hit under certain 4-byte ASN conditions. New realloc strategy. * bgpd/bgp_aspath.c: (aspath_key_make) const warning fix. "%d" -> "%u" 4-byte ASN corrections. Prevent negative number when ASN is above 2^31.
2008-11-16[bgpd] Add 'show bgp views' commandMichael Lambert
* bgp_vty.c: (show_bgp_views_cmd) new command to list all defined views. (with small edits by Paul Jakma) Signed-off-by: Paul Jakma <paul@quagga.net>
2008-10-02Merge branch 'bgpd/fsm'Paul Jakma
2008-09-24[bgpd] Fix definition of an rsclient commandMichael Lambert
* bgp_route.c: (show_ip_bgp_view_rsclient_route_cmd) Add the missing "ip" to the command string. Signed-off-by: Paul Jakma <paul@quagga.net>
2008-09-09[bgpd] Allow accepted peers to progress even if realpeer is in ConnectPaul Jakma
* bgpd/bgp_packet.c: (bgp_open_receive) Try fix the little race in the FSM, where a accept-peer that progress faster than realpeer gets closed down if realpeer is still just in Connect, by allowing the realpeer to be bgp_stop'ed and doing the regular swapping-of-FSM state.
2008-09-06[bgpd] Document the FSM dummy-peer race that sometimes afflicts session setupPaul Jakma
* bgp_packet.c: (bgp_open_receive) the accept-peer hack can sometimes cause a race between two peers that try to establish sessions to each other, causing session setup to fail when it should have succeeded. In the worst case, the race can 'loop', causing prolonged failure to establish sessions.
2008-09-04Merge branch 'restricted-mode'Paul Jakma
2008-09-01Merge commit 'remotes/jocke/ospf_neighbour'; commit ↵Paul Jakma
'remotes/jocke/snmp_crosscompile'
2008-08-26Revert "[bgpd] Add 'bgp open-accept' option, to send OPEN immediately on ↵Paul Jakma
accepted conns" Revert commit d664ae1182c29b74b409bc8594b7bd0575e91ce9. An experimental patch which violates RFC4271 quite badly, but managed to accidently sneak its way in.
2008-08-25Make --enable-snmp cross compile and make libcrypto optional with ↵Joakim Tjernlund
--without-crypto Autoconfig work by me, the rest was done by "Kirill K. Smirnov" <lich@math.spbu.ru>
2008-08-23[vty] Add support for a 'restricted mode' with anonymous vty connectionsPaul Jakma
* lib/command.h: Add a RESTRICTED_NODE, intended for use with anonymous, 'no login' vtys, to provide a subset of 'view' mode commands. * lib/command.c: Add RESTRICTED_NODE bits, nothing special, just following VIEW_NODE. * lib/vty.c: (vty_auth) enable authentication should fall back to restricted/view node as appropriate. (vty_create) init vty's to restricted/view node as appropriate, for the 'no login' case. (vty_{no_,}restricted_mode_cmd) config commands to enable 'anonymous restricted' in vty configuration. (vty_config_write) 'anonymous restricted' config. (vty_init) Install some commands to restricted mode, and the 'anonymous restricted' config commands into VTY_NODE. * bgpd/*.c: Install some of the safe(r) BGP commands into 'restricted mode', i.e. lookup commands of non-sensitive data. Useful with looking-glass route-servers.
2008-08-22[administrivia] Update gitignore filesPaul Jakma
- Add more stuff, archive libraries, etc..
2008-08-22[administrivia] Git should ignore backup files and .loT filesPaul Jakma
2008-08-22[trivia] Remove ChangeLog files, as this data is now maintained in SCMPaul Jakma
2008-08-22[bgpd] remove useless check and return in bgp_config_write_dampStephen Hemminger
2008-08-17 Stephen Hemminger <stephen.hemminger@vyatta.com> * bgp_damp.?: (bgp_config_write_damp) remove useless check of statically allocated config storage, and useless return value Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22[warnings] Fix various SOS warningsPaul Jakma
2008-08-15 Paul Jakma <paul.jakma@sun.com> * */*: Fix various problems flagged by Sun Studio compiler. - '<qualifier> <storage>' obsolescent in declarations - empty statements (';' after ALIAS definitions) - implicit declarations (e.g printstack in lib/log.c) - "\%" in printf string instead of "%%" - loops that return on the first iteration (legitimately, but compiler can't really know), e.g. bgp_routemap.c - internal declarations which mask prototypes.
2008-08-22[lib] mes_lookup string lookup table argument should be marked constStephen Hemminger
2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com> * lib/log.{c,h}: struct message argument should point to const * */*.c: adjust to suit, Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22[lib] hash compare function arguments ought to be const qualifiedStephen Hemminger
2008-08-14 Stephen Hemminger <stephen.hemminger@vyatta.com> * lib/hash.h: (struct hash) Hash comparator callback really ought to treat storage behind arguments as constant - a compare function with side-effects would be evil. * */*.c: Adjust comparator functions similarly, thus fixing at least a few compiler warnings about const qualifier being dropped. Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22[build] Test for GNU-style PIE support in toolchain and enablePaul P Komkoff Jr
2008-08-13 Paul P Komkoff Jr <i@stingr.net> * configure.ac: add a configure flag and autoconf macro, which will determine if your toolchain supports PIE. * */Makefile.am: add corresponding CFLAGS and LDFLAGS into appropriate places. Signed-off-by: Paul Jakma <paul@quagga.net>
2008-08-22[bgpd] Add 'bgp open-accept' option, to send OPEN immediately on accepted connsPaul Jakma
2007-08-31 Paul Jakma <paul.jakma@sun.com> * (general) Add 'bgp open-accept' option, to allow bgpd to send OPEN on accepted connections, i.e. to not wait till after collision-detect to send OPEN, which appears to be allowed in RFC4271. This may help speed up establishing sessions, or help avoid FSM problems with sessions to certain peers. Not enabled by default though.
2008-08-22[administrivia] Add .gitignore files, based on .cvsignores.Paul Jakma
2008-07-22[bgpd] Fix triggerable crash when compiled with --disable-bgp-announcePaul Jakma
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.
2008-07-22[bgpd] fix a couple of trivial compiler warningsPaul Jakma
2008-07-22 Paul Jakma <paul.jakma@sun.com> * bgp_community.c: (community_str2com) assigns defaults to local vars * bgp_attr.c: (bgp_attr_parse) match format specifier to arg * bgp_table.{c,h}: (bgp_table_top) can take a * to a const, quelling warning in bgp_route.c
2008-07-21[bgpd] TCP-MD5: password vty configuration and initial Linux supportPaul Jakma
2008-07-21 Paul Jakma <paul.jakma@sun.com> * bgp_packet.c: (bgp_open_receive) fix warning in a zlog call * bgp_vty.c: (bgp_vty_return) add return code * bgpd.c: (bgp_master_init) setup the socket list. * bgp_network.c: Remove the dual IPv4/6 socket thing for now, which was implemented by Michael, until such time as its clear its required for Linux (see sockopt comments). IPv6 support, including IPv4 sessions on AF_INET6 sockets, therefore is broken, and the '-l 0.0.0.0' arguments would need to be given to bgpd to make things work here. 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Tomohiko Kusuda <kusuda@inetcore.com> Leigh Brown <leigh@solinno.co.uk> * bgp_network.c: (bgp_md5_set_one) shim between libzebra tcp-md5 sockopt and bgpd. (bgp_md5_set_socket) Helper for bgp_connect (bgp_md5_set) setup TCP-MD5SIG for the given peer. (bgp_connect) call out to bgp_md5_set_socket for the outgoing connect socket. (bgp_socket) save references to the listen sockets, needed if TCP-MD5SIG is applied later or changed. * bgp_vty.c: (*neighbor_password_cmd) New 'neighbor ... password' commands. * bgpd.c: (peer_{new,delete) manage TCP-MD5 password (peer_group2peer_config_copy) inherit TCP-MD5 password (peer_password_{un,}set) orchestrate the whole add/remove of TCP-MD5 passwords: applying checks, stopping peers, and trying to return errors to UI, etc. (bgp_config_write_peer) save password. Fix missing newline in writeout of neighbor ... port. 2008-07-21 Paul Jakma <paul.jakma@sun.com> * sockunion.c: ifdef out various places that converted v4mapped sockets to pure v4. Doesn't seem necessary at all, presumably a workaround for now historical inet_ntop bugs (?) 2008-07-21 Michael H. Warfield <mhw@wittsend.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> * sockopt.{c,h}: (sockopt_tcp_signature) Add TCP-MD5SIG support.
2008-07-02[vty] CMD_AS_RANGE accidently quoted and so not expanded in vtyPaul Jakma
2008-07-02 MIYAJIMA Mitsuharu <miyajima.mitsuharu@anchor.jp> * *.c: CMD_AS_RANGE was being used inside command strings, and thus not being expanded, fix by dequoting.
2008-07-02[bgpd] Fix double-free crash in bgp_table_finish, seen with rs-clientPaul Jakma
2008-07-02 Stephen Hemminger <stephen.hemminger@vyatta.com> * bgp_table.{c,h}: (bgp_table_finish) Take a double pointer and scrub pointer in caller, so fixing double-free crashes seen with route-server-client configuration. * *.c: Adjust all callers of bgp_table_finish 2008-07-02 Paul Jakma <paul.jakma@sun.com> * bgp_table.{c,h}: (bgp_node_delete, bgp_table_free) shouldn't be exported.
2008-06-07[bgpd] minor changes to bgp_mp_reach_parsePaul Jakma
2008-06-07 Paul Jakma <paul@jakma.org> * bgp_attr.{c,h}: (bgp_mp_{un,}reach_parse) export, for unit tests. * bgp_attr.c: (bgp_mp_reach_parse) Add logging. Tighten length test to bounds check against the attribute length rather than the stream length..
2008-06-01[bgpd] bug #419: partial aspath-limit incorrectly causes session resetPaul Jakma
2008-06-01 jfletche@gmail.com * bgp_attr.c: (bgp_attr_aspathlimit) fix silly bug in flags check that was causing BGP to drop sessions if it received a aspath-limit with partial set. Fixes bug #419.
2008-05-29[daemons] Sanity check port number arguments before usePaul Jakma
2008-05-29 Martin Nagy <mnagy@redhat.com> * */*main.c: Sanity check port numbers before using.
2008-04-10+ [bgpd] Added new route-map set statement: "as-path ignore"Denis Ovsienko
2008-03-13[bgpd] remove unnecessary 0 entries from struct message'sPaul Jakma
2008-03-13 Paul Jakma <paul.jakma@sun.com> * (various) Remove 0 entries from struct message's, unneeded due to recent improvements in mes_lookup/LOOKUP.
2008-01-29[bgpd] fix crash on startup if compiled IPv4-onlyPaul Jakma
2008-01-29 Jorge Boncompte <jorge@dti2.net> * bgp_network.c: (bgp_socket) IPv4-only version crashes if -l is not used as address will be null.