summaryrefslogtreecommitdiffstats
path: root/zebra (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1263 from vjardin6WIND/cleanupQuentin Young2017-10-031-0/+1
|\ | | | | Cleanup - scan-build
| * scan-build: cleanup some warningsVincent JARDIN2017-10-021-0/+1
| | | | | | | | | | | | | | Current cleanup is for unset values or variables that are not used anymore. Regarding ospfd/ospf_vty.c: argv_find() we'll never get it NULL, so get coststr = argv[idx]->arg;
* | Merge pull request #1277 from donaldsharp/zebra_crashRenato Westphal2017-10-023-10/+17
|\ \ | | | | | | Zebra crash and valgrind issues
| * | zebra: Cleanup ptm memory *after* we tell the sockets to clean upDonald Sharp2017-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zebra_ptm_finish() code was being called before the client_list deletion. The client_list deletion is attempting to call the ptm daemon and shut down the connection. We should not be doing this *after* we shut down memory associated with it as that we were writing into memory in random spots in this case. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | zebra: Properly initialize memory for rtadvDonald Sharp2017-10-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The adata pointer was not properly being set to 0 before being used. In addition notice malloc failure and hard exit. If we have no memory on startup something terrible has gone wrong and we were going to crash shortly here anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | zebra: Fix valgrind report of unintialized dataDonald Sharp2017-10-021-7/+12
| |/ | | | | | | | | | | | | When calling the kernel we are not properly initializing iov and msg on function startup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #1254 from donaldsharp/irdp_no_crashRenato Westphal2017-10-022-0/+44
|\ \ | |/ |/| zebra: Fix irdp so it doesn't crash when looked at
| * zebra: Fix irdp so it doesn't crash when looked atDonald Sharp2017-09-272-0/+44
| | | | | | | | | | | | | | | | | | irdp is crashing because it assumes that people have configured it in a certain way. Ensure that this 'way' is honored at least enough so that we don't crash. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #1236 from donaldsharp/interface_startupRenato Westphal2017-09-292-0/+11
|\ \ | | | | | | zebra: Do not allow same rib_dest_t be queued multiple times to meta …
| * | zebra: Do not allow same rib_dest_t be queued multiple times to meta queueDonald Sharp2017-09-252-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have already scheduled a node to be on the meta_queue, there is no need to schedule it up again. On startup we are calling rib_update() multiple times per connected route. Due to the multiple ways we can get callbacks for adding a connected route I decided it was best to just improve meta_queue performance as opposed to trying to figure out all the different ways across all the platforms that we can decide that a connected route has changed. This appears to solve the issue with a very large # of interfaces coming up at the same time on startup. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | Merge pull request #1180 from dwalton76/ipv6-static-route-null0Renato Westphal2017-09-271-35/+151
|\ \ \ | | | | | | | | Ipv6 static route null0
| * | | zebra: split ip route DEFUNs for blackhole, reject, etcDaniel Walton2017-09-271-17/+135
| | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
| * | | zebra: cleanup reject vs blackhole vs null0 vs Null0Daniel Walton2017-09-201-80/+22
| | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
| * | | zebra: cleanup reject vs blackhole vs null0 vs Null0Daniel Walton2017-09-141-36/+92
| | | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* | | | Merge branch 'master' into bgpd-debug-updates-prefixDaniel Walton2017-09-2711-159/+158
|\ \ \ \
| * \ \ \ Merge pull request #1240 from donaldsharp/allow_self_deleteRenato Westphal2017-09-277-15/+39
| |\ \ \ \ | | | | | | | | | | | | zebra: Do not allow delete of route from kernel in non-startup case
| | * | | | zebra: Do not allow delete of route from kernel in non-startup caseDonald Sharp2017-09-257-15/+39
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a continuation of 915902cb82cfd. Basically the netlink read of messages up from the kernel is now noticing the proper owner of the route. As such when rib_delete was being called as part of the upcall from the kernel we were not noticing that we were the originator and not diss-allowing the rib_delete from happening. This restores this behavior that we were getting pre-915902cb82cfd Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | | Merge pull request #1249 from donaldsharp/debugodebugRenato Westphal2017-09-271-0/+2
| |\ \ \ \ | | | | | | | | | | | | Debugodebug
| | * | | | zebra: Display if we are debugging zebra vxlan or notDonald Sharp2017-09-261-0/+2
| | | |_|/ | | |/| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * / | | zebra: static nsVincent JARDIN2017-09-261-1/+1
| |/ / / | | | | | | | | | | | | it only for local usage, only accessors are used.
| * | | Merge pull request #1235 from chiragshah6/ospf_vrf_devRenato Westphal2017-09-261-2/+2
| |\ \ \ | | | | | | | | | | zebra: Nexthop APIs to use correct vrf_id
| | * | | zebra: Nexthop APIs to use correct vrf_idChirag Shah2017-09-251-2/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For unnumbered interface lookup vrf aware interface info. Pass vrf aware interface info for route entry's nexthop ifindex in route add path. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
| * | | zebra: make rib_add() a simple wrapper for rib_add_multipath()Renato Westphal2017-09-211-88/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both function were very similar, and as we know code duplication is not good. As an example, in the past couple of weeks some fixes were made on rib_add() but not on rib_add_multipath(), causing known bugs to still exist in a different form. Instead of merging the two functions into one, let's make rib_add() call rib_add_multipath() with the appropriate parameters. This way we remove the code duplication but still keep the easy-to-use rib_add() function for single-path routes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: fix detection of duplicate kernel routes (ECMP version)Renato Westphal2017-09-211-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following bug: % ip route add 50.0.0.0/8 nexthop via 10.0.1.2 nexthop via 10.0.2.2 % ip route replace 50.0.0.0/8 nexthop via 10.0.1.3 nexthop via 10.0.2.3 % ip route replace 50.0.0.0/8 nexthop via 10.0.1.4 nexthop via 10.0.2.4 % % vtysh -c "show ip route" [snip] K * 50.0.0.0/8 [0/0] via 10.0.1.4, rt1-eth1, 00:00:00 * via 10.0.2.4, rt1-eth2, 00:00:00 K * 50.0.0.0/8 [0/0] via 10.0.1.3, rt1-eth1, 00:00:10 * via 10.0.2.3, rt1-eth2, 00:00:10 K>* 50.0.0.0/8 [0/0] via 10.0.1.2, rt1-eth1, 00:00:24 * via 10.0.2.2, rt1-eth2, 00:00:24 Commit a3d18ce6 fixed a similar problem for single-path routes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: fix multihop/multipath confusionRenato Westphal2017-09-211-6/+6
| | | | | | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: install MPLS LSPs with appropriate protocol typeRenato Westphal2017-09-212-2/+23
| | | | | | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: pay attention to metric from kernel (ECMP version)Renato Westphal2017-09-211-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f19435a8 fixed rib_add() but didn't fix rib_add_multipath(). While here, remove the unnecessary 'same->table == re->table' check as it always evaluate to true. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: plug memory leak in rib_add_multipath()Renato Westphal2017-09-211-3/+4
| | | | | | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: use the afi parameter in rib_add_multipath()Renato Westphal2017-09-212-9/+3
| |/ / | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | Merge pull request #1157 from donaldsharp/recursive_blackholeJafar Al-Gharaibeh2017-09-212-21/+25
| |\ \ | | | | | | | | Recursive blackhole resolution
| | * | zebra: Allow recursive nexthop resolution to consider blackholesDonald Sharp2017-09-121-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we get a route install for a route that needs to be recursively resolved allow the blackhole to be considered and used if it is available. This allows bgp to install a route that will be blackholed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| | * | zebra: Allow recursively resolved blackhole routes to be installedDonald Sharp2017-09-121-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So the current code for a blackhole route assumed that you would never want a recursively resolved blackhole to work. Suppose you have this setup: 1) ip route 192.0.2.1/32 Null0 2) BGP installed with a route-map that rewrites the nexthop to 192.0.2.1. Zebra will end up with a recursive nexthop that resolves to the blackhole. The original rib install function assumed that we would never want the ability to recursively resolve a blackhole route. Instead just handle the blackhole as part of the nexthop_num = 1 case. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | zebra: Free leaked zclient data structures on shutdownDonald Sharp2017-09-211-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On shutdown we were deleting the linked list that kept the zclient connections, but we were not freeing the data pointed at by the link list. This modification allows the normal cleanup of the linked list to cleanup the zclient data structure. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | Merge pull request #1160 from opensourcerouting/admin_distanceDonald Sharp2017-09-212-8/+24
| |\ \ \ | | | | | | | | | | Admin distance
| | * | | zebra: fix administrative distance issuesRenato Westphal2017-09-122-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Reuse route_distance() on rib_add_multipath() and on rib_add(); * Set the admin distance of LDP and BGP MPLS LSPs. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| | * | | zebra: Fix up default admin distance for some route typesDonald Sharp2017-09-121-0/+13
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the default admin distance for some route types more appropriately. The route_distance function would return 0 for array items not configured, which is not the right thing to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | zebra: Allow static routes to track how long they've been aroundDonald Sharp2017-09-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Static routes were not keeping track of uptime appopriately and as such we were not properly displaying uptime. Fixes: #1196 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | | zebra: return CMD_SUCCESS when enabling debugsDaniel Walton2017-09-191-5/+5
|/ / /
* | / *: use clang's 'ForEachMacros' format style optionRenato Westphal2017-09-1520-333/+289
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #1163 from donaldsharp/deduplicate_nexthopsRuss White2017-09-134-81/+85
|\ \ | | | | | | zebra: deduplicate nexthops
| * | zebra: Allow 'show ip route...' to display uptime for all routesDonald Sharp2017-09-121-73/+47
| | | | | | | | | | | | | | | | | | | | | Display uptime for all route types instead of just for RIP, OSPFv2, ISIS, NHRP, TABLE? and BGP routes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | zebra: Modify 'show ip route ...' to show duplicated nexthopsDonald Sharp2017-09-121-3/+17
| | | | | | | | | | | | | | | | | | | | | Add the ability for person issuing 'show ip route...' commands to see if we've suppressed adding a nexthop to the kernel. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | zebra: deduplicate nexthopsDavid Lamparter2017-09-123-5/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | There exists situations where it is possible to have duplicate nexthops passed from a higher level protocol into zebra. This code notices this duplication of nexthops and marks the duplicates as DUPLICATE so we don't attempt to install it into the kernel. This is important on *BSD as I understand it because passing duplicate nexthops will cause the route to be rejected. Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | zebra: api.vrf_id should be re->vrf_idDaniel Walton2017-09-121-1/+1
| | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> This fixes route redistribution for VRFs
* | zebra: Fix rib_update_tableDonald Sharp2017-09-111-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | We should only be operating RIB_UPDATE_IF_CHANGE on types that zebra has control of. We assume that the calling routing protocol is going to take care of their own route changes based upon the interface state change. Also try to re-organize the code a tiny bit to allow it to fit better within a tabed world. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | zebra: Fixup indentationDonald Sharp2017-09-114-16/+27
| | | | | | | | | | | | | | | | RNODE_FOREACH_RE... function calls were not properly being indented when we switched over to the new format. Let's fix this issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | zebra: Small performance improvement for garbage collectionDonald Sharp2017-09-111-3/+5
|/ | | | | | | There is no need to retrieve the zvrf *unless* we are doing debugs. So move the retrieval under the debug statement. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #1084 from donaldsharp/zebra_frameDavid Lamparter2017-09-111-2/+2
|\ | | | | zebra: Fix vty_frame usage in zebra
| * zebra: Fix vty_frame usage in zebraDonald Sharp2017-08-311-2/+2
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | zebra: allow multiple connected routes for the same prefixRenato Westphal2017-09-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With unnumbered interfaces on Linux we have the same IP address configured on several different interfaces and hence multiple connected routes for the same prefix. With that said, add an exception in rib_add() to allow zebra to keep track of all connected routes. We don't need to worry about the bugs reported in a3d18ce because connected routes are always added from the connected_up() function, and connected_update() already takes care of handling duplicate addresses per interface. Fixes #1112. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>