summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* zebra: support FIB override routestterasTimo Teräs2015-06-046-25/+67
| | | | | | | | | | | | | | | FIB override routes are for routing protocols that establish shortcut routes, or establish point-to-point routes that should not be redistributed. Namely this is useful NHRP daemon to come. Zebra is extended to select two entries from RIB the "best" entry from routing protocols, and the FIB entry to install to kernel. FIB override routes are never selected as best entry, and thus are never adverticed to other routing daemons. The best FIB override, or if it does not exist the otherwise best RIB is selected as FIB entry to be installed. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra: atomic FIB updatesTimo Teräs2015-06-046-304/+168
| | | | | | | | | | | This commit updates the kernel API so that route changes are atomically updated using change/replaces messages instead of first sending a withdraw followed with update. Same for zclient updates, changes are sent as single ADD instead of DELETE + ADD. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra: make ZEBRA_FLAG_CHANGED internal statusTimo Teräs2015-06-043-5/+5
| | | | | | | | This flag is used internally in zebra only. And it makes no sense to expose it over the zclient API, as having it set from client could corrupt the internal state. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* fix previous bgp nexthop tracking patches to compile and work betterTimo Teräs2015-06-045-3/+5
| | | | | | | | | Make compiler happy, and fix IGP_CHANGED to be unset. It was previously sent on scan thread's next cycle, but now it's commeneted out. Apparently later nhs patches from Cumulus tree sort of hides this issue by removing the scan thread completely. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* A valid BGP nexthop is flagged as invalidDaniel Walton2015-06-041-1/+2
| | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* bgpd-delete-route-on-invalid-nh.patchDinesh G Dutt2015-06-041-2/+2
| | | | | | | | | | | | | | | | | BGPd: Delete the route from the kernel when a valid NH changes to invalid NH A route has been announced by a BGP peer with a valid NH and has been populated into the kernel. Now, if the NH announced changes (say via routemap) to an invalid NH, the route is marked as inactive/inaccessible inside Quagga, but is not deleted from the kernel. This patch fixes that issue. The problem is caused by BGP losing the old valid NH and using the new, invalid NH to delete the now-inaccessible route. However, the kernel/zebra has the route using the old NH and so they reject the delete. Fix involves not sending the invalid NH when its the only NH. Things worked fine if the route had BGP multipath. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
* bgpd: bgpd-nexthop-tracking.patchDinesh G Dutt2015-06-0410-117/+852
| | | | | | | | Add support for bgp to use zebra's nexthop tracking to validate nexthops. Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com> Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
* fix the previous zebra-nexthop-tracking commitTimo Teräs2015-06-046-27/+30
| | | | | | | cherry-pick fix hunks zebra-nht-routemap.patch and zebra-static-route-nht.patch with few additional fixes. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra-nexthop-tracking.patchDinesh G Dutt2015-06-0424-93/+1517
| | | | | | | | | | | | | | | Added support for nexthop tracking of a prefix. Support for protocols to register zebra to notify them when a nexthop becomes valid. With this support, protocols such as BGP no longer have to periodically scan the RIB checking if a prefix is valid or invalid. Complete documentation in doc/next-hop-tracking.txt. [TT: Rebased on top of master.] Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com> Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
* bgpd-add-peer-group-timers.patchDaniel Walton2015-06-042-27/+105
| | | | | | | | | BGP: Add support for timer commands with peer-group syntax The peer-groups parser is missing advertisement-interval and 'timers connect' Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Timo Teräs <timo.teras@iki.fi>
* zebra: redistribute hw_type to connected daemonsTimo Teräs2015-06-042-0/+2
| | | | | | nhrp module will need it, and it can be useful for others too. Signed-off-by: Timo Teräs <timo.teras@iki.fi>
* zebra: use prefix2str for logging where possibleTimo Teräs2015-06-0110-154/+107
| | | | | | | This makes code more robust, consice and readable. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra/vty: use prefix2str and unify show ip/ipv6 route codeTimo Teräs2015-06-011-298/+114
| | | | | | | | Use prefix2str where possible. As now ip/ipv6 are practically identical, they are merged removing unneeded code duplication. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: make prefix2str simpler to use, and use it in zclientTimo Teräs2015-06-013-7/+11
| | | | | | | | | | | Returning the buffer allows using it in the logging functions in easier way. This also makes the API consistent with sockunion. Add also PREFIX_STRLEN to be the generic buffer length required for any prefix string representation. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: make sockunion2str safer to useTimo Teräs2015-06-011-5/+12
| | | | | | | | It's mostly used for logging, and the return value is never checked, so try to make it valid. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* route table: constify some APIsTimo Teräs2015-05-292-8/+8
| | | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: simplify redistribution codeTimo Teräs2015-05-291-28/+4
| | | | | | | Merge the conditionals as one to avoid code duplication. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sockunion: add accessors for sockunion addressTimo Teräs2015-05-292-0/+61
| | | | | | | | Upcoming nhrp code will use this, and it can be used to remove the sockunion2ip(X) macro. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: allow caller to provide prefix storage in sockunion2hostprefixTimo Teräs2015-05-294-22/+15
| | | | | | | Avoids a dynamic allocation which is usually freed immediate afterwards. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* privs: fix privilege dropping to use system defined groupsTimo Teräs2015-05-291-19/+47
| | | | | | | | | | It may be requred for quagga process to belong to additional groups. E.g. nhrp module will need to talk to strongSwan using vici and may require additional permissions. Initialize groups from the system group database. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* tests: add testcli reference in/out & do DejaGNUDavid Lamparter2015-05-275-1/+410
| | | | | | | | This adds reference in & output for the previously added testcli tool, to check basic CLI parsing/help functions. Unlike "testcommands", this one doesn't depend on compile-time system details. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* tests: add CLI dummy command-exec toolDavid Lamparter2015-05-275-1/+200
| | | | | | | | | | | This adds some common CLI testtool code as well as a tool that has a bunch of commands to be poked for their correct processing. The tool doesn't work correctly from a script at stdin at this point because the vty code will throw away all buffered when it sees EOF, so the tail end of the input file is lost. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Revert "lib: wrong #define used for IPV6_MINHOPCOUNT"David Lamparter2015-05-272-11/+4
| | | | | | | | | | This reverts commit 54b88cac24f335414caa875b390d2d78ff4bf9e0. Unfortunately, this breaks the build on systems where linux/in6.h and netinet/in.h can't both be included, such as Ubuntu 14.04 and Debian Jessie. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripngd: allow to enable/disable the ECMP featureFeng Lu2015-05-273-5/+103
| | | | | | | | | | | | | | | | | | | | | | | | Introduce a new command "[no] allow-ecmp" to enable/disable the ECMP feature in RIPng. By default, ECMP is not allowed. Once ECMP is disabled, only one route entry can exist in the list. * ripng_zebra.c: adjust a debugging information, which shows the number of nexthops according to whether ECMP is enabled. * ripngd.c: ripng_ecmp_add() will reject the new route if ECMP is not allowed and some entry already exists. A new configurable command "allow-ecmp" is added to control whether ECMP is allowed. When ECMP is disabled, ripng_ecmp_disable() is called to remove the multiple nexthops. * ripngd.h: Add a new member "ecmp" to "struct ripng", indicating whether ECMP is allowed or not. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ripngd: add ECMP supportFeng Lu2015-05-276-349/+459
| | | | | | | | | | | | | | | | | | | | | | | | * Each node in the routing table is changed into a list, holding the multiple equal-cost paths. * If one of the multiple entries gets less-preferred (greater metric or greater distance), it will be directly deleted instead of starting a garbage-collection timer for it. The garbage-collection timer is started only when the last entry in the list gets INFINITY. * Some new functions are used to maintain the ECMP list. And hence ripng_route_process(), ripng_redistribute_add() and ripng_timeout() are significantly simplified. * ripng_zebra_ipv6_add() and ripng_zebra_ipv6_delete() now can share the common code. The common part is moved to ripng_zebra_ipv6_send(). Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent Jardin <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: wrong #define used for IPV6_MINHOPCOUNTDonald Sharp2015-05-272-4/+11
| | | | | | | | | | | The #define IPV6_MINHOPCNT define is never defined on any unix platform. >From what I can tell the original implementation on the linux platform was IPV6_MINHOPCNT, when it got accepted into the mainstream kernel it was transformed into IPV6_MINHOPCOUNT. Since we test for the define before attempting to use the code it was silently doing nothing for a long time. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/privs: Don't use CAP_NET_BROADCASTChristian Franke2015-05-271-2/+1
| | | | | | | | | | | | From what I can tell, CAP_NET_BROADCAST has never been required for any functionality in the Linux kernel, so we do not really need it. However, it causes breakage in contexts where Quagga is started with a limited set of capabilities, e.g. in Docker, because these may not include CAP_NET_BROADCAST and in the case of Docker do not even support adding CAP_NET_BROADCAST. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/privs: display more info if cap_set_proc fails.Christian Franke2015-05-271-1/+15
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: always print adj->sysid (clang 3.6 warning)David Lamparter2015-05-271-7/+1
| | | | | | | | | | | As any new compiler version, clang 3.6 has new warnings, one of these being that it now warns for testing whether the address of an array will be true. Of course there is no point in this check for the sysid, so let's always just print the sysid. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/vty: don't clear output buffer on input EOFDavid Lamparter2015-05-271-1/+1
| | | | | | | | | | | A VTY's input can be closed without the output becoming unavailable. This happens both on stdio when stdin ends, as well as over TCP when an unidirectional input shutdown() happens. In such a case, resetting the output buffer is not appropriate since there might still be data to be successfully written. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/vty: add vty_stdio at-close hookDavid Lamparter2015-05-272-2/+8
| | | | | | | | | This is intended to be used for either "exit on close", "fork on close" or "reopen vty on close" functionality for the stdio vty. Which of these options to take depends on the context, the use case right now is test programs exiting on EOF. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/vty: put stdin in raw mode for vtyDavid Lamparter2015-05-271-1/+36
| | | | | | | The interactive CLI actually works just fine, if we just put the terminal in raw mode to get keystrokes as they come. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/vty: add vty_stdio()David Lamparter2015-05-272-21/+57
| | | | | | | | this introduces a new public/API function to the vty code for opening a VTY on stdin/stdout. Intended for unrestricted use by the individual daemons, i.e. "offical API". Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib/vty: add separate output fd support to VTYsDavid Lamparter2015-05-273-13/+19
| | | | | | | | | to be used with stdin/stdout terminals, this adds support for writing to a different FD than we're reading from. Also fixes error messages from config load being written to stdin. [v2: fixed config write] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* vtysh: fix the fix for babeld removal... (5460bae)David Lamparter2015-05-271-0/+7
| | | | | | | | | | | | Commit 5460bae ("*: fix 'babeld: Remove babeld from Quagga' (336724d)") unfortunately removed the BABEL_NODE from vtysh, which now no longer starts. Fix by restoring the node (even though it won't be accessible). Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Fixes: 5460bae ("*: fix 'babeld: Remove babeld from Quagga' (336724d)") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: fix "sockunion: add hash function" for BSD (9196caf)David Lamparter2015-05-202-11/+12
| | | | | | | | | | | | | The sockunion_hash() function uses s6_addr32, which is not defined on BSD systems. (It only works on glibc because we set _GNU_SOURCE) ripngd/ripng_nexthop.h already contains a workaround for this. Bump workaround to prefix.h so it's available everywhere. Reported-by: NetDEF CI System <mwinter@netdef.org> Fixes: 9196caf ("sockunion: add hash function") Cc: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sockunion: add hash functionTimo Teräs2015-05-202-0/+17
| | | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: allow using rtt in route-map's set metricTimo Teräs2015-05-204-12/+52
| | | | | | | | | | | | | | | | | | | | | | Useful when the BGP neighbors are over tunnels that have large differences in geographic distances and RTTs. Especially useful for DMVPN setups to allow preferring closes hub. The parameter is added as new alias command as otherwise it seems the command parser is not able to match it properly (it seems merging is done for the various 'set metric' route-map objects in different routing engines). For same reason also they are listed as three separate options: optional +/- seems not possibly easily. Related research papers: http://www.pps.univ-paris-diderot.fr/~jch/research/delay-based.pdf http://arxiv.org/pdf/1309.0632.pdf Paper on similar extension to Babel: http://www.pps.univ-paris-diderot.fr/~jch/research/rapport-jonglez-2013.pdf Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* sockopt: add support for querying tcp round-trip-timeTimo Teräs2015-05-202-0/+17
| | | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: refactor route-map objects modifying integer valuesTimo Teräs2015-05-201-192/+111
| | | | | | | | | Use common code to parse, validate and adjust the route-map objects that contain a simple integer value. This also allows compiling the add/sub format metric object. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: fix "babeld: Remove babeld from Quagga" (336724d)David Lamparter2015-05-2011-123/+4
| | | | | | | | | | | | | | | | | | This removes some more bits of babeld, particularly from: - buildtest.sh - redhat/ build files - vtysh integration (which actively broke the build) The memtype and zclient/route type are kept in place since these don't break anything and -theoretically- make it possible to build babeld with some Quagga integration externally. (Keeping vtysh integration is unfortunately not as easy.) Reported-by: Donald Sharp <sharpd@cumulusnetworks.com> Fixes: 336724d ("babeld: Remove babeld from Quagga") Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> Acked-by: Paul Jakma <paul@quagga.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* babeld: Remove babeld from QuaggaPaul Jakma2015-05-1538-8930/+5
| | | | | This commit removes babeld from Quagga because the Quagga project is unable to meet the wishes of the babeld authors.
* ospfd: Remove another odd flooding hack in opaque LSA codePaul Jakma2015-05-143-125/+0
| | | | | | | | | | | | | * ospf_opaque.c: (ospf_opaque_adjust_lsreq) Odd hack to general OSPF database exchange but made to act only on opaque LSAs. It's either covering up bugs in the flooding code or its wrong. If it's covering up bugs, those would affect all LSAs and should be fixed at a lower layer in ospfd, indeed perhaps those bugs are long fixed anyway (?). Alternatively, it's just plain wrong. Nuke. (ospf_opaque_exclude_lsa_from_lsreq) helper to above, nuke. * ospf_packet.c: Nuke call to ospf_opaque_adjust_lsreq. Tested-by: olivier.dugeon@orange.com
* lib: assert(0) still needs a returnDavid Lamparter2015-05-141-0/+1
| | | | | | | | assert(0) is not guaranteed to not return since assert() in general can be optimised out when building without debug / with optimisation. This breaks the build in clang, which warns/errors about the missing return. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: fix "reduce strcmp in CLI" fallout (10bac801)David Lamparter2015-05-142-33/+19
| | | | | | | | | | | | | | | In "lib/cli: reduce strcmp in CLI hot paths", I failed to notice that CMD_VARIABLE as a boolean test covers a superset of the other types of variables. Thus, the patch broke processing of IP/IPv6/Integer range parameters in the CLI. Fix by some reordering and introducing TERMINAL_RECORD macro (which marks whether a given terminal type is a parameter) to be used in places where the check is really for all kinds of variables. Reported-by: Timo Teräs <timo.teras@iki.fi> Tested-by: Martin Winter <mwinter@netdef.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: straighten out ORF prefix list supportDavid Lamparter2015-05-055-107/+59
| | | | | | | | | BGP ORF prefix lists are in a separate namespace; this was previously hooked up with a special-purpose AFI value. This is a little kludgy for extension, hence this splits it off. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Paul Jakma <paul@jakma.org>
* lib: hide internal prefix list structuresDavid Lamparter2015-05-055-45/+84
| | | | | | | These are about to be touched and there's no point in other code touching into prefix list's internas. Add some isolation. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd: speed up "no-hit" withdraws for routeserversDavid Lamparter2015-05-053-12/+25
| | | | | | | | | | | | | | | | | | | | | | This accelerates handling of incoming Withdraw messages for routes that don't exist in the table to begin with. Cisco IOS 12.4(24)T4 has a bug in this regard - it sends withdraws instead of doing nothing for prefixes that are filtered. Pulling up the adj_in removal in Quagga should have no ill effect, but we can avoid the costly iteration over all rsclients if there was no adj_in entry. Performance impact of this change on routeserver with 3 buggy peers, startup/sync time: before patch: 143.12 seconds (user cpu) after patch: 7.01 seconds (user cpu) Many thanks to Nick Hilliard & INEX for providing real-world test data! Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Paul Jakma <paul@jakma.org>
* ospfd: Remove the blocking of opaque LSAs origination & flooding 'optimisation'Paul Jakma2015-05-056-245/+6
| | | | | | | | | | | | | * Opaque support contains some kind of hack/optimisation to origination/flooding to suppress some origins/floods until an opaque LS Acks are received. Previous versions of the code have already been shown to have bugs in them (see e16fd8a5, e.g.). It seems over-complex and fragile, plus its conceptually the wrong place to try implement flooding hacks that, AFAICT, do not depend particularly on the semantics of opaque LSA. Nuke. Tested-by: Olivier Dugeon <olivier.dugeon@orange.com>
* ospfd: Make ospf_passive_interface_update calls friendly to static analysisPaul Jakma2015-05-051-7/+19
| | | | | | | | * ospf_vty.c: ({no_}ospf_passive_interface_addr_cmd) To a static analyser, the call to ospf_passive_interface_update can look like uninitialised memory in addr might be read from. It won't be, as ospf_passive_interface_update only reads addr if params != IF_DEF_PARAMS, but not clear. Split up the helper into the two cases to make it clear.