summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix bugs in vty error handlingex25bChris Hall2012-06-0811-90/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advance version to 0.99.20ex25b. Bug fixes: * when closing a vty, if close() returned an error, the vtys would fall into a loop trying to recover. This was found on FreeBSD, which will return ECONNRESET on close(), which is not standard POSIX behaviour. * when closing a vty in response to EPIPE or ECONNRESET, managed to leave the vty mutex locked. This stopped the Routing Engine *dead* on the next CLI command that required the Routing Engine. SIGTERM/SIGINT would not stop bgpd -- a SIGKILL would be required. Other changes: * toned down the error reporting of EPIPE in the vty -- so no longer looks like an error... ...closing a vty by "exit" command is logged as "closed" ...closing a vty in response to the client closing their end of the connection is logged as "terminated: terminal closed", and no longer logs an EPIPE error. * changed error reporting on close() and shutdown() for vty, so that nothing is logged if an i/o error has already logged... ...so that redundant error messages are suppressed. * applied slightly finer jittering to bgpd timers. * work in progress on new vtysh.
* Work in progress -- pthread handling and debug improvementsChris Hall2012-05-2817-949/+4036
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logging: * added "debug bgp io" -- to log all BGP Engine I/O, with the option to log input or output only. This is similar to "debug bgp update", but that affects the Routing Engine, while this affects the BGP Engine. * reviewed and updated "debug bgp fsm". The fsm logging now covers all aspects of the fsm, which is all in the BGP Engine. Any nominally fsm logging in the Routing Engine is now "event" logging. Added collision resolution to fsm logging. Dovetailed fsm and keepalive logging. * removed logging of route advertisment timer and withdraw events. pthread and nexus handling: * qpt_thread object created to encapsulate a pthread, with means to keep track of existing pthreads and their cpu usage. This is now used instead of the list of qpnexus for the watch-dog. * added explicit qpt_finish() and call from qexit(). Collects up and destroys all qpt_thread -- including any "detached" qpt_thread. * changed qpt_thread_signal() to qpt_thread_raise() Now takes qpt_thread object (not pthread_t) and also is now agnostic about qpthreads_enabled. Work in progress -- pthread handling and debug improvements Logging: * added "debug bgp io" -- to log all BGP Engine I/O, with the option to log input or output only. This is similar to "debug bgp update", but that affects the Routing Engine, while this affects the BGP Engine. * reviewed and updated "debug bgp fsm". The fsm logging now covers all aspects of the fsm, which is all in the BGP Engine. Any nominally fsm logging in the Routing Engine is now "event" logging. Added collision resolution to fsm logging. Dovetailed fsm and keepalive logging. * removed logging of route advertisment timer and withdraw events. pthread and nexus handling: * qpt_thread object created to encapsulate a pthread, with means to keep track of existing pthreads and their cpu usage. This is now used instead of the list of qpnexus for the watch-dog. * added explicit qpt_finish() and call from qexit(). Collects up and destroys all qpt_thread -- including any "detached" qpt_thread. * changed qpt_thread_signal() to qpt_thread_raise() Now takes qpt_thread object (not pthread_t) and also is now agnostic about qpthreads_enabled. * tidied up pthread attribute and status handling, to cope with a wider variety of pthread implementations, and to lay ground- work for more pthreads and more subtle scheduling. Logging at pthread start up provides more information about what the local implementation supports. Flags up some issues with FreeBSD -- in particular broken pthread CPU clock :-( * changed handling of "thread specific" variables, so that is now also qpthreads_enabled agnostic. * added tests in configure.ac to identify when: pthread_attr_getstack() pthread_attr_setstack() pthread_attr_get_np() pthread_getattr_np() are available. (For FreeBSD, at least, also need to know whether to include <pthread_np.h>.) Others: * added "NO_RETURN" macro for __attribute__((noreturn)) or local equivalent. * added qfb_nam_t -- a shorter general purpose fixed length sting object.
* Fix problems with handling of oversize BGP messagesex24bChris Hall2012-05-073-50/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The objective is to (as gracefully as possible) deal with outgoing UPDATE messages which simply do not in the maximum size BGP message. This can happen if very large AS_PATH or Community attributes come in, and are then extended. (Sending an UPDATE to an AS2 speaking peer can create a complete second copy of the AS_PATH !) Previous versions of Quagga would crash under these circumstances. Recent version were changed to tolerate and detect oversize messages. Any oversize message is logged as an error and discarded. This version will also withdraw prefixes if the selected route simply cannot be advertised. This version also corrects the handling of messages which are limited to the maximum BGP message size -- in particular UPDATE messages which carry a large number of IPv4/Unicast prefixes. (This was broken by the earlier efforts to handle oversize messages.) Changes in this commit: * update version to 0.99.20ex24b * where a set of attributes is too big to fit into a BGP message, or so big that not even one prefix will also fit into a BGP message, the following steps are now taken: - the BGP message is discarded and an error logged (as in other recent versions -- Quagga does not crash). - any prefixes which should have been advertised with the (broken) attributes will be withdrawn, if they have been advertised earlier with valid attributes. A further error is logged, listing the affected prefixes. - prefixes which are suppressed in this way are not counted as having been sent. At present there is no "show" command which will show which prefixes have been suppress -- TBA. * for all AFI/SAFI announce as many withdrawn prefixes as will fit in a BGP message. Previously, all AFI/SAFI other than IPv4/Unicast would send one withdrawn prefix per message. (This is still the case for announcements. It seems unlikely that many IPv6 prefixes will have the same attributes... so this does not seem worth fixing immediately.) * ensure that NOTIFICATION message cannot exceed the maximum length of a BGP message, no matter how much data is sent (!). * where IPv4/Unicast prefixes share the same attributes, they are now announced in the order received. Previously, when prefixes were added to the list hung off the 'struct bgp_advertise_attr', they were in LIFO order. * add SAFI name table. * log pthread attributes when creating a pthread. * fix scheduling of withdrawn prefixes to reduce number of BGP messages generated. Bug fixes: * fix discard of invalid IPv6 link-local nexthop (recent bug). * where amount of information that is put into a BGP message is limited by the maximum message size, fix so that this works again. (This was broken recently.) * set "Bottom of Stack" bit in MPLS VPN "tag" in MP_REACH and MP_UNREACH outgoing attributes.
* Fix Watch-Dog so that runs with -d !Chris Hall2012-04-192-44/+128
| | | | | | | | | Changed order of initialisation, so that pthread_getcpuclockid() is done *after* has daemonised. It seems that the clockid for the main pthread before daemonisation is not the same as the clockid for the same pthread after ! Removed configure-quagga which had somehow leaked out.
* Improve error handling in lib/qpthreads and lib/qtimeChris Hall2012-04-196-40/+176
| | | | | | | | | | | | | | | | | | | | Error handling now: * gives name of mutex when fails. * if clock_gettime() fails, this is fatal for CLOCK_REALTIME and CLOCK_MONOTONIC (as before) but not for any other clock (new behaviour). * log errors (and other anomalies) in pthread_getcpuclockid(), but do not abort. Remove a couple of warnings about variable "format" values for printf-like functions. Fix bug in new vtysh/extract.pl -- change mechanics of extracting CMD_INSTALL_TABLE entries, so that deals better with #if etc between entries.
* Tidy up after testing on FreeBSD 9.0Chris Hall2012-04-172-4/+16
| | | | | | | | | | | | | | | | gcc 4.6.1 picked up a couple of (spurious) "may be used unitialised" variables -- fixed. For reasons unknown FreeBSD unistd.h declares _POSIX_THREAD_SAFE_FUNCTIONS as -1... which tripped a CONFIRM(). _POSIX_SPIN_LOCKS is declared 200112, and according to POSIX-2004 _POSIX_SPIN_LOCKS => _POSIX_THREAD_SAFE_FUNCTIONS -- so it is a bit of a surprise (though the statement in POSIX is in the context of support for "Advanced Realtime Threads", which includes _POSIX_SPIN_LOCKS)... Recast to warn instead of generate compilation error. Fixed test-prefix.c to work with uint8_t sa_family_t !
* Watch-Dog Work-in-ProgressChris Hall2012-04-1612-48/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added -W command line argument to bgpd to start watch-dog: -W99[,[+]path] where: 99 is the watch-dog interval, eg. 2 or 5 path is file that watch-dog writes to -- default is stderr. if '+' is given, will append to the file. Watch-Dog looks out for: * not being woken up when expected. * CLOCK_REALTIME and CLOCK_MONOTONIC not advancing together. * pthreads stalling. * mutexes being locked for long periods. * CPU consumption by each pthread in each watch-dog interval. If pthreads are locking up or going into a flat spin, the Watch-Dog should spot it. Pro tem: outputs pthread properties to stderr at start-up.
* Remove CONFIRM(_POSIX_REENTRANT_FUNCTIONS) -- not POSIX !Chris Hall2012-04-1213-92/+301
| | | | | | | | | | | | | Turns out that _POSIX_REENTRANT_FUNCTIONS is not a POSIX feature test macro... name notwithstanding. It appears to be quite well known, but in some cases appears to be a feature request, and in others a feature test :-( So, since it adds no value -- and breaks FreeBSD -- the CONFIRM is removed. Further work in progress for Watch-Dog -- all known mutexes are held in an all known mutexes list, complete with name of mutex for diagnostic purposes.
* Change Watch-Dog to use nanosleep() -- for FreeBSDChris Hall2012-04-122-37/+46
| | | | | | | | FreeBSB has not heard of clock_nanosleep(). Happily it has heard of nanosleep() -- from POSIX-2001. Recast code to expect nanosleep() and removed glibc feature test macros.
* Further work on Watch-Dog and extend "debug bgp update"Chris Hall2012-04-1112-64/+441
| | | | | | | | | | | | | | | | | For "debug bgp update out" log the dispatch of UPDATE messages by the BGP Engine -- so the logging shows what the Routing Engine decided to send, and the BGP Engine show what was actually written away. [In passing, in bgp_connection_write_action() treat a zero return from write() and an EAGAIN/EWOULDBLOCK.] Watch-Dog now tracks the CPU utilisation for each nexus, and checks that each one runs at least once between watch-do runs. The pthread_getcpuclockid() may or may not be supported, and that must be determined at run-time. So, some changes made to the qlib_init_first_stage() to capture this.
* Remove a number of "assigned but unused" warnings and other WIPChris Hall2012-04-1024-112/+914
| | | | | | | | | | | | | | -Wunused-but-set-variable throws up a number of errors, this patch removes some of thos in bgpd, lib and zebra. Fix crash in vty when using ">*" /dev/null output pipe. Work in Progress (WIP): 1) adding "Watch-Dog" pthread to keep an eye on all other pthreads and state of mutexes etc. 2) creation of Integrated Configuration in vtysh.
* Fix ip6_masklen() so that does not require non-standard cast to union.Chris Hall2012-03-304-8/+14
| | | | | | | Avoids gcc-ism and replaces passing 16 byte structure by passing address of same. Compiled code appears very similar to previous state. Fixed all calls of ip6_masklen() to suit.
* Fix compilation issue with <features.h>, which is a glibc special.Chris Hall2012-03-293-84/+175
| | | | | | | | | | | | | | | | | The "misc.h" #includes <features.h> because that was found to give consistent values for the many macros that control GNU, many flavours of POSIX, and Standard C/C99 library behaviour -- for glibc. Sadly, this broke compilation where <features.h> is absent, ie when glibc is not used. To fix this made changes to configure.ac to create HAVE_FEATURES_H, so that the #include can be skipped. At the same time, added AC_FUNC_STRERROR_R and removed the *horrible* kludge which to date has supported use of strerror_r. Tidied up and re-tested use of strerror_r().
* Fix a few issues thrown up by compiling under FreeBSDChris Hall2012-03-284-17/+16
| | | | | | | | | | | | | | | | | | | | | * lib/memory.c, show_memory_summary_info() Call of mem_mt_get_stats() (under HAVE_MALLINFO skip) needed an extra parameter. * lib/vty_io.c POSIX standard header for wait stuff is <sys/wait.h> * lib/vty_io_file.c, uty_pipe_exec_prepare() F_DUPFD_CLOEXEC is POSIX-2008 (Issue 7) but FreeBSD 9.0 is not. Since this is not vital, recast slightly to avoid the need. * /lib/vty_io_vtysh.c, sock_unix_set_path() Fix complete nonsense under HAVE_STRUCT_SOCKADDR_UN_SUN_LEN skip.
* Handle IPv6 as pairs of uint64_t in prefix.c.Chris Hall2012-03-262-183/+262
| | | | | | | | | | | | | C99 requires uint64_t, so seems reasonable to use those where possible. Reduces most IPv6 functions to operations on one or two 64-bit parts. For native 32-bit processors, we leave it to the compiler to optimise the operation on pairs of 32-bit values -- and look forward to such processors being phased out. For maximum performance requires a __builtin_bswap64() or equivalant to be added.
* Rework prefix.c to remove large-ish tables of things.Chris Hall2012-03-263-403/+237
| | | | | | | | | | | | | | | | | | | A few instructions are probably better than a large table and cache misses. Uses __builtin_clz() if __GNUC__ or ffs() if not. Handling IPv6 addresses as four uint32_t improves some code and allows some code sharing between IPv4 and IPv6. Updated test-prefix.c to test apply_mask_ipv4() and apply_mask_ipv6() which were affected by these changes, and added more random trailing rubbish for the test of test_prefix_common_bits() which is more sensitive to that if not __GNUC__. Under -Os gcc may not inline some functions if they are used often enough -- even when explicitly declared inline. You have to be firm with it and use __attribute__((always_inline)).
* Merge branch 'master' into euro_ix_bex23bChris Hall2012-03-232-3/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v0.99.20ex23b -- Quagga 'master' as at 23-Mar-2012 Conflicts: bgpd/bgp_attr.c bgpd/bgp_attr.h Difference between 'master' and 0.99.20.1 is in these files. Handling of attributes has been worked over again to common up checks of the flags, and to use a common parsing structure, which reduces the clutter of parameters for the individual attribute parsing functions. bgpd/bgp_open.c bgpd/bgp_packet.c lib/thread.c ospfd/ospf_packet.c These were artifacts, caused by common patches in master and 0.99.20.1 -- and some twitchy-ness about whitespace !
| * lib: fix incorrect thread list processing loopsPaul Jakma2012-02-281-2/+6
| | | | | | | | | | | | * thread.c: (thread_timer_process,thread_process) thread_list_delete nulls thread->next. Loops need to save next first, or will only process the head. Problem noted by Lou Berger <lberger@labn.net>.
* | Tidy up some XMALLOC items that were not being XFREE'd.Chris Hall2012-03-228-9/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_peer_index replace unused bgp_peer_index_reset() by bgp_peer_index_finish() and call same at bgp shut-down. discard unused bgp_peer_index_mutex_free() and replace bgp_peer_index_mutex_init() by bgp_peer_index_init_r(). * lib/command.c and command_parse.c add cmd_parser_finish() to discard store of "words" and arrange to call same in cmd_table_terminate(). * reset vector of files in qps_selection_ream(), so that frees the vector body -- which it should have been doing ! * add mem_mt_show_stderr() for debug (for all the use it may be). * fix qpt_mutex_destroy(), qpt_cond_destroy() and qpt_spin_destroy() so that if fail when !qpthreads_active will log the error (and not crash). Sweeps issues under the carpet, but does not hide same.
* | Avoid crashing if fails to destroy mutex etc at shut-downChris Hall2012-03-181-13/+46
| | | | | | | | | | | | At shut-down it is possible that mutexes etc. may not be in a suitable state to be destroyed. But since is shutting down, there is no point in triggering an abort().
* | Merge Quagga master branch -- as of 1-Mar-2012 -- into euro_ix_bex21bChris Hall2012-03-1735-763/+1605
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version 0.99.20ex21b This brings us up to date with: commit 48f99b0c2bfed8d3880732d188e1d5964f575ee4 Date: Thu Sep 29 16:55:23 2011 +0400 release: 0.99.20 and the subsequent: commit dc00d2bb56aa6a84dd2328133f69db3c3e6d9dc7 Date: Sun Jan 8 14:47:06 2012 +0000 Marker merge for 'RE-0.99.17.6' This marker merge (i.e. an 'ours' strategy merge) is a placeholder to show that all commits in Quagga-RE stable, to its release RE-0.99.17.6 tag, have been reviewed and merged into 'master'. and then further commits (in descending date order) commit b51a3a31500133e3e26f12e7639f297c655bc735 commit ef2d5d100431031c32ea35b3c834b46cff16f511 commit 4c78376f96cd2ca56f1c6476b76fd659654431f5 commit e854095932260b3e6187902aa9a7baa0e96b9428 commit e6b03b77766dce8009ad7b4a2392e14addf4ab0f commit c25eaffdb2190149e768dc4ee4efc913c6d02992 commit d034aa027ef44d0a74805c27ad2a4d8ea20395d1 commit 907fd95e502e10334e5390c73cc57588b88b8171 commit 7fd6cd819ff98f0580b745ba637990df9c20ef0f commit 4c0cf00afc4340a429a9c4830f638b4593d7c3af commit 4afa50b393ff1fb34dd577888a05b81dfdced5af commit 6eb0c5ab1d43bcf9edd4fefd19031f2b96ded728 commit aca43b656623f38dfa6ea835dacbdfec51d03a67 commit 6bb1273e83c29b3aeff9584bc8f6272e773294ad commit d660f698427277ce695a5b756f3143c8304274ea commit 6134b875f39986564aced5e2d7329fcd852f17f4 commit b4e45f67057be22133b6bec88cdf285d5c8214db commit 6eac79a6fed4842e00607c00c445213b51bba377 commit cb32fd690a957819865219a847e3c21a53a0f419 commit 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 commit f768f367bcd1f37a53c563495176a5a134caf234 commit c7ec179a95c1ed4fcd3d3be3f981c8c20dce534a commit cddf391bf6839e9f093cef15508669c1f3f92122 commit 5a616c08ce089e25dc0e8da920727af4d11279bf commit 6ae93c058725991df5a9ae35cefec368919b5fea commit fc98d16ea77372f4ab4231e8904f8467e8d1ef71 A summary of the changes that relate to bppd, zebra and the lib follows. bgpd changes * attribute handling: (a) now checks the flag byte for all attributes and issues suitable log messages and notifications, (b) reports some length issues that previously let slide (local pref). Tighten End-of-RIB detection -- now iff an MP_UNREACH is the *only* attribute and no ordinary update or withdraw. * added --socket/-z option -- sets zebra socket name * sets IPv6 tclass as required * improved next hop handling and added "show ip bgp scan" and "show ip bgpd scan detail" commands. see commits: fc98d16ea77372f4ab4231e8904f8467e8d1ef71 0e8032d69961ae196c11ba6ead856084c7acf7c2 b64bfc1c4a552fc0b4dd024d5f77171ec848a5df 318f0d8a7f5e8e87086bbf2a9e7c4b35638951ac 8e80bdf20f493a71bcf74262ed3aa3a2437f4df6 f04a80a5d209dbb54f6fec5d0149b7c0e489d29e * removed SAFI_UNICAST_MULTICAST * fiddled with SAFI_MPLS_LABELED_VPN -- unsure if this is now complete -- stuff here TODO ! * support for multicast SAFI see commits: 73bfe0bd9adb8e4dfcee7239e56a425c6d58f4e9 5a616c08ce089e25dc0e8da920727af4d11279bf * added "match probability" commands * uses "route_types.txt" more effectively -- which affects the implementation of "redistribute" commands see commit: e0ca5fde7be5b5ce90dae78c2477e8245aecb8e9 * "nexthop-local unchanged" included in configuration. zebra changes * some whitespace change clutter :-( * ZEBRA_HELLO and mopping up routes (BZ#448) * implement route_types.h * support for SAFI_MULTICAST commit f768f367bcd1f37a53c563495176a5a134caf234 IPv6 MP-BGP Routes addition and deletion commit cddf391bf6839e9f093cef15508669c1f3f92122 IPv4 MP-BGP Routes addition and deletion * brought up to date with RFC6275 * add --socket/-z option * add "ipv6 nd mtu <1-65535>" commands lib changes * filter-list handling -- does not free the filter-list before calling the delete_hook(). However, unlike commit 6a2e0f36b103386e57dbe3a6ee4716e809111198 *does* remove the filter-list from the name look-up, before calling the delete_hook() -- which I believe works better. * md5.c now includes RFC 2104 HMAC However fixed to remove compiler warning, by replacing use of caddr_t by unsigned char*. Some phantom whitespace changes elsewhere * prefix.c: commits d171bf58ef12ace43d48565e6870722dece1e6ed 051954f574b9c26458518a7029aeed118f0da620 9663386f16e6285a322747514527fdf1d19788e4 - optimise masklen2ip() and apply_mask_ipv4() -- the version here should work on a Big-Endian machine as well. - optimise ip_masklen() -- the version here should (a) work on a Big-Endian machine, (b) give the same result as before if the netmask is not, in fact, valid, and (c) uses just 256 bytes of table -- not 64K. Version here is probably not quite as fast as the previous patch... but certainly faster that what was there before. * zclient.c: introduced zclient_serv_path, for general zclient and for bgpd zlookup. Added ZEBRA_HELLO to client start. Added safi to ipv4 and ipv6 route add/delete.
| * lib: fix logging of ZEBRA_HELLO messageDenis Ovsienko2012-02-211-0/+1
| |
| * lib: add THREAD_TIMER_MSEC_ON()Everton Marques2012-02-161-0/+7
| | | | | | | | | | | | | | | | | | * lib/thread.h: new timer macro, millisecond precision (this was cherrypicked from pimd to isolate all non-contained changes) From: Everton Marques <everton.marques@gmail.com> Signed-off-by: David Lamparter <equinox@diac24.net>
| * isisd: implement MD5 circuit authenticationFritz Reichmann2012-02-142-0/+76
| | | | | | | | | | | | * Replace command "isis passwd" with "isis passwd {clear|md5}" * Verify HMAC MD5 on ISIS Hello PDUs * Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
| * bgpd: IPv6 MP-BGP Routes addition and deletionG.Balaji2012-01-232-0/+3
| | | | | | | | | | | | This patch contains the following: 1. Addition of IPv6 SAFI_MULTICAST BGP routes into the BGP Multicast RIB. 2. Deletion of IPv6 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
| * bgpd: IPv4 MP-BGP Routes addition and deletionG.Balaji2012-01-232-0/+3
| | | | | | | | | | | | This patch contains the following: 1. Addition of IPv4 SAFI_MULTICAST BGP routes into the BGP Multicast RIB. 2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
| * lib: use prefix bit length macrosDenis Ovsienko2012-01-081-7/+7
| |
| * lib/if: trivial, fix rarely used if debug function to print everythingPaul Jakma2012-01-061-6/+10
| | | | | | | | | | | | * if.c: (if_dump) loop that doesn't do anything, wants to be before the zlog of what it's meant to print out so all the connected addresses get printed out. Trival: just a debug function
| * general: remove inline qualifiers and move in-header functions to objectsPaul Jakma2012-01-064-19/+22
| | | | | | | | | | | | * (general) Move functions in headers into files, to be compiled into shared object files. Remove inline qualifier from functions. Let the compiler do the work.
| * lib: fix some strtoul() use casesUlrich Weber2012-01-021-1/+2
| | | | | | | | ...otherwise 4294967295 is not a valid value on 32bit systems
| * lib: address type-punned pointers in prefix_same()Denis Ovsienko2012-01-021-2/+2
| | | | | | | | | | | | IPV4_ADDR_SAME() wasn't passed the right union member, this could cause a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before the error could be created by macro upgrade.
| * bgpd: justify checks for IPv4 class D/EDenis Ovsienko2012-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | * lib/prefix.h * IPV4_CLASS_DE(): make consistent with counterpart macros * bgp_packet.c * bgp_open_receive(): test using macro instead of ">=" * bgp_route.c * bgp_update_rsclient(): idem * bgp_update_main(): idem
| * zebra: ZEBRA_HELLO and mopping up routes (BZ#448)Vyacheslav Trushkin2012-01-022-1/+23
| | | | | | | | | | | | | | | | ZEBRA_HELLO message is used by routing daemons to inform zebra what type of routes daemon will be announcing to zebra. Also zebra uses route_type_oaths array to track which daemon announces which protocol. Zebra mops up routes if daemon didn't for some reason.
| * lib: fix type-punning in ip_masklen()Denis Ovsienko2012-01-021-2/+7
| | | | | | | | | | ip_masklen() was likely to return incorrect results after being compiled with -fstrict-aliasing (-O2, -O3, -Os)
| * lib: optimize ip_masklen()Denis Ovsienko2012-01-021-25/+2076
| | | | | | | | | | | | | | | | | | | | | | | | | | The new implementation makes use of a 64KB mapping table, which makes it possible to compute masklen faster and with constant execution time. The map also allows for additional version of the function, which can detect errors in input argument. The previous implementation had a variable cost of execution, which depended on masklen in a non-linear manner, and at its worst (/31) was 4 times slower, than the new implementation. The only case of old function just slightly outperforming the new one is /0, which is of little practical interest.
| * Revert "lib: optimize apply_mask_ipv6()"Denis Ovsienko2012-01-011-7/+17
| | | | | | | | | | Experience with IPv4 counterpart of this function suggests, that this way of type-punning is likely to cause errors.
| * fix set never used warningsStephen Hemminger2011-12-184-24/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This patch was modified to leave calls to stream_getl() in place, they are necessary for the stream's internal pointer to advance to the correct position. -- Denis) Signed-off-by: Denis Ovsienko <infrastation@yandex.ru> Fix gcc warnings about varables that are set but never used. * bgpd/bgp_attr.c * cluster_unintern(): ret * transit_unintern(): ret * bgp_attr_default_intern(): attre * bgp_mp_reach_parse(): rd_high, rd_low * bgpd/bgp_route.c * bgp_announce_check_rsclient(): bgp * bgpd/bgp_zebra.c * zebra_read_ipv4(): ifindex * zebra_read_ipv6(): ifindex * bgpd/bgpd.c * bgp_config_write_peer(): filter * lib/distribute.c * distribute_list_all(): dist * distribute_list(): dist * distribute_list_prefix_all(): dist * distribute_list_prefix(): dist * lib/if_rmap.c * if_rmap(): if_rmap * lib/vty.c * vty_accept(): vty * lib/zclient.c * zclient_read(): ret * zebra/irdp_interface.c * if_group(): zi * zebra/rt_netlink.c * kernel_read(): ret, sock
| * lib: optimize apply_mask_ipv6()Denis Ovsienko2011-12-131-17/+7
| |
| * lib: optimize apply_mask_ipv4()Denis Ovsienko2011-12-131-18/+3
| |
| * lib: make masklen2ip6() safer and fasterDenis Ovsienko2011-12-132-17/+136
| |
| * lib: fix endianness of masklen2ip()Denis Ovsienko2011-12-131-3/+39
| |
| * lib: make masklen2ip() safer and fasterDenis Ovsienko2011-12-132-17/+40
| |
| * lib: spellingDenis Ovsienko2011-12-131-10/+10
| |
| * lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter2011-12-133-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getaddrinfo returns a list of socket parameters for listening. it will contain both IPv4 and IPv6 listening sockets. unless we use IPV6_V6ONLY on the IPv6 ones, only the socket listed first will work. if the IPv4 one came first, the IPv6 one would get an "Address in use" error. this functionality was already present for bgpd and its listening sockets. as it is needed for vtys as well, make it a common helper. Conflicts: lib/sockunion.c
| * lib: put route_types.txt to real useDavid Lamparter2011-12-136-229/+259
| | | | | | | | | | | | | | | | | | | | | | this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c. Conflicts: lib/route_types.awk
| * build: delete .cvsignore filesDenis Ovsienko2011-12-131-14/+0
| |
| * lib: clearing zclient.c for some cases of buildingVyacheslav Trushkin2011-12-131-1/+3
| | | | | | | | | | lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_* definitions extended by else clause.
| * quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin2011-12-132-14/+55
| | | | | | | | | | | | | | | | | | | | | | All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified.
| * lib: fix SMUX compiler warningsStephen Hemminger2011-12-071-4/+3
| | | | | | | | | | Make progname a string, and cast when calling asn1. Remove variable set but never used.
| * lib: fix compile warnings from set-never-usedStephen Hemminger2011-12-071-6/+0
| | | | | | | | The if_dump code had empty loop, that caused set-never-used warning.