summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | bgpd: VTY string fixes for debug commandsDavid Ward2011-07-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | * bgpd/bgp_debug.c: fix VTY strings for BGP debug commands to match correct syntax (cherry picked from commit 6e22b9017e1ae2ce61c383b1b2b63973207704ac)
| | * | bgpd: fix handling of "Unsupported Capability"Dmitrij Tejblum2011-07-041-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bgp_packet.c: (bgp_notify_receive) justify the difference between BGP_NOTIFY_OPEN_UNSUP_PARAM and BGP_NOTIFY_OPEN_UNSUP_CAPBL cases, as it is explained in RFC5492, page 3, paragraph 1. "Unsupported Capability" error does not mean, that the peer doesn't support capabilities advertisement -- quite the opposite (if the peer would not support capabilities advertisement, the code would be "Unsupported Optional Parameter"). Thus there is no reason to mark the peer as one non-supporting capabilities advertisement. Example: suppose the peer is in fact IPv6-only, but we didn't configure anything address-family specific for it. Then, the peer would refuse the session with "Unsupported Capability" code. If we internally set the peer as non-supporting capabilities advertisement after that, we will not be able to establish the session with it ever, even with a fixed configuration -- IPv6-only BGP session cannot be established without capabilities. In practice an edge case would be seen as the same IPv6 peer working with its "neighbor" block read from bgpd.conf, but not working, when slowly input in "conf t" mode. (cherry picked from commit c7aa8abd8788c3607ad0131f02e892cf92221e40)
| | * | ospf6d: fix crash in SPF calculationDmitrij Tejblum2011-07-041-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf6_spf.c: Don't replace a node with another node with a lower number of hops, instead get them from the queue in the correct order. (Actually, the replacement crashed the ospf6d daemon rather than worked.) (cherry picked from commit 403138e189c24f6867824c4eeb668d11564e1ca0)
| | * | bgpd: fix community-list error message spellingDenis Ovsienko2011-07-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * bgp_vty.c: (community_list_perror, show_ip_community_list_arg, show_ip_extcommunity_list_arg) fix spelling (cherry picked from commit b729294c8c5c6f2af8ddf6cfbea2374b6faabe9d)
| * | | 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)
| * | | lib: use prefix bit length macrosDenis Ovsienko2012-01-081-7/+7
| | | |
| * | | ospfd: use IS_LSA_SELF() where appropriateDenis Ovsienko2012-01-081-6/+7
| | | |
| * | | 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
| * | | doc: "[no] router zebra" does not belong to ospfdDenis Ovsienko2012-01-081-4/+0
| | | |
| * | | ospfd: justify ospf_default_originate_timer()Denis Ovsienko2012-01-082-2/+1
| | | | | | | | | | | | | | | | | | | | The function is implemented in ospf_lsa.c, move its "extern" declaration to ospf_lsa.h for consistency.
| * | | ospfd: address more trivial compiler warningsDenis Ovsienko2012-01-081-1/+0
| | | | | | | | | | | | | | | | | | | | * ospf_ase.c * ospf_ase_complete_direct_routes(): dismiss unused variable
| * | | ospf6d: ospf6_lsa_cmd_init() does not existDenis Ovsienko2012-01-081-1/+0
| | | |
| * | | 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()
| * | | 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-069-28/+31
| | | | | | | | | | | | | | | | | | | | | | | | * (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.
| * | | doc: update BGP RFC referencesDenis Ovsienko2012-01-021-16/+14
| | | |
| * | | zebra: fix IPv6 RA wrt interface removal (BZ#480)Denis Ovsienko2012-01-021-1/+1
| | | |
| * | | zebra: fix ifindex test condition (BZ#487)Matthias Ferdinand2012-01-021-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the same ip address is used on several interfaces, and one of them gets deleted (or equivalent: set to down and then address removed), rib_delete_ipv[46] will also remove the connected route from other interfaces. rib_delete_ipv[46] is called twice when an interface is deleted: - for the "ifdown" event - for the address removal (note: this may be specific to the netlink interface of linux) The second call does not find the connected route to that same ifindex anymore, but deletes similar connected routes to any other ifindex instead. Reason: the ifindex check is on the same level as the check for ZEBRA_ROUTE_CONNECT/NEXTHOP_TYPE_IFINDEX. If everything matches except for the ifindex, the "else" part (intended for different route types) is executed, thus removing the route from the wrong interface. fix: move ifindex check inside the "then" part of the check for ZEBRA_ROUTE_CONNECT/NEXTHOP_TYPE_IFINDEX. Now connected routes to other ifindexes will not spill over to the "else" part for different route types anymore.
| * | | ospf6d: fix compiler warning messagesVyacheslav Trushkin2012-01-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix disagreement with C99 in zlog_debug calls Format specifier in some zlog_debug calls for size_t values was changed in order to C99 ('%u' -> '%zu'). * fix -Wsign-compare warnings Type of return value of ospf6_packet_max() was changed.
| * | | lib: fix some strtoul() use casesUlrich Weber2012-01-024-10/+26
| | | | | | | | | | | | | | | | ...otherwise 4294967295 is not a valid value on 32bit systems
| * | | ospf6d: add verifying user's privilegesVyacheslav Trushkin2012-01-021-0/+7
| | | |
| * | | ospfd: fix bug in NSSA ABR status checkDenis Ovsienko2012-01-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf_abr.c * ospf_abr_nssa_am_elected(): feed "best" instead of "address of best" into IPV4_ADDR_CMP(), because "best" is a pointer; also, mean s_addr field of the structures to get better typed pointers
| * | | 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-023-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | ospfd: fix packet reception for FreeBSD 10.Dmitrij Tejblum2012-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf_packet.c (ospf_recv_packet): FreeBSD, starting from version 10, will not subtract the IP header size from ip_len. This is the patch from FreeBSD's ports/net/quagga/files/patch-ospfd__ospf_packet.c, by Boris Kovalenko.
| * | | zebra: ZEBRA_HELLO and mopping up routes (BZ#448)Vyacheslav Trushkin2012-01-025-2/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | ospfd: more info in LSA checksum warning (BZ#685)Jaroslav Fojtik2011-12-211-2/+7
| | | |
| * | | fix set never used warningsStephen Hemminger2011-12-1810-58/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
| * | | ospf6d: always remove the result of a previous SPF calculationTom Goff2011-12-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to avoid stale routes in some cases; the regression was introduced by commit 1d19234e79c77a7d55194b513f2a77c6a691bc2c. * ospf6_spf.c: (ospf6_spf_calculation) Call ospf6_spf_table_finish() before possibly returning if no router-LSA is found for the root of the SPF tree.
| * | | 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: 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
| | | |
| * | | ospf6d: decode message type with LOOKUP()Denis Ovsienko2011-12-132-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf6_message.h * OSPF6_MESSAGE_TYPE_CANONICAL(): dismiss * OSPF6_MESSAGE_TYPE_NAME(): dismiss * ospf6_message.c * ospf6_message_type_str: rewrite as a message list, add max value * ospf6_packet_examin(): update to use LOOKUP() * ospf6_receive(): idem * ospf6_send(): idem
| * | | ospf6d: make some old sizing checks assertionsDenis Ovsienko2011-12-131-90/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As long as ospf6_packet_examin() is now the single checkpoint for received packets, most of the old checks performed elsewhere can be converted into assert() constructs. Malformed input data at respective points can be attributed solely to a programming error, not a malformed packet. * ospf6_message.c * ospf6_hello_print() * ospf6_dbdesc_print() * ospf6_lsreq_print() * ospf6_lsupdate_print() * ospf6_lsack_print() * ospf6_hello_recv() * ospf6_dbdesc_recv_master() * ospf6_dbdesc_recv_slave() * ospf6_lsreq_recv() * ospf6_lsupdate_recv() * ospf6_lsupdate_recv() * ospf6_lsack_recv() * ospf6_receive()
| * | | lib: spellingDenis Ovsienko2011-12-131-10/+10
| | | |
| * | | lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter2011-12-134-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1310-570/+387
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | zebra: fix redistribution of new protocolsDavid Lamparter2011-12-131-34/+12
| | | | | | | | | | | | | | | | | | | | redistribute is currently limited to "known" protocols. there is no reason for this limitation, so, remove it.
| * | | rib: default distance value for new protocols (v2)David Lamparter2011-12-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding protocols and forgetting to update zebra_rib.c currently causes a beyond end of array access for the default distance value. fix by making 150 the default distance for unknown routing protocols. 150 is higher than all other IGPs but lower than iBGP (200)
| * | | build: fixup autoconf for cross-compiling (to OpenWRT)David Lamparter2011-12-131-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MALLOC/REALLOC aren't used properly (no rpl_malloc), remove them while at it, infer some sane ipforwarding method from the OS value. (v2 on that, "==" is not a proper operator for standard "test")