summaryrefslogtreecommitdiffstats
path: root/bgpd
Commit message (Collapse)AuthorAgeFilesLines
* Fix problems with handling of oversize BGP messagesex24bChris Hall2012-05-0712-123/+636
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Tidy up after testing on FreeBSD 9.0Chris Hall2012-04-171-2/+10
| | | | | | | | | | | | | | | | 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-162-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-123-6/+7
| | | | | | | | | | | | | 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.
* Further work on Watch-Dog and extend "debug bgp update"Chris Hall2012-04-113-6/+76
| | | | | | | | | | | | | | | | | 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-109-59/+85
| | | | | | | | | | | | | | -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.
* Merge branch 'master' into euro_ix_bex23bChris Hall2012-03-234-701/+560
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 !
| * Merge remote-tracking branch 'quagga-gnu.org/master'Paul Jakma2012-03-052-8/+16
| |\
| | * bgpd: Open option parse errors don't NOTIFY, resulting in abort & DoSPaul Jakma2012-03-042-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_packet.c: (bgp_open_receive) Errors from bgp_open_option_parse are detected, and the code will stop processing the OPEN and return. However it does so without calling bgp_notify_send to send a NOTIFY - which means the peer FSM doesn't get stopped, and bgp_read will be called again later. Because it returns, it doesn't go through the code near the end of the function that removes the current message from the peer input streaam. Thus the next call to bgp_read will try to parse a half-parsed stream as if it were a new BGP message, leading to an assert later in the code when it tries to read stuff that isn't there. Add the required call to bgp_notify_send before returning. * bgp_open.c: (bgp_capability_as4) Be a bit stricter, check the length field corresponds to the only value it can be, which is the amount we're going to read off the stream. And make sure the capability flag gets set, so callers can know this capability was read, regardless. (peek_for_as4_capability) Let bgp_capability_as4 do the length check.
| * | bgpd: Move up flag-check calls, parcel up attr-parser args, and other cleanupsPaul Jakma2012-02-282-278/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_attr.h: (struct bgp_attr_parser_args) Attribute parsing context, containing common arguments. * bgp_attr.c: (general) Move the bgp_attr_flag_invalid flag-check calls up, out of each individual attr parser function, to be done once in attr_parse. Similarly move the calculation of the 'total' attribute length field up to attr_parse. Bundle together common arguments to attr-parsing functions and helpers into (struct bgp_attr_parser_args), so it can be passed by reference down the stack & also de-clutter the argument lists & make it easier to add/modify the context for attr-parsing - add local const aliases to avoid modifying body of code too much. This also should help avoid cut & paste errors, where calls to helpers with hard-coded attribute types are pasted to other functions but the code isn't changed. (bgp_attr_flags_diagnose) as above. (bgp_attr_flag_invalid) as above. (bgp_attr_{origin,aspath,as4_path,nexthop,med,local_pref,atomic}) as above. (bgp_attr_{aggregator,as4_aggregator,community,originator_id}) as above (bgp_attr_{cluster_list,ext_communities},bgp_mp_{un,}reach_parse) as above (bgp_attr_unknown) as above. (bgp_attr_malformed) as above. Also, startp and length have to be special-cased, because whether or not to send attribute data depends on the particular error - a separate length argument, distinct from args->length, indicates whether or not the attribute data should be sent in the NOTIFY. (bgp_attr_aspath_check) Call to bgp_attr_malformed is wrong here, there is no attribute parsing context - e.g. the 'flag' argument is unlikely to be right, remove it. Explicitly handle the error instead. (bgp_attr_munge_as4_attrs) Flag argument is pointless. As the comment notes, the check here is pointless as AS_PATH presence already checked elsewhere. (bgp_attr_parse) Do bgp_attr_flag_invalid call here. Use (struct bgp_attr_parser_args) for args to attr parser functions. Remove out-of-context 'flag' argument to as4 checking functions.
| * | bgpd: consolidate attribute flag checksPaul Jakma2012-02-281-88/+133
| |/ | | | | | | | | | | | | | | | | | | | | * bgpd/bgp_attr.c: (attr_flags_values []) array of required flags for attributes, EXTLEN & PARTIAL masked off as "dont care" as appropriate. (bgp_attr_flag_invalid) check if flags may be invalid, according to the above table & RFC rules. (bgp_attr_*) Use bgp_attr_flag_invalid. (bgp_attr_as4_aggregator) ditto, also take startp argument for the NOTIFY data. (bgp_attr_parse) pass startp to bgp_attr_as4_aggregator
* | Merge commit 'quagga_0_99_20_1_release' into euro_ix_bex22bChris Hall2012-03-221-4/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v0.99.20ex22b Conflicts: bgpd/bgp_open.c bgpd/bgp_packet.c The bpp_open.c code has been replaced by code in bgp_open_state.c, so these changes have no effect on the euro_ix branch, which already rejects invalid OPEN with a NOTIFY. Otherwise: modified: ospfd/ospf_dump.c modified: ospfd/ospf_dump.h modified: ospfd/ospf_lsa.h modified: ospfd/ospf_packet.c modified: ospfd/ospf_packet.h
| * | bgpd: Open option parse errors don't NOTIFY, resulting in abort & DoSPaul Jakma2012-03-082-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_packet.c: (bgp_open_receive) Errors from bgp_open_option_parse are detected, and the code will stop processing the OPEN and return. However it does so without calling bgp_notify_send to send a NOTIFY - which means the peer FSM doesn't get stopped, and bgp_read will be called again later. Because it returns, it doesn't go through the code near the end of the function that removes the current message from the peer input streaam. Thus the next call to bgp_read will try to parse a half-parsed stream as if it were a new BGP message, leading to an assert later in the code when it tries to read stuff that isn't there. Add the required call to bgp_notify_send before returning. * bgp_open.c: (bgp_capability_as4) Be a bit stricter, check the length field corresponds to the only value it can be, which is the amount we're going to read off the stream. And make sure the capability flag gets set, so callers can know this capability was read, regardless. (peek_for_as4_capability) Let bgp_capability_as4 do the length check.
* | | Tidy up some XMALLOC items that were not being XFREE'd.Chris Hall2012-03-223-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | | Merge Quagga master branch -- as of 1-Mar-2012 -- into euro_ix_bex21bChris Hall2012-03-1745-1228/+2138
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | bgpd: Addition of ipv6 network command in Multicast address family mode.G.Balaji2012-01-231-2/+5
| | | | | | | | | | | | | | | The patch adds the ipv6 network command in the BGP multicast address family mode.
| * | bgpd: IPv6 MP-BGP Routes addition and deletionG.Balaji2012-01-231-0/+2
| | | | | | | | | | | | | | | | | | 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-233-12/+14
| | | | | | | | | | | | | | | | | | 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.
| * | bgpd: reinstate zlookup checks, required for BGP without zebraPaul Jakma2012-01-091-3/+23
| | | | | | | | | | | | | | | | | | * bgp_nexthop.c: The nexthop lookup cache has to return success for queried nexthops if bgpd isn't connected to zebra, or else BGP without zebra doesn't work.
| * | bgpd: Fix incorrect attribute type code in call to bgp_attr_malformedPaul Jakma2012-01-081-2/+2
| | |
| * | bgpd: Improve flag error messages in bgp_attr_aspathPaul Jakma2012-01-081-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | * bgpd/bgp_attr.c: (bgp_attr_aspath) error message could be misleading, clearly log what flag was incorrect. (Problem noted in "bgpd: fix error message in bgp_attr_aspath()" in Quagga-RE)
| * | bgpd: rewrite attr flag error loggingDenis Ovsienko2012-01-081-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_attr.c * attr_flag_str: new message list * bgp_attr_flags_diagnose(): new function, implements previously added error logging in a generic way * bgp_attr_origin(): use bgp_attr_flags_diagnose() * bgp_attr_nexthop(): ditto * bgp_attr_med(): ditto * bgp_attr_local_pref(): ditto * bgp_attr_atomic(): ditto * bgp_attr_originator_id(): ditto * bgp_attr_cluster_list(): ditto * bgp_mp_reach_parse(): ditto * bgp_mp_unreach_parse(): ditto
| * | bgpd: improve "show ip bgp scan detail"Denis Ovsienko2012-01-081-2/+22
| | | | | | | | | | | | | | | * bgp_nexthop.c (show_ip_bgp_scan_tables): access proper structure field in AF_INET6 case, handle ifindex NH type properly
| * | bgpd: dismiss some zlookup checksDenis Ovsienko2012-01-081-32/+6
| | | | | | | | | | | | | | | | | | | | | bgp_nexthop_onlink(): zlookup is not used here at all bgp_nexthop_lookup_ipv6(): rely on the detection performed by "query" function (this also changes the fallback value to 0), reorder if-block bgp_nexthop_lookup(): idem
| * | bgpd: add "show ip bgp scan detail" commandDenis Ovsienko2012-01-081-15/+44
| | | | | | | | | | | | | | | | | | * bgp_nexthop.c: (show_ip_bgp_scan) transform into show_ip_bgp_scan_tables(), which uses inet_ntop() and can dump nexthops on request; (show_ip_bgp_scan_detail_cmd) new function
| * | bgpd: touch nexthop handling codeDenis Ovsienko2012-01-083-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | bgp_nexthop_lookup_ipv6(): declare variables where they are actually used, drop no-op initialization (the field is already 0) bgp_nexthop_lookup(): ditto bgp_nexthop_check_ebgp(): rename to bgp_nexthop_onlink() bgp_nexthop_cache_changed(): rename to bgp_nexthop_cache_different()
| * | general: remove inline qualifiers and move in-header functions to objectsPaul Jakma2012-01-062-5/+5
| | | | | | | | | | | | | | | | | | * (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-022-8/+20
| | | | | | | | | | | | ...otherwise 4294967295 is not a valid value on 32bit systems
| * | bgpd: justify checks for IPv4 class D/EDenis Ovsienko2012-01-022-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | fix set never used warningsStephen Hemminger2011-12-184-26/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
| * | bgpd: fix regression in ORF procesing (BZ#688)Denis Ovsienko2011-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This issue has been pointed out by Lou Berger and Tim Browski. * bgp_packet.c * bgp_route_refresh_receive(): restore if() condition, which was broken by commit fdbc8e77c88f751924299d0bc752371d5cc31116
| * | lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter2011-12-131-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-193/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15/+0
| | |
| * | quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin2011-12-132-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | bgpd: implement 'match probability' in route-mapsVyacheslav Trushkin2011-12-131-1/+105
| | | | | | | | | | | | | | | New clause 'match probability <percentage value>' was added in route-maps (bgpd/bgp_routemap.c modified).
| * | bgp: use VTY_GET_INTEGER_RANGE() in bgp_clear()Ulrich Weber2011-12-131-9/+1
| | | | | | | | | | | | | | | | | | Second patch replaces "VTY_GET_LONG ("AS", as_ul, arg);" by "VTY_GET_INTEGER_RANGE ("AS", as, arg, 1, BGP_AS4_MAX);" as done in all other code, which parses AS numbers.
| * | bgpd: cleanup privs on terminationStephen Hemminger2011-12-071-0/+1
| | | | | | | | | | | | | | | When doing valgrind testing, the privledges from zprivs_init() need to be cleaned up on exit.
| * | bgpd: store nexthop info for redistributed IPV6 routesStephen Hemminger2011-12-063-12/+31
| | | | | | | | | | | | | | | | | | | | | BGP was ignoring nexthop info for static and other redistributed routes for IPv6. Build extra attribute info to store the nexthop. See also: https://bugzilla.vyatta.com/show_bug.cgi?id=6073
| * | bgpd: fix memory leak for extra attributesOleg A. Arkhangelsky2011-12-031-0/+1
| | | | | | | | | | | | this fixes commit b881c7074bb698aeb1b099175b325734fc6e44d2
| * | bgpd: remove unused function bgp_bind_addressDavid Lamparter2011-11-211-26/+0
| | | | | | | | | | | | bgp_bind_address is replaced with sockunion_bind.
| * | bgpd: fix update-source for IPv6 (BZ#548)David Lamparter2011-11-211-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | if update-source was given as interface name, bgpd was unconditionally trying to bind to an IPv4 address from that interface. change function to find the best-matching (number of address bits) same-family address on the interface.
| * | bgpd: fix "nexthop-local unchanged" (BZ#350)Dylan Hall2011-11-151-0/+5
| | |
| * | bgpd: justify capabilities for TOS settingChris Luke2011-11-152-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To set the TOS bits on TCP connections, platforms that restrict capabilities need the priv level to be raised before the sockopt is set, and this requires the ZCAP_NET_ADMIN priv. * bgp_main.c: update _caps_p to include ZCAP_NET_ADMIN * bgp_network.c * bgp_connect(): request ZPRIVS_RAISE/ZPRIVS_LOWER * bgp_listener(): request ZPRIVS_RAISE earlier
| * | bgpd: revised fix to --dryrun (BZ#622)Sergey Y. Afonin2011-11-151-3/+4
| | |
| * | bgpd: fix 2 more cases of length error reportingDenis Ovsienko2011-10-261-2/+2
| | | | | | | | | | | | | | | * bgp_attr.c (bgp_attr_originator_id, bgp_attr_cluster_list): provide required arguments to bgp_attr_malformed()
| * | bgpd: check AGGREGATOR attr flags (BZ#678)Denis Ovsienko2011-10-221-0/+17
| | | | | | | | | | | | | | | * bgp_attr.c * bgp_attr_aggregator(): check Optional/Transitive flag bits
| * | bgpd: fix more regressions in attr flag checksDenis Ovsienko2011-10-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 05a4936b713b9882171d0f7fb20b8439df23939e fixed some of the attributes involved, but not all. This commit should do it. * bgp_attr.c * bgp_attr_originator_id() * bgp_attr_cluster_list() * bgp_mp_reach_parse() * bgp_mp_unreach_parse()
| * | bgpd: use bgp_attr_malformed()Denis Ovsienko2011-10-181-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the recent attribute flags/length checks copied from QRE use bgp_notify_send_with_data() directly, but master branch assumes using bgp_attr_malformed(). * bgp_attr.c * bgp_attr_med() * bgp_attr_local_pref() * bgp_attr_atomic() * bgp_attr_originator_id() * bgp_attr_cluster_list() * bgp_mp_reach_parse() * bgp_mp_unreach_parse()
| * | bgpd: add flag checks for MP_(UN)REACH_NLRIDenis Ovsienko2011-10-172-9/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_attr.[ch] * bgp_mp_reach_parse(): add extra arguments and a uniform flag check block * bgp_mp_unreach_parse(): idem * bgp_attr_parse(): provide extra arguments * bgp_mp_attr_test.c * parse_test(): justify respective calls