Julien Courtat [Tue, 17 May 2016 14:26:22 +0000 (16:26 +0200)]
bgpd: configure preserve forwarding state from vty
Preserve forwarding state bit can be set in OPEN message with the use of
new vty commands
bgp graceful-restart preserve-fw-state
no bgp graceful-restart preserve-fw-state
This must be set before activating the connection to a peer, since it is
for forging graceful restart capability of OPEN messages.
Julien Courtat [Fri, 20 May 2016 10:10:07 +0000 (12:10 +0200)]
bgpd: enable send of Graceful Restart Preserve State F bit
Enhance struct bgp to add a new flag BGP_FLAG_GR_PRESERVE_FWD, which
allow to set the Preserve State F bit of Graceful Restart capability in
OPEN messages.
Olivier Dugeon [Tue, 20 Dec 2016 14:02:34 +0000 (15:02 +0100)]
Rationalize Link Parameters flags
* lib/if.h: Remove LP_TE as Link Parameters is set if different from 0
See IS_LINK_PARAMS_SET macro and use LP_TE_METRIC to determine if TE metric
is set or not
* lib/if.c: replace LP_TE by LP_TE_METRIC in default LP status
* zebra/interface.c: replace LP_TE by LP_TE_METRIC and check if TE metric
is equal to standard metric or not
* ospfd/ospf_te.c: replace LP_TE by LP_TE_METRIC
* isisd/isis_te.c: replace LP_TE by LP_TE_METRIC
Julien Courtat [Fri, 17 Jun 2016 13:31:09 +0000 (15:31 +0200)]
bgpd: support End-Of-Rib of VPNv4 address family
After graceful restart procedure, when BGP speaker has finished to send
its VPNv4 routes to the restarting peer, it also sends End-Of-Rib
message for afi=AFI_IPv4 safi=SAFI_MPLS_VPN.
Julien Courtat [Wed, 25 May 2016 15:28:31 +0000 (17:28 +0200)]
bgpd: graceful restart for vpnv4 address family
This patch enable the support of graceful restart for routes sets with
vpnv4 address family format. In this specific case, data model is
slightly different and some additional processing must be done when
accessing bgp tables and nodes.
The clearing stale algorithm takes into account the specificity where
the 2 node level for MPLS has to be reached.
Signed-off-by: Julien Courtat <julien.courtat@6wind.com> Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Donald Sharp [Wed, 4 Jan 2017 13:03:14 +0000 (08:03 -0500)]
lib: Update ZAPI to version 4 and HEADER_MARKER to 254
Update the ZEBRA_HEADER_MARKER to 254. This will differentiate
ourselves from Quagga. Zebra should not listen to people not
properly using the right programs now.
Update the ZAPI version number to 4.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 12 Dec 2016 12:59:16 +0000 (07:59 -0500)]
lib: Partial Revert of 4ecc09d and modify zclient connect behavior
Commit 43cc09d has been shown to cause several issues with clients
connecting.
Partial revert, since I wanted to keep the debug logs added
for that commit, as well remove the piece of code that
stops attempting to connect to zebra. If we've failed
a bunch of times, there is nothing wrong with continuing
to do so once every 60 seconds. I've debug guarded
the connect failure for those people running bgp
without zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Lou Berger [Fri, 4 Nov 2016 13:30:07 +0000 (09:30 -0400)]
rfapi: pickup recent changes
expose bgp_rfapi_get_group_by_lni_label for use by rfp
add EVPN Ethernet Tag (VID) RT
ensure as is init'ed
fix spelling of information
G. Paul Ziemba [Fri, 4 Nov 2016 16:47:36 +0000 (09:47 -0700)]
BGP: deal with vnc related string ambiguities (issue #9)
- "redist foo" parsing modified to check for foo==vnc and foo==vnc-direct
instead of just leading 'v' character
- string designating ZEBRA_ROUTE_VNC_DIRECT changed from "vpn" to "vnc-direct"
- route_types.pl parser recognizes 7th field to restrict availability
of a route type in the redist command to specific daemons
- restrict "vnc-direct" to bgpd only (doesn't make sense elsewhere)
- vnc documentation updated to match
Renato Westphal [Fri, 16 Dec 2016 12:48:37 +0000 (10:48 -0200)]
zebra: fix FIB route updates on *BSD
On *BSD, we update a route in the FIB by removing the old one and then
installing the new version.
With that said, on kernel_route_rib() we need to provide a pointer to
both the old version and the new version of the route.
We were, however, passing a pointer to the new version to both the
'old' and 'new' parameters. This is not a problem on Linux, which uses
NLM_F_REPLACE to update routes, but it breaks route updates on *BSD
because the 'old' parameter points to a route that is not installed in
the kernel. The kernel_route_rib() function then fails to uninstall the
supposedly 'old' route and can fail to install the new version as well if
the kernel doesn't support ECMP (e.g. FreeBSD with default configuration).
David Lamparter [Tue, 20 Dec 2016 17:10:30 +0000 (18:10 +0100)]
build: replace some hardcoding with ./configure
Several places have paths and names that can change hardcoded, e.g. the
package name and the /var/run path. This fixes a few of them, there's
still some to do.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 23 Nov 2016 18:20:15 +0000 (19:20 +0100)]
lib: parser: remove startnode & sentence_root
This removes an artificial restriction for the first token in a
command's graph to be a WORD_TKN. The intention seems to be to prohibit
empty paths through a command, and to restrict "explosion" of choices in
the root node.
The better approach to the former is to check for an empty path after
the definition is parsed. The latter will happen anyway, by duplication
of the command, which just makes it worse...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 16 Dec 2016 19:43:26 +0000 (20:43 +0100)]
lib: parser: accept number-only word tokens
There seems to be no reason why numbers don't work as plain word tokens;
this is useful to have "number choices" or constants, e.g. <128|192|256>
for bit encryption lengths.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Fri, 16 Dec 2016 16:33:31 +0000 (17:33 +0100)]
build: automake 1.12 to deal with flex & bison
bison conditionally writes its output to different files based on the
filenames specified in the source code. This could be disabled,
however... flex changes its output filenames when "prefix" is
specified. And ylwrap from <1.11 doesn't understand how to handle the
header file...
...so this requires automake 1.12 which can deal with this properly.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 15 Dec 2016 22:20:04 +0000 (23:20 +0100)]
tests: adjust testcli ref output to new argv rules
Now that we have keyword argument support in the matcher again, this
needs to be updated because argv[] will be 1:1 user input without
mangling or reordering.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 15 Dec 2016 22:53:02 +0000 (23:53 +0100)]
lib: parser: fix SEGV when Tab hits non-WORD_TKN
If <Tab> processing finds that there is only 1 candidate, but that
candidate is not a WORD_TKN that we can tab-complete on, the status
would remain at CMD_COMPLETE_FULL_MATCH, but the resulting list of
possible completions is empty.
This then SEGVs in lib/vty.c where it tries to access the first element
of the list, assuming FULL_MATCH always has 1 element there...
Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Cc: Quentin Young <qlyoung@cumulusnetworks.com>
David Lamparter [Fri, 18 Nov 2016 14:56:18 +0000 (15:56 +0100)]
lib: parser: support keyword arguments
This re-adds "{foo WORD|bar WORD}" keyword-argument support to the CLI
parser. Note that token graphs may now contain loops for this purpose;
therefore the matching functions retain a history of already-matched
tokens. Each token can thus only be consumed once.
And then LINE... gets its special treatment with allowrepeat.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Fredi Raspall [Wed, 30 Nov 2016 18:15:07 +0000 (19:15 +0100)]
zebra_mpls. Set best lsp nhlfe to null on deletion
When a nhlfe was deleted and it happened to be the best,
lsp->best_nhlfe was not updated causing lsp_process() to see
an inexistent nhlfe.
Fix: set lsp->best_nhlfe to null on deletion.
Donald Sharp [Mon, 12 Dec 2016 12:59:16 +0000 (07:59 -0500)]
lib: Partial Revert of 4ecc09d and modify zclient connect behavior
Commit 43cc09d has been shown to cause several issues with clients
connecting.
Partial revert, since I wanted to keep the debug logs added
for that commit, as well remove the piece of code that
stops attempting to connect to zebra. If we've failed
a bunch of times, there is nothing wrong with continuing
to do so once every 60 seconds. I've debug guarded
the connect failure for those people running bgp
without zebra.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Renato Westphal [Mon, 12 Dec 2016 20:35:30 +0000 (18:35 -0200)]
ldpd: add missing check on disc_find_iface()
When we find an interface on disc_find_iface(), we need to check if it's
enabled for the address-family (IPv4 or IPv6) of the received packet. We
were doing that only for targeted hellos, do it for link hellos as well.
Renato Westphal [Thu, 8 Dec 2016 19:36:03 +0000 (17:36 -0200)]
zebra: fix segfault on exit when RIB debugging is enabled
Fixes the following crash on exit:
(gdb) bt
0 _rnode_zlog (...) at zebra_rib.c:104
1 0x0000000000417726 in rib_unlink (...) at zebra_rib.c:2370
2 0x000000000042db80 in zebra_rtable_node_destroy (...) at zebra_vrf.c:336
3 0x00007ffff7b6ce2e in route_node_free (...) at table.c:81
4 0x00007ffff7b6ced7 in route_table_free (...) at table.c:118
5 0x00007ffff7b6cd88 in route_table_finish (...) at table.c:53
6 0x000000000042defa in zebra_vrf_delete (...) at zebra_vrf.c:278
7 0x00007ffff7b9e044 in vrf_delete (...) at vrf.c:162
8 0x00007ffff7b9e89f in vrf_terminate () at vrf.c:458
9 0x000000000041027c in sigint () at main.c:205
10 0x00007ffff7b953f2 in quagga_sigevent_process () at sigevent.c:111
11 0x00007ffff7b681dd in thread_fetch (...) at thread.c:1297
12 0x000000000040c7ed in main (...) at main.c:471
To fix the problem, free the table->info pointer only after
route_table_finish() is called for the table.
Donald Sharp [Fri, 9 Dec 2016 13:03:13 +0000 (08:03 -0500)]
bgp: Modify output to be a bit clearer
Modify the 'show ip bgp ...' output to be a bit clearer
on what work it did.
Modify:
root@dell-s6000-02 ~/quagga# vtysh -c "show ip bgp"
BGP table version is 7, local router ID is 6.0.0.9
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
Fix instances that the coccinelle patch didn't catch (or which
coccinelle couldn't parse), and add the patch file for future posterity
(and application to yet-unmerged branches).
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>