Don Slice [Wed, 15 Mar 2017 12:43:01 +0000 (08:43 -0400)]
bgpd: Fix labeled-unicast generation and parsing issues
Labeled-unicast updates were being sent with an ipv6 nexthop due to
not setting the mp_nexthop_len or nh_afi. On the receive side, the
prefix length was being incorrectly determined and has been fixed.
Also the stream for bgp_label_buf was not created. All resolved.
Ticket: CM-15260 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by:
Donald Sharp [Fri, 10 Mar 2017 12:59:52 +0000 (07:59 -0500)]
bgpd: Modify attr->flag to be 64 bit
With the some current bgp drafts the Attribute number has
surpassed 32. Which is a bit unfortunate in that we keep
track of the attributes via a bitfield based on the attribute #.
For the moment since I am not aware of Attribute #'s being
greater than 64, convert the flag to 64 bit and allow the
bit shifting to know about it.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
bgpd, lib, zebra: Implement handling of BGP-Prefix-SID label Index
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.
bgpd: This patch implements the exchange of the BGP-Prefix-SID label index attr
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.
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.
Don Slice [Thu, 9 Mar 2017 14:54:20 +0000 (09:54 -0500)]
bgpd: labeled unicast processing
Implement support for negotiating IPv4 or IPv6 labeled-unicast address
family, exchanging prefixes and installing them in the routing table, as
well as interactions with Zebra for FEC registration. This is the
implementation of RFC 3107.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Don Slice [Thu, 2 Feb 2017 17:58:33 +0000 (12:58 -0500)]
zebra: labeled unicast handling
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>
Don Slice [Wed, 1 Feb 2017 18:10:56 +0000 (13:10 -0500)]
zebra: fec register
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>
Don Slice [Tue, 27 Dec 2016 15:09:28 +0000 (07:09 -0800)]
zebra: static label binding
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>
Donald Sharp [Tue, 4 Apr 2017 19:20:52 +0000 (15:20 -0400)]
vtysh: Fix build for non-snmp case
The snmp code is being included in the build of the vtysh_cmd.c
irrelevant of whether or not it is needed. Be a bit smarter
about what files to include.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Tue, 4 Apr 2017 19:25:19 +0000 (21:25 +0200)]
build: fix CFLAGS for snmp modules
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>
Quentin Young [Mon, 3 Apr 2017 20:17:12 +0000 (20:17 +0000)]
ospfd, ospf6d: fix distance commands
OSPF distance commands were broken in a variety of ways. Fix 'em.
* `distance ospf` and `distance ospf6` were accepted commands
* Inconsistent doc strings
* Make use of {keyword|tokens}
* Add ability to reset specific distance without specifying a value
Ex: ~# no distance ospf6 intra
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Renato Westphal [Thu, 30 Mar 2017 14:33:08 +0000 (11:33 -0300)]
ldpd: do not consume vty_conf when updating the configuration
David Lamparter gave the idea of keeping vty_conf as a permanent copy of
ldpd_conf in order to simplify the CLI code and facilitate the integration
with his cap'n proto framework in the future. Doing this demanded quite
some effort but it was worth it as the code looks much better now.
David Lamparter [Fri, 31 Mar 2017 14:37:23 +0000 (16:37 +0200)]
lib: Linux indentation on memory.[ch]
The fact that I originally wrote this in Linux Kernel style and then
reindented it to GNU makes me want to gouge my eyes out every time I
look at it. Restore original indentation.
[This patch is whitespace-only.]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Renato Westphal [Fri, 31 Mar 2017 01:15:33 +0000 (22:15 -0300)]
ldpd: extend the ldp_config_normalize() function
* remove superfluous parts of the configuration when possible
(e.g. interfaces that are disabled for both IPv4 and IPv6);
* move the check of whether the pseudowire is active or not from
merge_l2vpns() to ldp_config_normalize() where it belongs.
Renato Westphal [Fri, 31 Mar 2017 00:58:47 +0000 (21:58 -0300)]
ldpd: fix configuration of non-existing VPLS interfaces and pseudowires
If we don't know the ifindex, flags, etc of an interface at the time it's
configured, we should make sure that once this information is available
the appropriate structures are updated.
Renato Westphal [Thu, 30 Mar 2017 23:26:17 +0000 (20:26 -0300)]
ldpd: remove the interface vty node
ldpd uses a hierarchical configuration model where all commands are
defined inside the "mpls ldp" node and its subnodes. The idea is to keep
all LDP configuration in a single place to keep things simple. With that
said, we can remove the "config-if" node from ldpd because we already
have a separate node ("config-ldp-af-if") for LDP-related interface
specific commands.
David Lamparter [Mon, 11 Jan 2016 15:02:49 +0000 (16:02 +0100)]
lib: make sure SEGV handler cannot lock up
Just adding -pthread to gcc options changes libc's behaviour, e.g.
making malloc() use proper locking. This means a SEGV inside malloc()
(e.g. because malloc bookkeeping structures have been damaged by writing
to a broken pointer) can lead to a lockup by the following chain:
This will hang forever waiting for the malloc() lock to be released.
Another failure mode is dynamic linking with lazy binding (-z lazy,
default). Since backtrace() is seldomly used, this means the call to
backtrace() in the core handler can in fact result in the dynamic linker
trying to resolve the "backtrace" symbol, which can also deadlock.
Add several safeguards to prevent any of this from happening.
(Unfortunately, these are not theoretical issues - I found them by
running into them headfirst.)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Renato Westphal [Thu, 30 Mar 2017 23:19:16 +0000 (20:19 -0300)]
ldpd: no need to synchronize pseudowires with LSPs anymore
Since commit 595b4be, the l2vpn_pw_ok() function doesn't check if there's
a working LSP to the remote end of the pseudowire (we assume that zebra
will do that for us). With that said, the l2vpn_sync_pws() function is
not necessary anymore.
David Lamparter [Wed, 22 Mar 2017 09:45:51 +0000 (10:45 +0100)]
lib: sandbox: print vtysh daemon targets
This is very useful to check whether a command disappeared from a
specific daemon (by comparing against an earlier output of
"grammar find-ambiguous printall nodescan")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 22 Mar 2017 09:22:14 +0000 (10:22 +0100)]
vtysh: parsing fixes on distribute-list
The vtysh preprocessing stuff doesn't like the first argument to
install_element() being something other than a _NODE constant, and the
comment hack wasn't cutting it... just expand this.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Wed, 22 Mar 2017 09:38:22 +0000 (10:38 +0100)]
*: apply DEFUN_NOSH for node-switch CLI commands
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>
Renato Westphal [Tue, 28 Mar 2017 00:39:27 +0000 (21:39 -0300)]
doc: minor tweaks in the build instructions
* ldpd is built by default in all platforms, it's not necessary to
provide --enable-ldpd anymore;
* Remove comment about ldpd not being tested on OpenBSD, it works very
well on this platform;
* Provide instructions to enable MPLS forwarding in OpenBSD.