summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | bgpd: Fix a crash caused by mistakenly dequeueing the bestpath on theJosh Bailey2011-07-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multipath list. This causes the multipath list to get truncated but the multipath count still reflects what it was before truncation. When we install the route to zebra we fail to fill the nexthop array with the number of nexthop pointers indicated by the multipath count and this leads to a NULL pointer crash in stream_put_in_addr(). Changes: * bgpd/bgp_mpath.c * bgp_info_mpath_update(): If new_mpath is the bestpath we should just move to the next mp_list node. Move dequeue of new_mpath and the code that updates next_mpath to inside the check that new_mpath is not the bestpath.
| * | | bgpd: When advertising a multipath route, the attribute set to beJosh Bailey2011-07-205-17/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | advertised is based on the bestpath attribute set, but the following attributes are aggregated from the attribute sets of the multipath constituents: - AS_PATH - ORIGIN - COMMUNITIES - EXTENDED COMMUNITIES In addition the route is advertised with the NEXT_HOP set to the router's interface IP address, instead of the NEXT_HOP of the best path. This is to ensure that traffic will go to this router so it can be fanned out via the multipath route. * bgpd/ecommunity.c * ecommunity_uniq_sort(): Make this function externally accessible * bgpd/ecommunity.h * Add external declaration for ecommunity_uniq_sort() * bgpd/bgp_mpath.c * bgp_info_nexthop_cmp(): Replace calls to bgp_attr_extra_get() to avoid unwanted memory allocation * bgp_info_mpath_free(): Free aggregate attribute for multipath * bgp_info_mpath_attr(): Lookup aggregate attribute of a multipath route * bgp_info_mpath_attr_set(): Set aggregate attribute of a multipath route * bgp_info_mpath_aggregate_update(): Update the aggregate attribute of a multipath route * bgpd/bgp_mpath.h * bgp_info_mpath: Add pointer to hold aggregate attribute of a multipath * Add external declarations for new functions * bgpd/bgp_route.c * bgp_announce_check(): Use aggregate attribute when announcing multipath route * bgp_announce_check_rsclient(): Use aggregate attribute when announcing multipath route * bgp_best_selection(): After updating multipath set, update the multipath aggregate attribute
| * | | bgpd: For deterministic MED build a multipath set for each peer AS as theJosh Bailey2011-07-203-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | first stage of the best path calculation. The second stage then selects a winner from each peer AS's best path. In the second stage we clear multipath set of the non-selected best paths via bgp_mp_dmed_deselect(). Since the multipath set is already marked up for the winning path, we don't call bgp_info_mpath_update() after the second stage calculation. * bgpd/bgp_mpath.c * bgp_mp_dmed_deselect(): New function to cleanup the multipath markup if a DMED selected path loses in stage 2 of the best path calculation * bgpd/bgp_mpath.h * Add external declaration of bgp_mp_dmed_deselect() * bgpd/bgp_route.c * bgp_best_selection(): If multipath is enabled, build up the mp_list for the current peer AS, and do the RIB markup the best path from that AS. In the second stage, clear the RIB markup for the DMED selected path if it is not selected as best. Only call bgp_info_mpath_update() in the second stage when not doing deterministic MED.
| * | | bgpd: Modify the BGP to zebra route announcement to support multipathJosh Bailey2011-07-204-7/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | routes. Use a growable buffer (bgp_nexthop_buf) to collect nexthops that are included in the announcement. Use the BGP_INFO_MULTIPATH_CHG flag to trigger zebra announcement so zebra will be updated if the multipath set changes. Display all multipath nexthops in 'debug bgp zebra' output. * bgpd/bgp_main.c * bgp_exit(): Free bgp_nexthop_buf when exiting * bgpd/bgp_route.c * bgp_process_rsclient(): Clear BGP_INFO_MULTIPATH_CHG after processing * bgp_process_main(): Check BGP_INFO_MULTIPATH_CHG to trigger zebra announcement and clear aftr processing * bgpd/bgp_zebra.c * bgp_nexthop_buf: Growable buffer used to collect nexthops for zebra announcement * bgp_zebra_announce(): Grow bgp_nexthop_buf if needed. Include multipath count in zebra announcement and add all nexthops to bgp_nexthop_buf. Pass bgp_nexthop_buf data to zebra announcement. Added nexthops to debug output. * bgp_zebra_init(): Initialize bgp_nexthop_buf at startup * bgpd/bgp_zebra.h * BGP_NEXTHOP_BUF_SIZE: Default initial bgp_nexthop_buf size has room for 8 nexthops
| * | | bgpd: Adds support to mark up the BGP rib table entry with multipathJosh Bailey2011-07-206-30/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information based on the multipath list (mp_list) generated during the best path calculation. Display "multipath" for paths that are multipath and also on bestpath if the route is multipath. Flag a best path with the BGP_INFO_MULTIPATH_CHG if the multipath set has changed since the last update. This can be used to trigger updates to zebra and peers. The multipath markup is a lazily allocated bgp_info_mpath structure that is added to the best path and any multipaths. The mpath structures are linked together with the best path element at the head and the other elements ordered by nexthop and then by peer address. This markup scheme is updated by calling bgp_info_mpath_update() and passing in a new mp_list the the current multipath set. There are additional API's for walking the multipath set, querying the count of multipaths, and for cleaning up the multipath markup information when freeing path information. * bgpd/bgp_mpath.c * bgp_info_mpath_new(): Allocation of new mpath element * bgp_info_mpath_free(): Release memory for mpath element * bgp_info_mpath_get(): Access mpath element of path. Allocate memory on-demand * bgp_info_mpath_enqueue(): Enqueue a path onto the multipath list * bgp_info_mpath_dequeue(): Remove a path from the multipath list * bgp_info_mpath_first(): Return first path on the multipath list * bgp_info_mpath_next(): Return next path on the multipath list * bgp_info_mpath_count(): Return the number of paths on the multipath list * bgp_info_mpath_count_set(): Set the number of paths on the multipath list * bgp_info_mpath_update(): Update multipath markup on bgp route table entry and flag any changes. Emit 'debug bgp event' output on any multipath change. * bgpd/bgp_mpath.h * struct bgp_info_mpath: Information added to a bgp_info path to record multipath information * External declarations for new functions in bgp_mpath.c * bgpd/bgp_route.c * bgp_info_free(): Free mpath memory when freeing path information * bgp_info_reap(): Dequeue path from multipath queue before deleting it * bgp_best_selection(): Calls bgp_info_mpath_update() with latest mp_list to mark-up rib table entry * bgp_vty_out_detail(): Add display of multipath flag for a path. Also display 'multipath' for bestpath if it is a multipath route * bgpd/bgp_route.h * struct bgp_info: Add pointer to bgp_info_mpath information * Add flags to mark a path as multipath (BGP_INFO_MULTIPATH) and to mark bestpath if multipath information has changed (BGP_INFO_MULTIPATH_CHG) * lib/memtypes.c * Add MTYPE_BGP_MPATH_INFO for allocating memory for bgp_info_mpath * tests/bgp_mpath_test.c * Add test case for bgp_info_mpath_update() and supporting functions
| * | | bgpd: Adds equal-paths check to path comparison. Paths that areJosh Bailey2011-07-206-23/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | equal to the best path are accumulated onto an ordered list (mp_list) if maximum-paths is configured. A future commit will add the multipath markup to the BGP rib table based on the mp_list. Add unit test for the added mp_list functions. Deterministic MED is not supported in this commit, it will be added later. * bgpd/bgp_aspath.c * Make aspath_cmp() an external symbol so it can be used in equivalent paths check * bgpd/bgp_aspath.h * Add extern declaration of aspath_cmp() * bgpd/bgp_mpath.c * bgp_info_nexthop_cmp(): Compares nexthops of two paths * bgp_info_mpath_cmp(): Compare function to order multipaths by nexthop and then by peer address * bgp_mp_list_init(): Initialize a list with the multipath order function * bgp_mp_list_clear(): Clear out the mp_list * bgp_mp_list_add(): Add a multipath to mp_list * bgpd/bgp_mpath.h * External declarations for above added functions in bgp_mpath.c * bgpd/bgp_route.c * bgp_info_cmp(): Add equivalent paths result (paths_eq). If eBGP paths are equal down to IGP metric check, flag as equal if peer AS matches. Similarly for iBGP paths but compare full AS_PATH. * bgp_best_selection(): If multipath is enabled, accumulate equivalent paths in mp_list. Add debug bgp event output to see result (will be filtered later to display only when change occurs) * bgp_process_rsclient(): Pass multipath config to bgp_best_selection() * bgp_process_main(): Pass multipath config to bgp_best_selection() * tests/bgp_mpath_test.c * Add unit test case for bgp_mp_list functions
| * | | bgpd: add bgp_mpath_test.cJosh Bailey2011-07-202-1/+312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/bgp_mpath_test.c * New file with test framework for testing BGP multipath * Add test for CLI support functions * tests/Makefile.am * Add new testbgpmpath target
| * | | bgpd: Add new configuration cli for eBGP and iBGP multipath.Josh Bailey2011-07-207-2/+294
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is support to configure this for each (AFI,SAFI), but currently this configuration is only present for IPv4 unicast: maximum-paths [ibgp] <1-255> no maximum-paths [ibgp] [<1-255>] * bgpd/Makefile.am * Add bgp_mpath.h and bgp_mpath.c to build * bgpd/bgp_mpath.h * New file for bgp multipath declarations * define BGP_DEFAULT_MAXPATHS * bgpd/bgp_mpath.c * bgp_maximum_paths_set(): Configure maximum paths for the given afi, safi and bgp instance * bgp_maximum_paths_unset(): Return maximum paths configuration to the default setting for the given afi, safi and bgp instance * bgpd/bgp_vty.c * Define command strings for above CLI * bgp_config_write_maxpaths(): Outputs configuration for the given afi, safi and bgp instance * Install command elements for IPv4 unicast * bgpd/bgp_zebra.h * bgp_config_write_maxpaths(): External declaration * bgpd/bgpd.c * bgp_create(): Initialize bgp instance to default maximum paths setting * bgp_config_write_family(): Output maximum paths configuration for the given address family * bgp_config_write(): Output maximum paths configuration for IPv4 unicast address family * bgpd/bgpd.h * struct bgp: Add storage for maximum paths configuration for each afi, safi
* | | ospfd: adjust OSPF_ROUTER_LSA_MIN_SIZE for VL caseDenis Ovsienko2012-04-111-1/+8
| |/ |/|
* | lib: pretty ip_masklen and masklen2ipDavid Lamparter2012-04-041-109/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | nonwithstanding any desire for optimisation, these versions are shorter and more concise. reading the comments, they might even be easier to understand. I've tested them on i686 and x86_64, and checked that correct assembler code is emitted for ARM, MIPS and PowerPC. IPv6 is left as an exercise for another day, none of the ideas I had led to a "yes, this is the one to go with" solution. Signed-off-by: David Lamparter <equinox@diac24.net>
* | Revert "lib: optimize ip_masklen()" (BZ#720)David Lamparter2012-04-041-2081/+25
| | | | | | | | | | | | | | | | | | | | | | This reverts commit d171bf58ef12ace43d48565e6870722dece1e6ed. There are multiple reasons for this revert, including bug #720, but also quite simply the unreadability of having 2000 lines of an autogenerated table in the middle of a source file. Signed-off-by: David Lamparter <equinox@diac24.net> Reported-by: Martin Winter <mwinter@opensourcerouting.org>
* | bgpd: bgp_attr_flags_diagnose shouldn't assertPaul Jakma2012-03-271-1/+8
| | | | | | | | | | | | * bgpd/bgp_attr.c: (bgp_attr_flags_diagnose) debug code for error-handling paths probably shouldn't assert, instead it should just log that there was no problem.
* | bgpd: attr_parse call to attr_malformed should deal with PROCEED error casePaul Jakma2012-03-271-8/+14
| | | | | | | | | | | | * bgpd/bgp_attr.c: (bgp_attr_parse) the invalid flag check call to bgp_attr_malformed is pretty useless if it doesn't actually allow for the PROCEED non-error case.
* | bgpd: Fix silly mistake in bgp_attr_flag_invalidPaul Jakma2012-03-271-1/+1
| | | | | | | | | | * bgp_attr.c: (bgp_attr_flag_invalid) flags is meant to be masked off with the mask variable...
* | bgpd: malformed attribute error that can still proceed should fixup getpPaul Jakma2012-03-251-3/+10
| | | | | | | | | | | | | | | | | | * bgp_attr.c: (bgp_attr_malformed) When a malformed attribute error can be ignored, and BGP message processing may still proceed, the stream getp should be adjusted to the end of the attribute - the caller may not have consumed all the attribute. Problem noted by Martin Winter in bug 678. Also, rename the 'startp' local to 'notify_datap', for clarity.
* | Merge branch 'babeld-merge' into master-copyPaul Jakma2012-03-2562-171/+9168
|\ \
| * | babeld: remove "parasitic" mode.Juliusz Chroboczek2012-03-255-56/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the functionality described in Appendix C of RFC 6126. Its main purpose is to avoid keeping a full source table, which makes it possible to implement a subset of Babel in just a few hundred lines of code. However, in Quagga the code for maintaining the source table is already there, and a parasitic implementation can be simulated using filtering -- so it makes little sense to keep the functionality.
| * | babeld: 3 more timing statements in config textDenis Ovsienko2012-03-253-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes the following lines visible in running-config text, when respective intervals are configured to non-default values: * babel hello-interval * babel update-interval * babel resend-delay
| * | babeld: consolidate zebra interface into fewer functions.Juliusz Chroboczek2012-03-251-124/+29
| | |
| * | babeld: fix typo in kernel_route_add_v6.Juliusz Chroboczek2012-03-251-0/+1
| | |
| * | babeld: set interface flags eagerly, not at interface up.Juliusz Chroboczek2012-03-251-11/+22
| | |
| * | babeld: more helpful sample conf file.Juliusz Chroboczek2012-03-251-2/+11
| | |
| * | babeld: fix documentation.Juliusz Chroboczek2012-03-251-16/+15
| | |
| * | babeld: remove remains of standalone babeld's configuration code.Juliusz Chroboczek2012-03-255-23/+8
| | | | | | | | | | | | | | | | | | Standalone babeld has a configuration interface that is not used in Quagga. This removes a few bits of this code that survived the port to Quagga.
| * | babeld: drive interface_config_write() forwardDenis Ovsienko2012-03-251-9/+17
| | |
| * | babeld: justify "running-config" meaning in CLIDenis Ovsienko2012-03-259-53/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary focus of this commit is to make "show running-config" command display more current configuration, including some of the bits previously seen in the output of "show babel running-config". Besides that, the following commands were renamed for consistency with the syntax of other components: "debug *" to "debug babel *" (and moved to top level) "show babel running-config" to "show babel parameters" * babel_interface.c * show_babel_running_config(): rename to show_babel_parameters(), update syntax pattern, don't call show_babeld_configuration() * babel_if_init(): update respectively * babel_enable_if_config_write(): new VTY helper for static babel_enable_if * babel_interface.h: add extern declaration * babel_main.c: unset all debug options by default * show_babel_main_configuration(): remove debug options decoder * babel_zebra.c * babel_debug(): rename to debug_babel(), update syntax pattern * no_babel_debug(): rename to no_debug_babel(), update syntax pattern * babelz_zebra_init(): update respectively * debug_babel_config_write() new VTY helper for static debug_type * babel_zebra.h: add extern declaration * babeld.c * babel_config_write(): add the code to output "debug babel *", "router babel", "redistribute *" and "network *" statements * show_babeld_configuration(): dismiss * babeld.h: remove extern declaration * babeld.texi: update for renamed commands * babeld.conf.sample: idem, add debug statements block
| * | Remove dead variable reboot_time.Juliusz Chroboczek2012-03-251-5/+0
| | | | | | | | | | | | Thanks to Denis Ovsienko.
| * | doc: fix typo.Matthieu Boutier2012-03-251-1/+1
| | |
| * | doc: update babeld documentation.Juliusz Chroboczek2012-03-251-11/+23
| | |
| * | doc: fix Makefile dependencies for babeld.Juliusz Chroboczek2012-03-251-5/+5
| | |
| * | babeld: display update-interval and resend-delay in show commands"Juliusz Chroboczek2012-03-252-2/+3
| | |
| * | babeld: vty commands (hello-interval, update-interval, resend-delay).Juliusz Chroboczek2012-03-252-23/+61
| | |
| * | babeld: remove port and group setting commands.Juliusz Chroboczek2012-03-251-47/+0
| | | | | | | | | | | | They didn't work anyway, since they're called too late.
| * | Resynchronise with babeld-1.3.1.Juliusz Chroboczek2012-03-258-96/+32
| | |
| * | babeld: dismiss babel_redistribute_unset()Denis Ovsienko2012-03-251-18/+3
| | | | | | | | | | | | | | | | | | The function was effectively duplicating existing zclient_redistribute(). This makes no_babel_redistribute_type() consistent with babel_redistribute_type()
| * | babeld: fix wire{d,less} commands name.Matthieu Boutier2012-03-252-5/+5
| | |
| * | ripd: add babel for redistribution.Matthieu Boutier2012-03-251-1/+2
| | |
| * | ripngd: Replace redistribution strings with route_types.h defines.Matthieu Boutier2012-03-251-124/+74
| | |
| * | babeld: Add support for blackhole routes.Juliusz Chroboczek2012-03-251-21/+43
| | | | | | | | | | | | | | | | | | | | | Babel makes use of blackhole routes to prevent routing loops between overlapping prefixes shortly after a route is retracted (see RFC 6126 sections 2.8 and 3.5.5). This patch adds support for installing such blackhole routes.
| * | babeld: refactor filtering stubs.Juliusz Chroboczek2012-03-253-166/+56
| | | | | | | | | | | | | | | | | | Factorise the common parts of the in/out filtering functions. This also fixes a bug with filtered out routes, which in babeld are signalled by a filter returing INFINITY, not -1.
| * | zebra: Display uptime of Babel routes in show ip[v6] route.Juliusz Chroboczek2012-03-251-0/+4
| | |
| * | babeld: Use quagga_gettime.Juliusz Chroboczek2012-03-251-38/+1
| | |
| * | babeld: Don't use an ifindex when installing IPv4 routes.Juliusz Chroboczek2012-03-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stand-alone babeld installs routes using both a next-hop gateway and an interface index. Unfortunately, this doesn't work for IPv4 under Quagga. We now ignore the ifindex when installing IPv4 routes, which makes Babel work for IPv4 in prefix-based networks. Of course this breaks IPv4 mesh networks, unless you play some tricks with your interfaces' netmasks.
| * | babeld: remove some unused functions' arguments.Matthieu Boutier2012-03-251-58/+26
| | |
| * | doc: fix typo in babeld.Matthieu Boutier2012-03-251-6/+5
| | |
| * | doc: Document babeld.Juliusz Chroboczek2012-03-253-1/+119
| | |
| * | babeld: Indentation fix.Juliusz Chroboczek2012-03-251-3/+3
| | |
| * | babeld: Error handling and tweaks for babeld commands.Juliusz Chroboczek2012-03-253-8/+11
| | |
| * | babeld: Fix typo in hello interval command.Juliusz Chroboczek2012-03-251-1/+1
| | |
| * | vtysh: Vtysh support for babeld.Juliusz Chroboczek2012-03-255-3/+31
| | |