summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | Fix broken prefix-list handling in bgpdChris Hall2012-02-296-803/+891
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes to symtab.c had broken the symbol reference handling for prefix-lists in plist.c This commit further "improves" the symbol table functions, to support current use rather better. One key change is that the symbol table supports the notion of a symbol which is "set", so has some value other than its name. In the case of prefix-lists, a prefix-list is "set" when there is at least one (valid) entry or a description has been set. Changes include: * small changes in bgpd/bgp_clist.c where symbol table function names have changed and other small differences. * similarly in bgpd/bgp_peer_index.c, but here also clarified ownership of the peer index entries, and ensured that the symbol table stuff does *not* free same. * in bgpd/bgp_route.c fixed the handling of references to prefix-lists. Newer symbol handling more clearly identifies when a symbol has some value "set". * in bgpd/bgp_vty.c similarly, when showing state of filtering the "*" against a prefix-list means it is "set". * in lib/plist.c -- adjust to newer symbol table stuff. Fix issues will add_hook and delete_hook. Changed lookup so that if plist is not set, then lookup will return not-found -- so works as before (!). * adjusted test for symbol stuff.
* | Reverse erroneous part of previous fix for bug in zclient.Chris Hall2012-02-271-2/+0
| | | | | | | | Fix was in two parts. One part, correct. Second part, not.
* | Reviewed and improved vty and (particularly) vtysh.Chris Hall2012-02-2623-1014/+1368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix stream_put() to accept NULL src (again). * changed how vty terminal reports time-out and end-of-file, and made --more-- show the same as ordinary cli. * tighten on or two stream functions, to cope if for some reason the getp > endp or endp > size. * update documentation in vio_lines.c * fixed (potential) bug which would have tripped up --more-- if were to be required while outputting notification for a cancel operation. * as a new command loop is set up, make sure all start in vst_cmd_running_executing, so that output will be dispatched. * fix uty_std_out_push() and uty_vtysh_out_push to take notice of vst_cmd_running and vst_cmd_executing and change to vst_cmd_complete as required. * fix handling of hold_mark in VOUT_TERM obuf an line control. * fix various state related issues for vtysh server and the vtysh itself. * when vtysh connects to a daemon, the daemon responds with its name and version number. TBD: the vtysh to check that version is as expected ! * clarified handling of errors in vtysh... distinguishing errors reported by the client daemon, and errors in the mechanics of talking to the client daemon. ~
* | Fix bug in stream_put_ipv4()Chris Hall2012-02-245-425/+331
| | | | | | | | | | | | | | | | Revised stream functions and built more throrough test program for same. Introduced functions in prefix.c to support both stream_put_prefix() and stream_get_prefix() -- ensuring that does not exceed possible sizes and does not output or input any bits beyond the prefix length.
* | Fix zprivs_init for when have capabilities and *not* --dryrun.Chris Hall2012-02-231-2/+4
| |
* | Fix: "--more--" and "no ip prefix-list fred"Chris Hall2012-02-223-63/+139
| | | | | | | | | | | | | | | | | | | | Also, fix compilation of privs.c when HAVE_CAPABILITIES. Wiping of "--more--" was issuing twice as many BS as required. (Oddly, some telnet programs tollerated this !) "no ip prefix-list fred" could hit a SEGV if there are no references to the prefix-list.
* | Do not install "end" command in nodes where it has no effect.Chris Hall2012-02-223-30/+63
| | | | | | | | | | | | | | | | In particular, do not install in VIEW_NODE, where it prevents "en" being a short form of "enable". Also: change privilege handling so that can run bgpd --dryrun without needing to be a privileged user.
* | Fix reading encrypted password from config and "pthreads on" commandChris Hall2012-02-2115-732/+712
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also: * re-organise vty output such that never blocks while executing a command -- but does wait/block between commands, so that all output associated with a command has completed before starts to execute the next. * make raising exception always signal the command loop, and revise code so that (a) signal is clearly secondary, and (b) that actual signal value no longer really matters. * fix timeout handling for pipe returns when only the pipe return and the pipe stderr return are left. * simplify the handling of blocking for pipes.
* | Fix failure to build under --disable-rtadvChris Hall2012-02-211-0/+2
| |
* | vtysh partly restored. bgpd not crashing on over-size messages.Chris Hall2012-02-19115-14336/+25739
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: this is a partial interim version -- NOT for production. Reinstate vtysh. In bgpd: cope better with generating oversize messages. The "pipework" branch is no more. There is now "euro_ix" and "euro_ix_b", where 'b' stands for 'bleedin'. The "pipework" is currently in 'bleedin'. Version updated to: 0.99.18ex20b Major changes in this commit: * modified bgpd to avoid crashing if an oversize message is created. At present, any oversize messages are simply discarded. This may be a mistake... since it is possible that some routes that should have been withdrawn are not. TBA. The stream lib facilities have been overhauled to may this easier. * restoring vtysh. At present the vtysh is thought to work, except that it does not currently create integrated configuration files. For the time being, *only* the following compile: lib, bgpd, zebra, vtysh, tests All other daemons will fail to compile, and must be disabled.
* | Merge branch 'pipework' of /git/quagga.euro-ix into euro_ix_bChris Hall2011-09-0811-483/+617
|\ \
| * | Further simplification of CLI state handling.Chris Hall2011-09-0811-483/+617
| | | | | | | | | | | | Covering corner cases and reducing ambiguity.
* | | Fix formatting of memory region "show" when no memory_trackerChris Hall2011-09-081-9/+12
| | |
* | | Merge branch 'pipework' of /git/quagga.euro-ix into euro_ix_bex19bChris Hall2011-09-0612-777/+904
|\| | | | | | | | | | | Updated version to v0.99.18ex19b.
| * | Further improvements to "pipework".ex19pChris Hall2011-09-0612-777/+904
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Version advanced to 0.99.18ex19p. Fixed occasional failure to immediately display prompt after previous command output was abandonned by ^C, particularly with "--more--". Completely removed the "~" temporary prompt, and simplified some logic. Added indication of pthread running to "show version".
* | | Update the scaled number output and memory show commands.Chris Hall2011-09-068-1052/+609
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions to output scaled decimal and binary numbers were implemented for memory show commands. Those have been generalised and placed in the qfstring.c. The memory show commands have been updated to use the newer functions, and a small test program for those has been implemeted. Other small updates to qfstring.c, qstring.c and qpath.c.
* | | Merge branch 'pipework' of /git/quagga.euro-ix into euro_ix_bChris Hall2011-09-055-69/+101
|\| |
| * | Improve scheduling of background tasks in qnexus.Chris Hall2011-09-051-55/+76
| | |
| * | Work around issues with IPV6_MINHOPCOUNT -- -DNO_LINUX_IN6_HChris Hall2011-09-051-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | On GNU_LINUX IPV6_MINHOPCOUNT is defined in linux/in6.h. Unfortunately, that will not always compile due to clashes with netinet/in.h !! So, as a work-around -DNO_LINUX_IN6_H disables the inclusion of linux/in6.h -- which avoids the compilation issue, but turns off IPV6_MINHOPCOUNT.
| * | Fix absolute paths in bgp dump configuration commands.Chris Hall2011-09-051-8/+8
| | |
* | | Merge branch 'pipework' of /git/quagga.euro-ix into euro_ix_bChris Hall2011-09-0526-210/+1049
|\| |
| * | Fix display of times for "show nexus xxx"Chris Hall2011-09-021-20/+22
| | |
| * | Changed gcc options to -std=c99 and -O2, and tighted warnings.Chris Hall2011-09-027-19/+19
| | | | | | | | | | | | Some small changes to accomodate same.
| * | Merging of euro_ix branch into pipework.Chris Hall2011-09-0217-188/+1025
| | | | | | | | | | | | | | | | | | | | | | | | Bring in fixes for bgp dumping with pthreaded BGP Engine. Bring in new "show nexus xxx" command. Fix removal of '~' prompt.
| * | Fix qassert()Chris Hall2011-09-011-1/+1
| | |
| * | Merge branch 'euro_ix' of /git/quagga.euro-ix into pipeworkChris Hall2011-08-261-2/+2
| |\ \
| | * | Fix compilation of sockopt.c when no IP_MINTTL or IPV6_MINHOPCOUNT (II)Chris Hall2011-08-261-1/+1
| | | |
| | * | Fix compilation of sockopt.c when no IP_MINTTL or IPV6_MINHOPCOUNT.Chris Hall2011-08-261-2/+4
| | | |
| * | | Fix compilation of sockopt.c when no IP_MINTTL or IPV6_MINHOPCOUNT.Chris Hall2011-08-261-2/+4
| | | |
* | | | Fix compilation of sockopt.c when no IP_MINTTL or IPV6_MINHOPCOUNT.Chris Hall2011-08-261-2/+4
| | | |
* | | | Updated the "symbol table" and added AVL treeChris Hall2011-08-2610-974/+3193
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modified the symbol table so that the name of the symbol is now a property of its value -- which simplifies some of the semantics, because the name no longer has a separate existence (a name which refers to an empty or undefined value is now a matter for the value, not for the symbol table). It also allows for the symbol table to be used where the value and the name are almost indistinguishable. Introduced AVL tree to support large prefix lists, routemaps, etc. etc. Updated testsymtab and added testavl. Updated exiting use of the symbol table.
* | | Merge branch 'euro_ix' of /git/quagga.euro-ix into pipeworkex18pChris Hall2011-08-1212-645/+1349
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge with euro_ix branch v0.99.18ex17. Update version to: 0.99.18ex18p Of particular note: * includes support for GTSM: neighbor ... ttl-security hops X no neighbor ... ttl-security hops X where X is 1-254. For usual case of immediately connected peer, X == 1. Cannot set ttl-security while ebgp-multihop is set, and vice-versa. If underlying O/S does not support GTSM, then will set ttl as per ebgp-multihop. In passing, have fixed various bugs in the main Quagga branch. * initial support for draft-ietf-idr-optional-transitive Does not yet support "neighbor-complete" flag. * main Quagga now uses TCP_CORK and permanent non-blocking Do not beleive TCP_CORK to be necessary for euro_ix code... which has a different buffering strategy. The euro_ix code already runs sockets permanently non-blocking. * various fixes to attribute intern/unintern Trying to remove memory leaks. Nobody seems convinced that this has been perfected, yet. * fixes for ospfd and ospf6d issues. Up to date with master branch up to: commit 538cb284864c17de66152a5236db4cd80e3e7639 Merge: 036a6e6 8ced4e8 Author: Paul Jakma <paul@quagga.net> Date: Fri Jul 29 18:21:50 2011 +0100
| * | Merge with main Quagga source as of 29-Jul-2011.ex17Chris Hall2011-08-1211-634/+1291
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create euro_ix branch. Update version to: 0.99.18ex17 Of particular note: * includes support for GTSM: neighbor ... ttl-security hops X no neighbor ... ttl-security hops X where X is 1-254. For usual case of immediately connected peer, X == 1. Cannot set ttl-security while ebgp-multihop is set, and vice-versa. If underlying O/S does not support GTSM, then will set ttl as per ebgp-multihop. In passing, have fixed various bugs in the main Quagga branch. * initial support for draft-ietf-idr-optional-transitive Does not yet support "neighbor-complete" flag. * main Quagga now uses TCP_CORK and permanent non-blocking Do not beleive TCP_CORK to be necessary for euro_ix code... which has a different buffering strategy. The euro_ix code already runs sockets permanently non-blocking. * various fixes to attribute intern/unintern Trying to remove memory leaks. Nobody seems convinced that this has been perfected, yet. * fixes for ospfd and ospf6d issues. Up to date with master branch up to: commit 538cb284864c17de66152a5236db4cd80e3e7639 Merge: 036a6e6 8ced4e8 Author: Paul Jakma <paul@quagga.net> Date: Fri Jul 29 18:21:50 2011 +0100
| | * lib: Add support for IPv6 ttl securityStephen Hemminger2011-03-241-11/+19
| | | | | | | | | | | | | | | * sockunion.c: (sockopt_minttl) Add IPv6 support for min hop count. The kernel support is Linux kernel 2.6.35 or later.
| | * bgpd: Cleanups & fixes for minttl / GTSMStephen Hemminger2011-03-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | * bgp_vty.c: (peer_ebgp_multihop_{un,}set_vty) tail-call cleanup. ({no_,}neighbor_ttl_security) ditto. * bgpd.c: (peer_ttl_security_hops_set) Peer group checks and TTL set only need to be done on transition. * sockunion.c: (sockopt_minttl) remove always-on debug and improve readability.
| | * bgpd: RFC 5082 Generalized TTL Security Mechanism supportNick Hilliard2011-03-232-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgpd: Add support for RFC 5082 GTSM, which allows the TTL field to be used to verify that incoming packets have been sent from neighbours no more than X IP hops away. In other words, this allows packets that were sent from further away (i.e. not by the neighbour with known distance, and so possibly a miscreant) to be filtered out. * lib/sockunion.{c,h}: (sockopt_minttl) new function, to set a minimum TTL using the IP_MINTTL socket opt. * bgpd.h: (BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK) define for command error for minttl. (struct peer) add a config variable, to store the configured minttl. (peer_ttl_security_hops_{set,unset}) configuration handlers * bgpd.c: (peer_group_get) init gtsm_hops (peer_ebgp_multihop_{un,}set) check for conflicts with GTSM. Multihop and GTSM can't both be active for a peer at the same time. (peer_ttl_security_hops_set) set minttl, taking care to avoid conflicts with ebgp_multihop. (bgp_config_write_peer) write out minttl as "neighbor .. ttl-security hops X". * bgp_vty.c: (bgp_vty_return) message for BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK (peer_ebgp_multihop_{un,}set_vty) * bgp_network.c: (bgp_accept) set minttl on accepted sockets if appropriate. (bgp_connect) ditto for outbound.
| | * lib: fix more format warnings (#637)Christian Hammers2011-03-232-2/+2
| | | | | | | | | | | | | | | | | | | | | The following patch was also neccessary to compile. * command.c: (config_logmsg_cmd) use "%s" format spec * if.c: (connected_log) ditto
| | * lib: add TCP_CORK wrapperStephen Hemminger2011-03-212-0/+11
| | | | | | | | | | | | | | | * sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for those platforms that provide it. For other platforms, it is just a nop.
| | * lib: zlog should clean up its memoryTom Goff2011-03-211-0/+3
| | | | | | | | | | | | | | | * log.c: (closezlog) Also free the dynamically allocated filename when a log is closed.
| | * lib: Add a function to delete all interfacesTom Goff2011-03-212-0/+19
| | | | | | | | | | | | | | | if.c: (if_terminate) This adds a cleanup function that can be called when a daemon exits, similar to vty_terminate().
| | * lib: Better hashing of string values using Bernstein hashStephen Hemminger2011-03-214-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | * hash.{h,c}: (string_hash_make) Hash optimised for strings, current implementation using Bernstein hash, which offers a good compromise between distribution and performance. * distribute.c: (distribute_hash_make) use previous instead of additive string hash. * if_rmap.c: (if_rmap_hash_make) ditto
| | * bgpd: fix bgp_node locking issuesChris Caputo2011-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgpd: Connected table locks were being locked but not unlocked, such that eventually a lock would exceed 2^31 and become negative, thus triggering an assert later on. * bgp_main.c: (bgp_exit) delete connected elements along with ifp's. * bgp_nexthop.c: (bgp_nexthop_lookup{,_ipv6}) add missing unlocks (bgp_multiaccess_check_v4) ditto (bgp_connected_{add,delete}) Use a distinct memtype for bgp_connected_ref. (bgp_scan_finish) reset the nexthop cache to clean it up when bgpd exits * bgp_route.c: fix missing bgp_node unlocks * lib/memtype.c: (memory_list_bgp) add MTYPE_BGP_CONN * testing: has been tested for almost 2 months now.
| | * lib: Fix accounting of memoryChris Hall2011-03-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | * lib/memory.c: (zrealloc) If is called with NULL pointer then it should increment allocations because it behaves the same as zmalloc. (zfree) is called with NULL pointer, it does nothing therefore allocation count should not change.
| | * lib: Fix bug in prefix trie lookupPaul Jakma2010-12-081-6/+8
| | | | | | | | | | | | | | | | | | | | | * lib/table.c: (route_node_match) fix overshoot that was causing this function to go 1 bit too far and thus reading past end of prefix. (route_node_lookup) be defensive - don't assume others will clean up leaves when removing info.
| | * lib: prefix.c nano-optimisationPaul Jakma2010-12-081-4/+5
| | | | | | | | | | | | | | | * lib/prefix.c: (prefix_match) nano-optimisation, let it return early without copying pointers.
| | * lib: Make workqueue more conservative about ramping upPaul Jakma2010-12-081-8/+9
| | | | | | | | | | | | | | | | | | * workqueue.c: (work_queue_run) Err more on the side of keeping granularity down, by being more conservative about increasing it. Also, fix mispelling.
| | * lib: Add a command to clear the thread CPU history dataPaul Jakma2010-12-083-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (general) this can be useful when investigating thread latency problems, when you don't want to have to restart a daemon between tests. * thread.c: (cpu_record_(hash_)clear) wipe the stored thread cpu history data, according to the filter, similar to the vty print code. (clear_thread_cpu_cmd) new command to clear data. * thread.h: export new command * command.c: install it
| | * lib: Thread scheduler should be fair and not let events starve I/O and timersPaul Jakma2010-12-081-16/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * thread.c: (thread_fetch) the current scheduler will service events indefinitely, ignoring I/O and timers, so long as there are events. In other words, events can crowd out I/O and timers. In theory this shouldn't be a huge problem as events are generated only by timers and I/O, however in practice it means normal-load behaviour is not as useful a predictor of high-load behaviour as it should be. Fix this by considering all the kinds of threads, in every run of the scheduler. For any given run, we prioritise events, however across runs the scheduler should be fair. This has been observed to give more stable inter-packet times in testing of ospfd (i.e. lower std-dev). (thread_process) new heler to queue all the given threads onto the ready list
| | * lib: thread history funcname shouldn't be constant, it's freedPaul Jakma2010-12-082-2/+2
| | | | | | | | | | | | | | | | | | | | | * thread.h: (struct cpu_thread_history.funcname) malloc gets called on this so it should not be const * thread.c: (cpu_record_print) cast the (const char *) to (char *), this function knows what it's doing (free wont be called on it).
| | * zclient: fix router-id calculation for IPv6 (#595)Dmitry Tejblum2010-10-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If router-id is not specified in ospf6d.conf, ospf6d will get it from the zebra daemon. But ospf6d originates Link LSAs before the router-id is returned by zebra, thus this router's Link LSAs will be flooded with AdvRouter set to 0. * zclient.c: zclient_start(): send ZEBRA_INTERFACE_ADD message after ZEBRA_ROUTER_ID_ADD, not before