summaryrefslogtreecommitdiffstats
path: root/zebra (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp2017-05-024-1/+21
|\
| * zebra: fix detection of interface renamesRenato Westphal2017-05-013-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restore the original logic in netlink_link_change() which works like this: * once an interface event is detected, lookup the associated interface by its name; * call the set_ifindex() function; * set_ifindex() will lookup the interface again but now by its ifindex. If the lookups by name and ifindex yield to different results, then the interface was renamed and set_ifindex() will take care of that. In the future, zns->if_table will be split into two different data structures to allow faster lookups by both name and ifindex. Fixes Issue #397. Regression introduced by commit 12f6fb9. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * zebra: fix infinite loop when deleting non-default vrfRenato Westphal2017-04-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How to reproduce the bug: % ip link add vrf-red type vrf table 10 % ip link set dev vrf-red up % ip rule add oif vrf-red table 10 % ip rule add iif vrf-red table 10 % ip link add name lo1 type dummy % ip link set dev lo1 up % ip link set dev lo1 master vrf-red % ip link del dev vrf-red (zebra gets stuck in an infinite loop inside work_queue_run()) Regression introduced by commit 5a8dfcd8. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * lib: fix segfault on exit caused by interface removalRenato Westphal2017-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add missing bits to properly unlink interface in the if_unlink_per_ns() function. In the long term we should convert if_table to use a more convenient data structure like a red-black tree instead of a routing table. Fixes issue #398. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #410 from dslicenc/rdnbrd-vrrMartin Winter2017-05-021-0/+16
|\ \ | | | | | | zebra: fix attempt to install a second rib from imported table entries
| * | zebra: fix attempt to install a second rib from imported table entriesDon Slice2017-04-261-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported by a customer with prefix imported by rdnbrd not being successfully installed in the quagga rib. Determined that this was due to VRR resolving the same arp entry, causing two entries to be installed in table 10. When these were imported into the quagga rib, they came in as two different rib entries from the same table/instance, which is not permitted and caused them to be deleted. Added logic to zebra_add_import_table_entry to do the same actions as rib_add and delete the older rib entry if a new rib entry is received which matches. Manual testing successful and automated tests for redistribute neighbor have the same passes and failures as the base. Ticket: CM-15926 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by:
* | | Merge pull request #384 from donaldsharp/dr2Martin Winter2017-04-273-3/+57
|\ \ \ | | | | | | | | Add source of route as protocol string in ip route pushed into kernel
| * | | Add source of route as protocol string in ip route pushed into kernelDinesh G Dutt2017-04-213-3/+57
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ticket: CM-14313 Reviewed By: Testing Done: bgpmin, ospfmin, bgp_kitchen_sink_test 'ip route show' displays all routes as belonging to protocol zebra. The user has to run an additional command (in vtysh) to get the actual source of a route (bgp/ospf/static etc.). This patch addresses that by pushing the appropriate protocol string into the protocol field of the netlink route update message. Now you can see routes with the correct origin as well as filter on them (ip route show proto ospf). 'ospf' is used for both IPv4 and IPv6 routes, even though the OSPF version is different in both cases. Sample output (old): 9.9.12.13 via 69.254.2.38 dev swp3.2 proto zebra metric 20 9.9.13.3 proto zebra metric 20 nexthop via 69.254.2.30 dev swp1.2 weight 1 nexthop via 69.254.2.34 dev swp2.2 weight 1 nexthop via 69.254.2.38 dev swp3.2 weight 1 Sample output (new): 9.9.12.13 via 69.254.2.38 dev swp3.2 proto bgp metric 20 9.9.13.3 proto bgp metric 20 nexthop via 69.254.2.30 dev swp1.2 weight 1 nexthop via 69.254.2.34 dev swp2.2 weight 1 nexthop via 69.254.2.38 dev swp3.2 weight 1
* | | zebra: stop crash on process termination due to stale ifp->nodeDon Slice2017-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem reported that crash occurred when stopping quagga in certain circumstances. Determined that this was due to a stale pointer on the ifp for a deleted interface. The ifp->node had been freed but the ifp still kept a pointer to it, and when later the process was stopped, it attempted to delete it again. Ticket: CM-15550 Signed-off-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Add some more checks to fec [un]registrationDonald Sharp2017-04-151-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Be a bit more rigoruous about what we can receive from another protocol and attempt to make the code less likely to crash and to just safely bail out when an error is received. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Fix whitespace issue with if statementDonald Sharp2017-04-151-2/+2
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Allow explicit-null as a label optionDonald Sharp2017-04-151-2/+10
| | | | | | | | | | | | | | | | | | | | | When entering 'mpls label bind ...' command allow the explicit-null as an option. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Fix crash with dereference of NULL pointerDonald Sharp2017-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | We only create the v4 and v6 mpls fec tables currently. Follow the code pattern for the rest of the code and ensure that the table exists before we attempt to access it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Experimental commit to see if this fixes snap buildsDonald Sharp2017-04-071-1/+1
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Get mpls building across multiple platforms.Donald Sharp2017-04-062-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | The build system for mpls is a bit convoluted. We need a way to handle builds across multiple platforms. This, I believe addresses this issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Fix usage of HAVE_CUMULUSDonald Sharp2017-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | | The function zebra_mpls_lsp_label_consistent needs to be wrappered by HAVE_CUMULUS Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | zebra: Fix gcc compile warn->error issueDonald Sharp2017-04-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | flags is set but never used. Since we plan to use it in the future, make it evident what is going on here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label IndexVivek Venkatraman2017-04-064-16/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement BGP Prefix-SID IETF draft to be able to signal a labeled-unicast prefix with a label index (segment ID). This makes it easier to deploy global MPLS labels with BGP, even without other aspects of Segment Routing implemented. This patch implements the handling of the BGP-Prefix-SID Label Index attribute. When received from a peer and the index is acceptable, the local label is picked up from the SRGB and is programmed as the incoming label as well as advertised to peers. If the index is not acceptable, no local label is assigned. The outgoing label will always be the one advertised by the downstream neighbor. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* | | bgpd, zebra: Implement BGP Prefix-SID IETF draftVivek Venkatraman2017-04-065-0/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement BGP Prefix-SID IETF draft to be able to signal a labeled-unicast prefix with a label index (segment ID). This makes it easier to deploy global MPLS labels with BGP, even without other aspects of Segment Routing implemented. This patch implements configuration of the global label block (SRGB) and configuration of a label-index for a network in BGP. Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* | | zebra: labeled unicast handlingDon Slice2017-04-067-63/+483
| | | | | | | | | | | | | | | | | | | | | | | | | | | Support install of labeled-unicast routes by a client. This would be BGP, in order to install routes corresponding to AFI/SAFI 1/4 (IPv4) or 2/4 (IPv6). Convert labeled-unicast routes into label forwarding entries (i.e., transit LSPs) when there is a static label binding. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | | zebra: fec registerDon Slice2017-04-065-9/+448
| | | | | | | | | | | | | | | | | | | | | | | | Implement interface that allows a client to register a FEC for obtaining a label binding (in-label). Update client whenever the label binding is updated and cleanup when client goes away. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | | zebra: static label bindingDon Slice2017-04-064-0/+506
|/ / | | | | | | | | | | | | | | | | | | Implement static label binding of a label to a prefix (FEC). Note: Currently, only binding to a prefix is supported, the nexthop and/or other parameters are not considered. This was cherry-picked by hand from an earlier mpls branch. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
* | Merge pull request #332 from opensourcerouting/snmp-fixDonald Sharp2017-04-041-0/+1
|\ \ | | | | | | fix SNMP build
| * | build: fix CFLAGS for snmp modulesDavid Lamparter2017-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SNMP modules include <net-snmp/net-snmp-config.h>, which won't be found in off-searchpath directories without SNMP_CFLAGS. Unfortunately in my tests the files were on the search path even without the flags. (SNMP_LIBS is not needed because only libfrrsnmp calls into net-snmp functions.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | Merge pull request #329 from dwalton76/debug-zebra-nhtDavid Lamparter2017-04-041-0/+5
|\ \ \ | |/ / |/| | zebra: "debug zebra nht" is not in the config
| * | zebra: "debug zebra nht" is not in the configDaniel Walton2017-04-041-0/+5
| | | | | | | | | | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | Merge branch 'master'David Lamparter2017-04-0412-151/+114
|\| |
| * | Merge pull request #294 from opensourcerouting/modulesDonald Sharp2017-04-0412-151/+114
| |\ \ | | | | | | | | Loadable module support
| | * | zebra: fpm: convert into moduleDavid Lamparter2017-03-258-137/+78
| | | | | | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * | *: snmp: convert into modulesDavid Lamparter2017-03-254-13/+31
| | | | | | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * | build: split off libfrrsnmpDavid Lamparter2017-03-251-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * | lib: add hook infrastructureDavid Lamparter2017-03-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Please refer to lib/hook.h for a description/documentation. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| | * | zebra: fpm: fix protobuf compileDavid Lamparter2017-03-241-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | | Merge branch 'stable/2.0'David Lamparter2017-04-042-2/+4
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | Fixed minor conflicts from "defaults" change on stable. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | | zebra: zebra_fpm_dt.c does not always need protobufDonald Sharp2017-03-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling zebra_fpm_dt.c only pull in protobuf headers if we've turned it on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | zebra: Fix protobuf build on stable/2.0Donald Sharp2017-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling w/ --enable-protobuf on stable/2.0 we were attempting to dereference the zvrf->vrf_id which got moved to zvrf->vrf->vrf_id. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | | Merge pull request #321 from donaldsharp/speedDavid Lamparter2017-04-043-2/+47
|\ \ \ \ | | | | | | | | | | Speedy McSpeederson
| * | | | zebra: Fix printf formattingDonald Sharp2017-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | | lib, zebra: Fix CR commentsDonald Sharp2017-04-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib -> Add a bit of documentation about what units we are in. zebra -> Fix failure case to be a bit better. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | | zebra: Display new speed information in 'show int..' commandDonald Sharp2017-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | | zebra: Retrieve interface speed when creating interfaceDonald Sharp2017-04-031-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we get notification from the kernel about the creation of a new interface, retrieve the speed of it from the kernel Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | | | lib, zebra: Add ability to pass interface speed up from zebraDonald Sharp2017-04-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a prepatory commit for future improvements. Add a change to the zapi to pass the interface speed up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | | | | zebra: fix v4/v6 typos in some show commandsRenato Westphal2017-04-041-4/+4
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a few problems like this one: vtysh# show ipv6 route ospf6 Unknown route type Also, replace SAFI_UNICAST with SAFI_MULTICAST in the "show ipv6 mroute vrf all" command. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | | | Merge pull request #297 from opensourcerouting/ldpd-openbsdDonald Sharp2017-03-301-12/+127
|\ \ \ \ | | | | | | | | | | Add support for MPLSv6 in OpenBSD + minor fixes
| * | | | zebra-mpls: replace legacy bzero by memsetRenato Westphal2017-03-281-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bzero() was deprecated in POSIX.1-2001 and removed in POSIX.1-2008 in deference to memset(). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | | | zebra-mpls: add support for MPLSv6 in OpenBSDRenato Westphal2017-03-281-8/+123
| | |/ / | |/| | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* / | | *: apply DEFUN_NOSH for node-switch CLI commandsDavid Lamparter2017-03-281-2/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | These have copies in vtysh that do the node-switch locally and are listed in extract.pl's ignore list. The ignore list however is redundant since DEFUN_NOSH does the same thing... ldpd is a bit hacky, but Renato is reworking this anyway. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | | lm: Fix some errors detected by Coverity Scanßingen2017-03-221-0/+2
| | |
* | | Merge pull request #285 from bingen/label_manager_3Donald Sharp2017-03-216-10/+590
|\ \ \ | | | | | | | | Implement generic label manager
| * | | Implement generic label managerßingen2017-03-206-10/+590
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Label Manager allows to share MPLS label space among different daemons. Each daemon can request a chunk of consecutive labels and release it if it doesn't need them anymore. Label Manager stores the daemon protocol and instance to identify the owner client. It uses them to perform garbage collection, releasing all label chunks from a client when it gets disconnected or reconnected. Additionally, every client can request that the chunk is never garbage collected. In that case client has the responsibility to release non-used labels. Zebra can host the label manager itself (if no -l param is provided) or connect to an external one using zserv/zclient (providing its address with -l param). Client code is in lib/zclient.c, but currently only LDP is using it. TODO: Allow for custom ranges requests, i.e., specify the start label besides the chunk. TODO: Release labels from LDP. Signed-off-by: Bingen Eguzkitza <bingen@voltanet.io>