summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | 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.
| * | tools/multiple-bgpd: Fix the PREV calculation so it works for <4 bgpdPaul Jakma2012-03-041-1/+2
| | | | | | | | | | | | | | | * tools/multiple-bgpd: Make PREV more general and correct. Add comment to route-map about why rt/soo sets are there - cause it's still broken.
* | | HACKING.pending: Add Quagga-RE detailsPaul Jakma2012-03-021-0/+5
| | |
* | | 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
* | 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>.
* | ospf6d: remove defaults from iface config (BZ#550)Vyacheslav Trushkin2012-02-212-23/+45
| |
* | ospf6d: remove own routes on SIGTERM (BZ#448)Phil Laverdiere2012-02-213-1/+10
| |
* | 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-148-25/+204
| | | | | | | | | | | | * 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
* | isisd: unexpected kernel routing table (BZ#544)Fritz Reichmann2012-02-143-25/+32
| | | | | | | | | | | | | | | | | | | | | | Fix bug 544: isisd produces an unexpected routing table for wide-metric. * isis_spf.c: Accept VTYPE_PSEUDO_TE_IS and VTYPE_NONPSEUDO_TE_IS vertex types for SPF calculation * isis_pdu.c: Change order of TLVs to match Cisco to make bitwise comparison easier for Wireshark * isis_tlv.c: EXTREME_TLV_DEBUG for TLV debugging instead of EXTREME_DEBUG
* | isisd: fix wrong next-hops from SPFPeter Szilagyi2012-02-143-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The forwarding table was filled with wrong next-hops, and which is even worse, it was done in a totally non-deterministic way. The next-hop set for an IP prefix by isisd was the neighbor IS from which the flooded LSP about the IP prefix was arrived. So, if an IS received all the LSPs through its, say, eth0 interface, all entries in the forwarding table contained the next IS reachable via eth0 as the next-hop. The solution is to propagate the correct next-hop further from node to node as the SPF algorithm traverses the graph and selects the next node to be added to the set of already covered nodes. Also, the construction of the tentative node list (the nodes where the shortest path is not known yet) was buggy: if a node was already a member of this list with a certain path cost, and an alternative path was found to it with a lower cost while processing a pseudo-node LSP, it was not added to the list. This way, the path selected by isisd for a certain prefix was the first one it encountered during the LSDB processing. Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
* | isisd: send proper LSP after DIS electionPeter Szilagyi2012-02-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | After an IS has been elected as the Designated IS for a LAN, it did not refresh the content of the pseudo-node after a new node has been connected to the same LAN. Instead, the periodically reoriginated pseudo-node LSP still contained only those IS neighbors that were already present when the DIS election process was commenced. The fix for the problem schedules an LSP regeneration rather than just reoriginating the same LSP with the old content. Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
* | isisd: fix circuit state machinePeter Szilagyi2012-02-145-64/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | isisd has a so-called circuit state machine that takes care about the interface state changes, such as initializing, down, up. When an interface was brought down by a link failure, the interface information was deleted and set to NULL. When the link was restored later, the interface was looked up by the old pointer, but since it was cleared, it was never found again, resulting in an interface never entering the up state again. Also, the program regularly crashed because of a deleted pointer in the same context which was later accessed without any further checking. Signed-off-by: Fritz Reichmann <fritz@reichmann.nl>
* | ospf6d: fix out of bounds write in ospf6_prefix_apply_maskDavid Lamparter2012-02-111-5/+4
| | | | | | | | | | | | | | | | | | | | ospf6_prefix_apply_mask would write one byte beyond the 4/8/12 bytes allocated for prefixes of length 32/64/96. based on report and patch by Jon Andersson <jon.andersson@thales.no> Reported-by: Jon Andersson <jon.andersson@thales.no> Signed-off-by: David Lamparter <equinox@diac24.net>
* | zebra: justify rtadv VTY commands with argumentsDenis Ovsienko2012-01-262-119/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ipv6 nd ra-interval ipv6 nd ra-lifetime ipv6 nd reachable-time ipv6 nd home-agent-preference ipv6 nd home-agent-lifetime ipv6 nd router-preference Calls to atoi() and atol() are replaced with VTY_GET_INTEGER_RANGE() macro, command patterns are clarified and aliases of some commands are added for consistency. Other changes are listed below. * zebra/rtadv.c * ipv6_nd_ra_interval_msec(): resolve -Wsign-compare * ipv6_nd_ra_interval(): idem * rtadv_init(): update to list new aliases * doc/ipv6.texi: update to match current implementation
* | zebra: freshen RFC references in rtadvDenis Ovsienko2012-01-263-10/+10
| | | | | | | | | | | | RFC2461 was replaced by RFC4861 RFC3775 was replaced by RFC6275 draft-ietf-mip6-mipext-advapi-03 was replaced by RFC4584
* | zebra: use prefix_ipv6 in rtadv_prefixDenis Ovsienko2012-01-262-11/+10
| | | | | | | | | | rtadv_prefix.prefix was casted to "struct prefix_ipv6" and had the same size, make it exactly this type to make the code a bit cleaner.
* | zebra: clear host bits of ND RA prefix optionDenis Ovsienko2012-01-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC4861 4.6.2. Prefix Information Prefix An IP address or a prefix of an IP address. The Prefix Length field contains the number of valid leading bits in the prefix. The bits in the prefix after the prefix length are reserved and MUST be initialized to zero by the sender and ignored by the receiver. * rtadv.c * ipv6_nd_prefix(): add missing call to apply_mask_ipv6() * no_ipv6_nd_prefix(): idem
* | zebra: justify some IPv6 ND RA timers wrt RFCDenis Ovsienko2012-01-263-18/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a regression introduced with the previous commit: "ipv6 nd home-agent-lifetime 1800000" appeared by default in every interface section of running-config, although this command is invalid in this context. Troubleshooting and bugfixing of the issue tracked out several bugs in router advertisement procedures, some of which are fixed in this commit. * zebra/interface.c * if_zebra_new_hook(): update to treat -1 as "uninitialized" * nd_dump_vty(): idem * zebra/rtadv.c * rtadv_send_packet(): update processing of "router lifetime" field, "home agent" option and "home agent lifetime" field to conform to RFC6275 better * ipv6_nd_ra_interval_msec(): update MaxRtrAdvInterval range check, make sure it never exceeds (initialized) AdvDefaultLifetime * ipv6_nd_ra_interval(): idem * ipv6_nd_ra_lifetime(): update AdvDefaultLifetime range check, make sure it never falls below MaxRtrAdvInterval * ipv6_nd_homeagent_lifetime(): update HomeAgentLifetime range check * no_ipv6_nd_ra_lifetime(): update to treat -1 as "uninitialized" * no_ipv6_nd_homeagent_lifetime(): idem * rtadv_config_write(): idem
* | zebra: fix output of IPv6 ND RA optionsDenis Ovsienko2012-01-261-0/+14
| | | | | | | | | | | | | | | | | | | | The following options could be configured for an interface, but were never visible in the config text: ipv6 nd adv-interval-option ipv6 nd home-agent-preference ipv6 nd home-agent-lifetime ipv6 nd home-agent-config-flag
* | fix zebra protocol after MP-BGP changesDenis Ovsienko2012-01-235-0/+14
| | | | | | | | | | | | The previous commits modified both zebra and bgpd for additional SAFI field, but not any other routing daemon, which led to zebra daemon crashing with failed assertion.
* | zebra: fix recent MP-BGP commits for FreeBSDDenis Ovsienko2012-01-231-5/+5
| |
* | zebra: Removal of the following warning messagesG.Balaji2012-01-231-3/+2
| | | | | | | | warning: too many arguments for format [-Wformat-extra-args]
* | 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.
* | zebra: IPv6 MP-BGP Routes addition and deletionG.Balaji2012-01-235-15/+17
| | | | | | | | | | | | This patch contains the following: 1. Addition of IPv6 SAFI_MULTICAST BGP routes into the RTM's RIB. 2. Deletion of IPv6 SAFI_MULTICAST BGP routes from the RTM's RIB.
* | bgpd: IPv6 MP-BGP Routes addition and deletionG.Balaji2012-01-233-0/+5
| | | | | | | | | | | | 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.
* | zebra: IPv4 MP-BGP Routes addition and deletionG.Balaji2012-01-239-19/+111
| | | | | | | | | | | | This patch contains the following: 1. Addition of IPv4 SAFI_MULTICAST BGP routes into the RTM's RIB. 2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the RTM's RIB.
* | bgpd: IPv4 MP-BGP Routes addition and deletionG.Balaji2012-01-235-12/+17
| | | | | | | | | | | | 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.
* | zebra: include MTU option in RA on request (BZ#665)Denis Ovsienko2012-01-202-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | This implements a new "ipv6 nd mtu <1-65535>" interface-level command. * doc/ipv6.texi: add description * zebra/rtadv.c * rtadv_send_packet(): send option type 5, when configured * ipv6_nd_mtu(): new VTY helper * no_ipv6_nd_mtu(): ditto * rtadv_config_write(): add new option * rtadv_init(): list new helpers
* | 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.
* | Marker merge for 'RE-0.99.17.6'Paul Jakma2012-01-080-0/+0
|\ \ | | | | | | | | | | | | | | | 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'.
| * | version RE-0.99.17.6RE-0.99.17.6Denis Ovsienko2012-01-051-1/+1
| | |
| * | 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: Route locking (memory) cleanupTom Goff2012-01-022-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ospf6_route.c: (ospf6_route_best_next) Allows unlock route, even when there's no next route. This is consistent with how ospf6_route_next() behaves. * ospf6_intra.c: (ospf6_intra_prefix_lsa_remove) Make sure the last route considered is always unlocked. This is needed when the for loop terminates because ospf6_route_is_prefix() returns zero. Signed-off-by: Vyacheslav Trushkin <me@dogonthesun.net>
| * | ospf6d: Have ospf6d cleanup when it terminates normallyTom Goff2012-01-029-6/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A clean exit makes it easier to use memory debuggers. * ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map cleanup. * ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa handler vector. * ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to gracefully exit. * ospf6_message.c: (ospf6_message_terminate) Add a function that frees the send and receive buffers. * ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function. Disable ospf6 before freeing everything. Signed-off-by: Vyacheslav Trushkin <me@dogonthesun.net> Conflicts: ospf6d/ospf6_lsa.h
| * | lib: Add a function to delete all interfacesTom Goff2012-01-022-0/+19
| | | | | | | | | | | | | | | if.c: (if_terminate) This adds a cleanup function that can be called when a daemon exits, similar to vty_terminate().
| * | 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 compile warnings from set-never-usedStephen Hemminger2012-01-021-6/+0
| | | | | | | | | | | | The if_dump code had empty loop, that caused set-never-used warning.
| * | Revert "lib: address -Wunused-but-set-variable"Denis Ovsienko2012-01-024-6/+18
| | | | | | | | | | | | | | | | | | | | | Stephen Hemminger's commits contain all the changes and several other warning fixes. This reverts commit 6947dbebdc91b6272f8107a6e0dd211457438606.