summaryrefslogtreecommitdiffstats
path: root/zebra
Commit message (Collapse)AuthorAgeFilesLines
* zebra: support FIB override routestterasTimo Teräs2015-06-045-25/+66
| | | | | | | | | | | | | | | 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-042-4/+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>
* A valid BGP nexthop is flagged as invalidDaniel Walton2015-06-041-1/+2
| | | | Signed-off-by: Daniel Walton <dwalton@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-0414-90/+978
| | | | | | | | | | | | | | | 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>
* zebra: redistribute hw_type to connected daemonsTimo Teräs2015-06-041-0/+1
| | | | | | 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>
* 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>
* zebra: fix rtadv check for non-glibc linuxTimo Teräs2015-05-051-1/+1
| | | | | | | Default RTADV enabled for non-glibc linux (fixes check for musl libc). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix build with rtadv disabledTimo Teräs2015-05-051-1/+2
| | | | | | | | Otherwise we get warning on rtadv_init() prototype not being defined when compiling rtadv.c (as dummy stub is provided always). Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* Merge branch 'volatile/fix_warnings'David Lamparter2015-04-2315-206/+93
|\ | | | | | | | | | | Thanks to Donald Sharp and Greg Troxel for providing feedback! Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: fix NetBSD interface stats printfDavid Lamparter2015-04-211-18/+23
| | | | | | | | | | | | | | | | | | "format '%qu' expects type 'long long unsigned int', but argument 3 has type '__uint64_t'" Move to %llu, which is more standard. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: fix more initialisers (for BSD)David Lamparter2015-04-211-2/+2
| | | | | | | | | | | | | | FreeBSD and NetBSD spew a few more warnings about variable initialisers. Found with OSR's/NetDEF's fancy new CI system. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: silence zebra_serv_un unused warningDavid Lamparter2015-04-211-1/+2
| | | | | | | | | | | | zebra_serv_un() is unused if --enable-tcp-zebra is given. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * build: add --enable-werrorDavid Lamparter2015-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows enabling -Werror in a consistent way. Note that this is different from just specifiying it in CFLAGS, since that would either break configure tests (if done on ./configure), or would override configure's CFLAGS (if done on make). Using --enable-werror instead provides a new WERROR variable that is additionally used during make with a consistent set of warning flags. The tests/ directory is exempt. (Rationale being, better to have more tests than pedantically complain about them.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: clean up misc_null pragmasDavid Lamparter2015-04-211-4/+15
| | | | | | | | | | | | | | The no-op alternatives provided in misc_null trigger a few warnings since they provide functions / use pragmas without prototypes. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: static int inline -> static inline intDavid Lamparter2015-04-211-2/+2
| | | | | | | | | | | | | | The BSD socket kernel interface had some weird ordering of function attribute keywords. ("static int inline foobar()") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: use SA_SIZE for RT_ROUNDUP on FreeBSDDavid Lamparter2015-04-211-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD provides SA_SIZE (and none of the other options to infer padded size of a struct sockaddr). Just define SAROUNDUP to SA_SIZE if it is available. This also drops a superfluous-looking extra macro branch which would require ROUNDUP. It seemed redundant to my eyes, but I have no idea what odd things might have triggered addition of this in the first place... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: use prototypes/includes in rt_netlinkDavid Lamparter2015-04-213-5/+6
| | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra: remove unused netlink_route()/kernel_rtm_ipv6()David Lamparter2015-04-212-135/+0
| | | | | | | | | | | | | | | | kernel_delete_ipv6_old(), removed in 51bdeba a little while ago, was the last user of netlink_route() and kernel_rtm_ipv6(). Everything else uses the _multipath variants of these functions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * zebra, isisd: cast to unsigned char for ctypesDavid Lamparter2015-04-211-1/+2
| | | | | | | | | | | | | | | | ctype.h macros take int as arguments, but expect arguments to be in unsigned char's range. Even though it probably works, this isn't correct on systems that have a signed char type. Cast explicitly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * bgpd, zebra: fix struct/pointer sizeof mixupsDavid Lamparter2015-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | Two places were taking sizeof(pointer) instead of the sizeof(struct), while performing operations on the struct. Both are initialisation functions; I guess we haven't seen fallout since they weren't critical. Fix anyway. [v2: fix mistake that actually broke bgpd RS workqueue init] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: add missing includesDavid Lamparter2015-04-211-0/+1
| | | | | | | | | | | | | | Some places, particularly headers, were spewing warnings since they don't include neccessary other headers to get struct/enum definitions. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: use void * for printing pointersDavid Lamparter2015-04-211-25/+29
| | | | | | | | | | | | | | | | | | On higher warning levels, compilers expect %p printf arguments to be void *. Since format string / argument warnings can be useful otherwise, let's get rid of this noise by sprinkling casts to void * over printf calls. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Fix alignment assumptions on non-RT_ROUNDUP platforms.Greg Troxel2015-03-231-2/+2
|/ | | | | | | The comment said that apple uses int and BSD traditionally used long, but the code was backwards. This fixes apple to be int, and otherwise long. That should make FreeBSD, which aligns to long, work correctly, even without using SA_SIZE.
* zebra: don't print uninitialized string (3b02fe8)David Lamparter2015-03-071-1/+1
| | | | | | | | | This crept in as part of the MRIB improvements and I missed the compiler warning between other noise. Unfortunately, printing an uninitialised variable can in fact make zebra crash, so this is not trivial. Fixes: 3b02fe8 ("zebra: add "show ip rpf" to get result of RPF lookup") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: print "no link-detect"David Lamparter2015-03-021-0/+2
| | | | | | | The default for this is slated to change, so let's print the current default value for preexisting configurations. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* build: get rid of INCLUDES, use AM_CPPFLAGSDavid Lamparter2015-02-141-1/+1
| | | | | | | | | | | | INCLUDES in configure.ac was not used at all, and INCLUDES in Makefile.am is supposed to be AM_CPPFLAGS these days. Reduces warnings spewed during bootstrap/autoreconf. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* zebra: remove rt_ioctl kernel interfaceDavid Lamparter2015-02-142-521/+1
| | | | | | | | | None of the BSDs uses ioctls to set routes anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* build: remove ancient Linux/BSD IPv6 cruftDavid Lamparter2015-02-141-3/+2
| | | | | | | | | IPv6 functions in a separate library... yeah, right. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* zebra: remove kernel_delete_ipv6_old()David Lamparter2015-02-145-39/+0
| | | | | | | | | | The only user of this was rib_bogus_ipv6(), which was removed in the previous commit. Good riddance. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* zebra, ripngd: remove ::/64 special-casingDavid Lamparter2015-02-141-25/+0
| | | | | | | | | | | | | | | | | In the 90ies, IPv4 was believed to exist within IPv6, with some kernels implementing this belief in code... Our code here is keyed to "#ifdef LINUX", yet no Linux from the past 10 years had this, making the code completely useless. FreeBSD 10.0 does in fact have a "::/96 via ::1 dev lo0 reject" route. IMHO we shouldn't mess with that, the admin can filter as neccessary anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> [DL: slightly adjusted commit message to remove misunderstanding] Acked-by: Paul Jakma <paul@jakma.org>
* build: remove INRIA, NRL and MUSICA IPv6 quirksDavid Lamparter2015-02-144-13/+4
| | | | | | | | | Valar dohaeris. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* build: remove AIX, NEC EWS and IRIXDavid Lamparter2015-02-146-230/+4
| | | | | | | | | Valar morghulis. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* build: remove Linux non-netlink configDavid Lamparter2015-02-143-427/+3
| | | | | | | | | | This path is deprecated, completely untested, likely broken and will not be maintained. Kill it with fire. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Acked-by: Greg Troxel <gdt@ir.bbn.com> Acked-by: Feng Lu <lu.feng@6wind.com> Acked-by: Paul Jakma <paul@jakma.org>
* zebra: mark multicast commands experimentalDavid Lamparter2015-02-061-0/+7
| | | | | | | | | | depending on feedback from actually having these commands in a released version, we may want to adjust them. Thus, mark them as experimental so users are aware of this. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: add "show ip rpf" to get result of RPF lookupDavid Lamparter2015-02-061-5/+47
| | | | | | | | | | | Checking what route exactly a RPF lookup for a given source uses is essential for an administrator to debug multicast routing issues. This command provides exactly that, using the multicst RPF lookup function and printing out its result to the CLI. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: make MRIB lookup behaviour switchableDavid Lamparter2015-02-064-21/+169
| | | | | | | | | | | | | | | depending on the usage scenario (and availability of multitopology IGP protocols, which is currently zero in Quagga), different approaches of Multicast RPF lookups are useful. Reference behaviours from commercial vendors are urib-only/mrib-only (Juniper, depending on inet.2 availability) and lowest-distance (Cisco). As we are currently without MT IGP support, mrib-first seems the most useful default for Quagga. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: return route_node from rib_match_ipv4_safiDavid Lamparter2015-02-063-10/+18
| | | | | | | | | | The multicast code needs to know the route_node in addition to the rib entry in order to perform distance or prefix-length comparisons. Add it as optional "out" pointer parameter. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: dummy kernel "install" multicast routesDavid Lamparter2015-02-061-8/+29
| | | | | | | | | | | | | | | | | This is a followup to 9511633 ("zebra: MBGP routes should not be installed in the kernel"), which was correct in disabling MRIB routes being installed in the kernel, yet broke the MRIB since now routes were never marked as active. Hence, push down the check into the kernel install functions, so that the routes are still marked active. At the same time, the FPM calls get a check each since otherwise we'd bump the FPM interface on MRIB updates. Fixes: 9511633 ("zebra: MBGP routes should not be installed in the kernel") Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: fix optional distance on static mrib routeDavid Lamparter2015-02-061-8/+31
| | | | | | | | | | | | | | Unfortunately, the quagga CLI parser doesn't support [<1-255>]. Fix by working around with an alias. Replaces the following commits: - zebra: mrib: [no] ip mroute - require distance. - zebra: mrib: [no] ip mroute - make distance optional. (Rewritten as alias) Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: mrib: static route supportEverton Marques2015-02-063-36/+91
| | | | | | | | | | | | | | | | | With the MRIB being independent from the Unicast RIB, there's currently now way to add static routes to the MRIB. Address that by adding a separate set of commands for MRIB static routes. Combines these original patches: - zebra: mrib: ip mroute command to add unicast route to MRIB for multicast RPF. - zebra: mrib: no ip mroute: Fix removal of static multicast RPF route. - zebra: mrib: remove unused static_add/delete_ipv4 - zebra: Cleanups to zebra_rib. - pimd: Merge pim-only branch. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: kill rib_match_ipv4()David Lamparter2015-02-063-9/+2
| | | | | | | | | Since this function is internal to zebra, there is no reason to keep this one-line indirect wrapper to rib_match_ipv4_safi() around. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: mrib: Include BGP routes in RPF lookupsEverton Marques2015-02-063-7/+7
| | | | | | | | | | The rib_match_ipv4() function was previously used only for iBGP recursive nexthop lookups, which ignore eBGP routes. This is not desirable for PIM RPF lookups, which may well use an eBGP route. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: add ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIBEverton Marques2015-02-061-0/+96
| | | | | | | | | | | | | | | | | | | This adds a new zapi call "ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB" performing a Multicast RPF lookup for a given source. Details of the lookup behaviour are left to the zebra side of things. Note: this is non-reactive, as in, only delivers a snapshot of the state at a particular point in time. There's no push notification of changes happening to the RIB. This combines the following 3 original patches: - zebra: add zsend_ipv4_nexthop_lookup_mrib() - zserv: Query mrib (SAFI_MULTICAST). - zebra: Cleanups to zebra_rib. Cc: Everton Marques <everton.marques@gmail.com> Cc: Balaji G <balajig81@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: point rib_match_ipv4() to ._safi()Everton Marques2015-02-061-58/+1
| | | | | | | | | Since rib_match_ipv4() is just rib_match_ipv4_safi() for SAFI_UNICAST, the former can be removed and pointed to the latter instead. Cc: Balaji G <balajig81@gmail.com> Cc: Everton Marques <everton.marques@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: add rib_match_ipv4_safi()Everton Marques2015-02-062-0/+58
| | | | | | | | This is the same as rib_lookup_ipv4(), without the SAFI hardcoded. Cc: Balaji G <balajig81@gmail.com> Cc: Everton Marques <everton.marques@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: identify MRIB on debug messagesDavid Lamparter2015-02-061-1/+4
| | | | | | | | since the same code handles both URIB and MRIB, the debug messages can get rather confusing if the RIB isn't identified. Mark the MRIB in debug messages so we can distinguish that. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>