]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoospf6d: ECMP for external routes
Chirag Shah [Thu, 15 Feb 2018 03:02:11 +0000 (19:02 -0800)]
ospf6d: ECMP for external routes

The route being added check its origin matches,
with any of the existing path (list of paths).
Remove the existing path, add if its cost is
eqaual or less than any of the existing path.

For a given route and of existing path cost is lower
(better) than one being added, discard new route update.

The existing path cost is higher (lower) than one being
added, ospf6_route_add replaces existing with new route
info.

Compare cost between delete request and with existing
route.

Ticket:CM-16139

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #1784 from donaldsharp/documentation
Martin Winter [Thu, 1 Mar 2018 00:22:27 +0000 (16:22 -0800)]
Merge pull request #1784 from donaldsharp/documentation

FRR: Update Community.md to reflect release process

6 years agoMerge pull request #1805 from donaldsharp/recursion
Russ White [Tue, 27 Feb 2018 23:04:57 +0000 (18:04 -0500)]
Merge pull request #1805 from donaldsharp/recursion

Recursion

6 years agoMerge pull request #1788 from mkanjari/evpn-bugs
Russ White [Tue, 27 Feb 2018 16:40:24 +0000 (11:40 -0500)]
Merge pull request #1788 from mkanjari/evpn-bugs

Evpn bugs

6 years agoMerge pull request #1801 from opensourcerouting/vtysh-isis-fixes
Donald Sharp [Tue, 27 Feb 2018 15:42:09 +0000 (10:42 -0500)]
Merge pull request #1801 from opensourcerouting/vtysh-isis-fixes

dev/4.0 merge with IS-IS vtysh fixes

6 years agovtysh: Fix missing \n at end of desc string
Christian Franke [Mon, 26 Feb 2018 17:53:28 +0000 (18:53 +0100)]
vtysh: Fix missing \n at end of desc string

6 years agovtysh: pass route-map & prefix-list commands to isisd and sharpd
Christian Franke [Mon, 26 Feb 2018 17:22:36 +0000 (18:22 +0100)]
vtysh: pass route-map & prefix-list commands to isisd and sharpd

Use VTYSH_RMAP in extract.pl instead of having two lists,
and add isisd and sharpd to VTYSH_RMAP.

6 years agoMerge pull request #1764 from Orange-OpenSource/SR-dev
Russ White [Tue, 27 Feb 2018 13:56:33 +0000 (08:56 -0500)]
Merge pull request #1764 from Orange-OpenSource/SR-dev

OSPFD: Fix Segment Routing Lan Adjacency TLVs

6 years agoMerge pull request #1770 from qlyoung/random-tools
Russ White [Tue, 27 Feb 2018 13:55:38 +0000 (08:55 -0500)]
Merge pull request #1770 from qlyoung/random-tools

*: move random tools into tools/

6 years agoMerge pull request #1772 from qlyoung/fix-keepalive-sentinel
Russ White [Tue, 27 Feb 2018 13:54:58 +0000 (08:54 -0500)]
Merge pull request #1772 from qlyoung/fix-keepalive-sentinel

bgpd: fix incorrect keepalive timer evaluation

6 years agoMerge pull request #1776 from dslicenc/static-inactive-cm19675
Russ White [Tue, 27 Feb 2018 13:51:33 +0000 (08:51 -0500)]
Merge pull request #1776 from dslicenc/static-inactive-cm19675

zebra: fix rnh deleting nht entry

6 years agoMerge pull request #1798 from donaldsharp/centos_systemd
Russ White [Tue, 27 Feb 2018 13:33:29 +0000 (08:33 -0500)]
Merge pull request #1798 from donaldsharp/centos_systemd

doc: Update centos7 build to include systemd

6 years agoMerge pull request #1799 from donaldsharp/route_notify_owner
Russ White [Tue, 27 Feb 2018 13:32:42 +0000 (08:32 -0500)]
Merge pull request #1799 from donaldsharp/route_notify_owner

Route notify owner

6 years agoMerge pull request #1802 from dwalton76/bgpd-multipath-same-link-local
Russ White [Tue, 27 Feb 2018 13:31:06 +0000 (08:31 -0500)]
Merge pull request #1802 from dwalton76/bgpd-multipath-same-link-local

bgpd: use peer->ifp->ifindex instead of peer->ifindex

6 years agoMerge pull request #1711 from pguibert6WIND/issue_385_step5
Renato Westphal [Tue, 27 Feb 2018 13:20:53 +0000 (10:20 -0300)]
Merge pull request #1711 from pguibert6WIND/issue_385_step5

Netns Support / VRF/NS/ogical router rework, along with BGP & OSPF support for multiple VRF with NETNS backend

6 years agoMerge pull request #1804 from msablic/pim_mtrace_doc
Donald Sharp [Tue, 27 Feb 2018 13:10:43 +0000 (08:10 -0500)]
Merge pull request #1804 from msablic/pim_mtrace_doc

pimd: added mtrace caveat

6 years agopimd: added mtrace caveat
Mladen Sablic [Tue, 27 Feb 2018 13:03:39 +0000 (14:03 +0100)]
pimd: added mtrace caveat

Added mtrace caveat to CAVEATS.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
6 years agozebra: prevent from discovering a NS with same NSID as previous one
Philippe Guibert [Fri, 16 Feb 2018 17:22:34 +0000 (18:22 +0100)]
zebra: prevent from discovering a NS with same NSID as previous one

This limitation ignores the creation of a new NS context, when an
already present NS is available with the same NSID. This limitation
removes confusion, so that only the first NS will be used for
configuration.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: retrieve zns context from zvrf when netlink discovery
Philippe Guibert [Tue, 13 Feb 2018 09:48:48 +0000 (10:48 +0100)]
zebra: retrieve zns context from zvrf when netlink discovery

So as to get the correct NETNS where some discovery must be done and
populated, the zns pointer is directly retrieved from zvrf, instead of
checking that the VRF is a backend NETNS or not.
In the case where the interfaces are discovered before the VRF is enabled
( VRF-lite populate), then the default NS is retrieved.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: do not use ENOSYS errno when returning from ns
Philippe Guibert [Mon, 26 Feb 2018 08:14:50 +0000 (09:14 +0100)]
lib: do not use ENOSYS errno when returning from ns

ENOSYS should not be used for other goals.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: netns checkstyle fix
Philippe Guibert [Tue, 13 Feb 2018 09:03:43 +0000 (10:03 +0100)]
lib: netns checkstyle fix

A space is appended between RB_FOREACH and ' ', to comply with style
practiced in frr.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: add debug guard for ns informational traces
Philippe Guibert [Mon, 12 Feb 2018 22:00:04 +0000 (23:00 +0100)]
lib: add debug guard for ns informational traces

Informational traces are being added.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoospfd: basic support for VRF NETNS backend
Philippe Guibert [Mon, 29 Jan 2018 15:56:11 +0000 (16:56 +0100)]
ospfd: basic support for VRF NETNS backend

The change consists in taking into account of the VRF identifier upon
which the ospf socket is created. Moreover, if the VRF is a netns
backend, then it is not necessary to perform the bind operations to vrf
device.
Also, when a VRF instance is enabled, it informs ospf VRF, and automatically
OSPF VRF benefits from it. Reversely, when VRF instance is disabled,
then OSPF VRF will be disabled too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: make bgpd rely on vrf_bind() API usage
Philippe Guibert [Mon, 5 Feb 2018 16:39:37 +0000 (17:39 +0100)]
bgpd: make bgpd rely on vrf_bind() API usage

Instead of relying on local usage of vrf bind operation, the vrf API for
that usage is done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
fixup bgp

6 years agolib: add vrf-lite bind capability to vrf APIs
Philippe Guibert [Mon, 5 Feb 2018 16:28:51 +0000 (17:28 +0100)]
lib: add vrf-lite bind capability to vrf APIs

Because socket creation is tightly linked with socket binding for vrf
lite, the proposal is made to extend socket creation APIs and to create
a new API called vrf_bind that applies to vrf lite. The passed interface
name is the interface that will be bound to the socket passed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: add vrf_ioctl API
Philippe Guibert [Mon, 5 Feb 2018 16:00:45 +0000 (17:00 +0100)]
lib: add vrf_ioctl API

That API can be used to wrap the ioctl call with various vrf instances.
This permits transparently doing the ioctl() call without taking into
consideration the vrf backend kind.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: no need to initialise netns directly
Philippe Guibert [Mon, 5 Feb 2018 15:37:49 +0000 (16:37 +0100)]
bgpd: no need to initialise netns directly

NETNS is initialised from the VRF, instead of being directly called,
because this is not up to BGP daemon to initialise the various VRF
backend.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agovtysh: change logical router node name
Philippe Guibert [Mon, 5 Feb 2018 15:36:13 +0000 (16:36 +0100)]
vtysh: change logical router node name

The logical router node goes from NS_NODE to LOGICALROUTER_NODE.
Vty commands are renamed accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: adapt the vrf and logical router initialisation
Philippe Guibert [Mon, 5 Feb 2018 15:30:21 +0000 (16:30 +0100)]
zebra: adapt the vrf and logical router initialisation

The zebra daemon introduces the logical router initialisation.
Because right now, the usage of logical router and vrf NETNS is
exclusive, then the logical router and VRF are initialised accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: split logicalrouter and vrf netns feature
Philippe Guibert [Mon, 5 Feb 2018 15:23:42 +0000 (16:23 +0100)]
lib: split logicalrouter and vrf netns feature

This split is introducing logicalrouter.[ch] as the file that contains
the vty commands to configure logical router feature. The split has as
consequence that the backend of logical router is linux_netns.c formerly
called ns.c. The same relationship exists between VRF and its backend
which may be linux_netns.c file.
The split is adapting ns and vrf fiels so as to :
- clarify header
- ensure that the daemon persepctive, the feature VRF or logical router
  is called instead of calling directly ns.
- this implies that VRF will call NS apis, as logical router does.

Also, like it is done for default NS and default VRF, the associated VRF
is enabled first, before NETNS is enabled, so that zvrf->zns pointer is
valid when NETNS discovery applies.

Also, other_netns.c file is a stub handler that will be used for non
linux systems. As NETNS feature is only used by Linux, some BSD systems
may want to use the same backend API to benefit from NETNS. This is what
that file has been done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agodoc: add vrfwnetns keyword for zebra in doc
Philippe Guibert [Thu, 1 Feb 2018 17:47:21 +0000 (18:47 +0100)]
doc: add vrfwnetns keyword for zebra in doc

The option to enable VRF backend is documented.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handle some ioctl operations for VRF
Philippe Guibert [Thu, 22 Feb 2018 18:10:32 +0000 (19:10 +0100)]
zebra: handle some ioctl operations for VRF

A new API is available for interface ioctl operations on Linux:
vrf_if_ioctl. This is the unified API that permits doing ioctl
operations on a per interface basis.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: speed ioctl read() with interfaces from various NETNS
Philippe Guibert [Mon, 29 Jan 2018 15:14:46 +0000 (16:14 +0100)]
zebra: speed ioctl read() with interfaces from various NETNS

When interfaces are located on different NETNS ( different VRF), then a
switch from netns context is necessary when calling setns(). The VRF
apis to switch and switch back are called, so that the ioctl will work
accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: do not start BGP VRF peer connection, if VRF not unknown
Philippe Guibert [Tue, 30 Jan 2018 14:30:10 +0000 (15:30 +0100)]
bgpd: do not start BGP VRF peer connection, if VRF not unknown

Upon starting a BGP VRF instance, the server socket is not created,
because the VRF ID is not known, and then underlying VRF backend is not
ready yet. Because of that, the peer connection attempt will not be
started before.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: server socket is created for all enabled VRF
Philippe Guibert [Fri, 26 Jan 2018 11:25:34 +0000 (12:25 +0100)]
bgpd: server socket is created for all enabled VRF

Upon creation of BGP instances, server socket may or may not be created.
In the case of VRF instances, if the VRF backend relies on NETNS, then
a new server socket will be created for each BGP VRF instance. If the
VRF backend relies on VRF LITE, then only one server socket will be
enough. Moreover, At startup, with BGP VRF configuration, a server
socket may not be created if VRF is not the default one or VRF is not
recognized yet.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: bgp support for netns
Philippe Guibert [Wed, 20 Dec 2017 11:37:18 +0000 (12:37 +0100)]
bgpd: bgp support for netns

The change contained in this commit does the following:
- discovery of vrf id from zebra daemon, and adaptation of bgp contexts
  with BGP.
  The list of network addresses contain a reference to the bgp context
  supporting the vrf.
  The bgp context contains a vrf pointer that gives information about
  the netns path in case the vrf is a netns path.

Only some contexts are impacted, namely socket creation, and retrieval
of local IP settings. ( this requires vrf identifier).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: add two APIs to handle socket operations with VRF NETNS
Philippe Guibert [Fri, 26 Jan 2018 11:28:27 +0000 (12:28 +0100)]
lib: add two APIs to handle socket operations with VRF NETNS

The vrf_sockunion_socket() wraps sockunion_socket() with vrf_id as
additional parameter. The creation of socket forces the user to
transparently move to new NETNS for doing the operation.
The vrf_getaddr_info() wraps getaddr_info() with vrf_id as additional
parameter. That API relies on the underlying system. Then there may be
need to switch to an other netns in that case too.
Also, the vrf_socket() implementation is simplified.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: fix assert mpls when terminating zebra
Philippe Guibert [Wed, 24 Jan 2018 18:06:06 +0000 (19:06 +0100)]
zebra: fix assert mpls when terminating zebra

The assert appears in zebra_mpls.c when checking default zebra_vrf.
It appears that when the mpls entries are flushed, it gets the default
vrf which is already flushed by vrf_terminate() function. In order to
avoid that assert to trigger a crash, the mpls flush is called before
vrf termination.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoospfd: fix static analysis with variable initialised never read
Philippe Guibert [Mon, 22 Jan 2018 15:06:58 +0000 (16:06 +0100)]
ospfd: fix static analysis with variable initialised never read

the vrf identifier in the ospf_vrf_enable routine is never read, then
does not need to be initialised.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: create interface even if name is the same
Philippe Guibert [Tue, 19 Dec 2017 11:44:44 +0000 (12:44 +0100)]
lib: create interface even if name is the same

For supporting vrf based on namespaces, it is possible that an interface
with the same index is present. This is the case for loopback
interfaces. For that, for each query, if the interface is not found
, matching the vrf identifier, then a new interface is created, when the
backens for VRF is NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: fix initialised vrf_id value never read
Philippe Guibert [Mon, 22 Jan 2018 12:46:20 +0000 (13:46 +0100)]
zebra: fix initialised vrf_id value never read

this is a static analysis performed by c-lang scan-build tool that
demonstrated this issue. This commit is handling the fix.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: upon startup, a NSID is assigned to default netns
Philippe Guibert [Tue, 16 Jan 2018 12:59:58 +0000 (13:59 +0100)]
zebra: upon startup, a NSID is assigned to default netns

when the netns backend is selected for VRF, the default VRF is being
assigned a NSID. This avoids the need to handle the case where if the
incoming NSID was 0 for a non default VRF, then a specific handling had
to be done to keep 0 value for default VRF.
In most cases, as the first NETNS to get a NSID will be the default VRF,
most probably the default VRF will be assigned to 0, while the other
ones will have their value incremented. On some cases, where the NSID is
already assigned for NETNS, including default VRF, then the default VRF
value will be the one derived from the NSID of default VRF, thus keeping
consistency between VRF IDs and NETNS IDs.
Default NS is attempted to be created. Actually, some VMs may have the
netns feature, but the NS initialisation fails because that folder is
not present.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: collect and get netnamespaces information
Philippe Guibert [Wed, 13 Dec 2017 10:04:31 +0000 (11:04 +0100)]
zebra: collect and get netnamespaces information

upon zebra initialisation, and upon further netnamespace creation, the
the netnamespaces are created and a vrf associated to the netnamespace
is created. By convention, the name of the netns will be the same as the
VRF.
Add a stub routine that returns a fake ns identifier, in case netlink (
linux machines) is not available.
Also, upon each newly discovered NETNS, a NSID id being generated,
either by relying on kernel NSID feature, or by generating locally the
NSID ( see previous commit for more information).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: upon NS creation, collect the NSID via netlink
Philippe Guibert [Thu, 7 Dec 2017 17:13:54 +0000 (18:13 +0100)]
zebra: upon NS creation, collect the NSID via netlink

A NS identifier is collected by netlink. This identifier is a 32 bit
identifier that is either generated by the kernel (if not set) or
manually set by a set netlink command. The commit here is getting the
NSID from the newly created NS. If the linux option to create or get a
new NSID from the kernel does not exist, then the NSID is locally
genrated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: provide an API to switch from one netns to an other
Philippe Guibert [Wed, 20 Dec 2017 11:29:21 +0000 (12:29 +0100)]
lib: provide an API to switch from one netns to an other

Two apis are provided so that the switch from one netns to an other one
is taken care.
Also an other API to know if the VRF has a NETNS backend or a VRF Lite
backend.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: add namespace name structure in zebra message
Philippe Guibert [Fri, 22 Dec 2017 15:02:51 +0000 (16:02 +0100)]
lib: add namespace name structure in zebra message

The addition of the name of the netns in the vrf message introduces also
a limitation when the size of the netns is bigger than 15 bytes. Then
the netns are ignored by the library.
In addition to this, some sanity checks have been introduced. some
functions to create the netns from a call not coming from the vty is
being added with traces.
Also, the ns vty function is reentrant, if the context is already
created.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agozebra: enhance show vrf for netns and fixing
Philippe Guibert [Thu, 7 Dec 2017 14:58:48 +0000 (15:58 +0100)]
zebra: enhance show vrf for netns and fixing

Show vrf command displays information on the vrf, if it is related to
vrf kernel or if it is related to netns.
When a vrf from kernel is detected, before creating a new vrf, a check
is done against an already present vrf, and if that vrf is not a vrf
mapped with a netns. If that is that case, then the creation is
rejected.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handle the zns init/destroy
Philippe Guibert [Fri, 8 Dec 2017 13:32:38 +0000 (14:32 +0100)]
zebra: handle the zns init/destroy

The zebra netnamespace contexts are initialised, based on the callback
coming from the NS. Reversely, the list of ns is parsed to disable the
ns contexts.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add the registration mechanism for netns
Philippe Guibert [Thu, 7 Dec 2017 17:27:31 +0000 (18:27 +0100)]
zebra: add the registration mechanism for netns

If vrf backend is netns, then the zebra will create its own
zebra_ns context for each new netns discovered. As consequence,
a routing table, and other contexts will be created for each
new namespace discovered. When it is enabled, a populate process
will be done, consisting in learning new interfaces and routes, and
addresses from other NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: externalise vrf and ns creation
Philippe Guibert [Wed, 13 Dec 2017 10:04:31 +0000 (11:04 +0100)]
lib: externalise vrf and ns creation

In addition to have the possibility to create from vty vrf based on a
netns backend, the API will be made accessible from external, especially
for zebra that will handle the netns discovery part. This commit is
externalising following functions:
- netns_pathname
- ns_handler_create
- vrf_handler_create

Also, the VRF initialisation case when under NETNS backend is changed,
since the NS identifier may not be known at the configuration time,but
may be known later, under discovery process.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: zns context is filled in when vrf is enabled
Philippe Guibert [Fri, 22 Dec 2017 15:21:09 +0000 (16:21 +0100)]
zebra: zns context is filled in when vrf is enabled

This commit is also a fix that avoids a VRF to be attached to the wrong
namespace context, at creation time. Because the VRF, at creation time
does not know yet the namespace where it will get its information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: fix static analysis issue with zvrf_id
Philippe Guibert [Mon, 22 Jan 2018 10:30:05 +0000 (11:30 +0100)]
zebra: fix static analysis issue with zvrf_id

Using c-lang scan-build tool, fix a dereference of a null pointer.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: ipv6 operations stick to namespace
Philippe Guibert [Tue, 19 Dec 2017 11:23:32 +0000 (12:23 +0100)]
zebra: ipv6 operations stick to namespace

All ipv6 operations stick to namespace.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: route configuration fix for vrf when applied to namespaces
Philippe Guibert [Mon, 11 Dec 2017 14:19:15 +0000 (15:19 +0100)]
zebra: route configuration fix for vrf when applied to namespaces

For each route to be added or deleted, instead of applying directly to
default namespaces, when a vrf is mapped to a namespace, then the
correct zns must be found out.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: socket operations stick to namespace if necessary
Philippe Guibert [Fri, 8 Dec 2017 18:06:34 +0000 (19:06 +0100)]
zebra: socket operations stick to namespace if necessary

Upon following calls: interface poll, address poll, route poll, and
ICMPv6 handling, each new Namespace is being parsed. For that, the
socket operations need to switch from one NS to one other, to get the
necessary information.

As of now, there is a crash when dumping interfaces, through show
running-config.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agolib: netns vty command not available when vrf backend is vrf lite
Philippe Guibert [Wed, 10 Jan 2018 09:04:59 +0000 (10:04 +0100)]
lib: netns vty command not available when vrf backend is vrf lite

Using the vrf backend kind, the vty command that configured netns
under vty will not be installed if the vrf backend is vrf lite

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: copy logical-router-command under vrf subnode
Philippe Guibert [Wed, 6 Dec 2017 11:03:59 +0000 (12:03 +0100)]
zebra: copy logical-router-command under vrf subnode

a vty command is added:
in addition to this command ( kept for future usage):
- [no] logical-router-id <ID> netns <NETNSNAME>
a new command is being placed under vrf subnode
- vrf <NAME>
   [no] netns <NETNSNAME>
  exit

This command permits to map a VRF with a Netnamespace.
The commit only handles the relationship between vrf and ns structures.
It adds 2 attributes to vrf structure:
- one defines the kind of vrf ( mapped under netns or vrf from kernel)
- the other is the opaque pointer to ns
The show running-config is handled by zebra daemon.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add a runtime flag to enable vrf with netns
Philippe Guibert [Mon, 22 Jan 2018 08:42:53 +0000 (09:42 +0100)]
zebra: add a runtime flag to enable vrf with netns

The netns backend is chosen by VRF if a runtime flag named vrfwnetns is
selected when running zebra.
In the case the NETNS backend is chosen, in some case the VRFID value is
being assigned the value of the NSID. Within the perimeter of that work,
this is why the vrf_lookup_by_table function is extended with a new
parameter.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge branch 'master' into evpn-bugs
Mitesh Kanjariya [Tue, 27 Feb 2018 10:00:10 +0000 (02:00 -0800)]
Merge branch 'master' into evpn-bugs

6 years agoMerge pull request #1736 from mkanjari/type5-with-asymm
Philippe Guibert [Tue, 27 Feb 2018 09:36:57 +0000 (10:36 +0100)]
Merge pull request #1736 from mkanjari/type5-with-asymm

zebra, bgp: Support type-5 routes with asymmetric routing

6 years agobgpd: remove show bgp l2vpn evpn route vrf cmd
mitesh [Sun, 25 Feb 2018 10:15:50 +0000 (02:15 -0800)]
bgpd: remove show bgp l2vpn evpn route vrf cmd

This command doesnt make sense as EVPN routes are only present in
global table.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: Attach PMSI to only type-3 routes and rmac to only type-2 routes
Mitesh Kanjariya [Fri, 23 Feb 2018 10:16:47 +0000 (02:16 -0800)]
bgpd: Attach PMSI to only type-3 routes and rmac to only type-2 routes

The PMSI attribute is only applicable to EVPN type-3 route.
Rmac is applicable to type-2 and type-5 routes.
We should attach these attributes appropiately based on route-type.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: keep a backpointer to vrf instance in struct bgpevpn
Mitesh Kanjariya [Fri, 23 Feb 2018 09:16:32 +0000 (01:16 -0800)]
bgpd: keep a backpointer to vrf instance in struct bgpevpn

We will keep a backpointer to bgp vrf instance in bgpevpn.
struct bgpevpn denotes a l2vni and bgp_vrf corresponds to l3vni.
A back pointer to the vrf will provide efficient
access to vrf when needed.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: write vrf rd to config
Mitesh Kanjariya [Mon, 19 Feb 2018 10:04:27 +0000 (02:04 -0800)]
bgpd: write vrf rd to config

When a non-default vrf rd is configured under l2vpn evpn in a vrf,
we need to update the config file.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: move route-target for a vrf under address-family evpn command
Mitesh Kanjariya [Mon, 19 Feb 2018 09:39:48 +0000 (01:39 -0800)]
bgpd: move route-target for a vrf under address-family evpn command

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: add show bgp vrf all l2vpn evpn summary as an option
Mitesh Kanjariya [Mon, 19 Feb 2018 08:57:54 +0000 (00:57 -0800)]
bgpd: add show bgp vrf all l2vpn evpn summary as an option

Ticket: CM-19738
Review: CCR-7194
Testing: Manual

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agosharpd: Allow sharp routes to recurse
Donald Sharp [Tue, 27 Feb 2018 02:44:47 +0000 (21:44 -0500)]
sharpd: Allow sharp routes to recurse

When passing in a sharp route, allow the nexthop choosen
to recurse to find a match.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup TODO file
Donald Sharp [Tue, 27 Feb 2018 02:33:02 +0000 (21:33 -0500)]
pimd: Cleanup TODO file

The TODO file had become a dumping ground of changes made
to the protocol.  That when we modified the underlying code
we would need to update the TODO file again due to it's nature.

There is no point in keeping the list of items that we've done
as that commit messages will indicate the new features.  So
pull out all the Finished work and rework the Todo numbers
used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSION
Donald Sharp [Tue, 27 Feb 2018 02:26:33 +0000 (21:26 -0500)]
*: Rename ZEBRA_FLAG_INTERNAL -> ZEBRA_FLAG_ALLOW_RECURSION

The ZEBRA_FLAG_INTERNAL flag is used to signal to zebra that
the route being added, the nexthops for it can be recursively
resolved.  This name keeps throwing me off when I read it
so let's rename to something that allows the developer to
understand what is going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1750 from donaldsharp/zebra_other_tables
Renato Westphal [Tue, 27 Feb 2018 00:29:57 +0000 (21:29 -0300)]
Merge pull request #1750 from donaldsharp/zebra_other_tables

Zebra other tables

6 years agoMerge pull request #1795 from qlyoung/vtysh-history-q2f
Renato Westphal [Tue, 27 Feb 2018 00:16:13 +0000 (21:16 -0300)]
Merge pull request #1795 from qlyoung/vtysh-history-q2f

vtysh: .history_quagga --> .history_frr

6 years agobgpd: use peer->ifp->ifindex instead of peer->ifindex
Daniel Walton [Mon, 26 Feb 2018 22:13:22 +0000 (22:13 +0000)]
bgpd: use peer->ifp->ifindex instead of peer->ifindex

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
peer->ifindex was only used in two places but it was never populated so
neither of them worked as they should.  'struct peer' also has a 'struct
interface' pointer which we can use to get the ifindex.

6 years agoMerge pull request #1793 from qlyoung/stylechecker
Philippe Guibert [Sat, 24 Feb 2018 06:24:06 +0000 (07:24 +0100)]
Merge pull request #1793 from qlyoung/stylechecker

Miscellaneous checkpatch fixes & improvements

6 years agoMerge pull request #1796 from donaldsharp/32_silliness
Martin Winter [Fri, 23 Feb 2018 21:52:42 +0000 (13:52 -0800)]
Merge pull request #1796 from donaldsharp/32_silliness

pimd: Fix some compiler issues

6 years ago*: Modify notify_owner to route_notify_owner
Donald Sharp [Fri, 23 Feb 2018 19:40:46 +0000 (14:40 -0500)]
*: Modify notify_owner to route_notify_owner

In the future we are going to have a rule_notify_owner
so make the distinction between the two types of notification
clearer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Fix situation where we would notify the owner it lost due to admin distance
Donald Sharp [Wed, 14 Feb 2018 02:30:03 +0000 (21:30 -0500)]
zebra: Fix situation where we would notify the owner it lost due to admin distance

The 'struct route_entry *old' and 'struct route_entry *new' can sometimes
be the same route type( for a route replace ), so when we are checking
to see if a new owner has taken over, don't tell the owner it is
replacing it self.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
6 years agozebra: Add some useful debugs for notifying the owner
Donald Sharp [Wed, 14 Feb 2018 02:32:22 +0000 (21:32 -0500)]
zebra: Add some useful debugs for notifying the owner

Add a bit more detail to tell us what we are sending
up to a protocol so we can debug it better in the
future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Fix notify_owner decode
Donald Sharp [Wed, 14 Feb 2018 02:34:07 +0000 (21:34 -0500)]
lib: Fix notify_owner decode

The notification of the owner was not properly decoding
the prefix and as such we were not properly reading the
table it was installed into.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Add tableid the route entry was sent to
Donald Sharp [Sat, 10 Feb 2018 00:27:52 +0000 (19:27 -0500)]
*: Add tableid the route entry was sent to

Add for the southbound pass back the route entries tableid
used for installation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agovtysh: .history_quagga --> .history_frr
Quentin Young [Fri, 23 Feb 2018 17:40:57 +0000 (12:40 -0500)]
vtysh: .history_quagga --> .history_frr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge branch 'master' into stylechecker
Quentin Young [Fri, 23 Feb 2018 16:21:42 +0000 (11:21 -0500)]
Merge branch 'master' into stylechecker

6 years agotools: finer-grained error codes for checkpatch
Quentin Young [Fri, 23 Feb 2018 15:58:17 +0000 (10:58 -0500)]
tools: finer-grained error codes for checkpatch

* 2 for errors
* 1 for warnings
* 0 for clean
* Suppress all report text for a clean result
* Remove check for const structs from perl script
* Remove grep suppression for that check from shell script

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agotools: ignore FSF warning, fn macros in checkpatch
Quentin Young [Fri, 23 Feb 2018 15:11:19 +0000 (10:11 -0500)]
tools: ignore FSF warning, fn macros in checkpatch

* Unlike Linux we do require the GPL file header
* When checking for spaces between function names and parentheses,
  ignore all-uppercase function names as these are likely to be macros,
  and function-like macros may have that space

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: Update centos7 build to include systemd
Donald Sharp [Fri, 23 Feb 2018 15:06:04 +0000 (10:06 -0500)]
doc: Update centos7 build to include systemd

Update the centos7 build instructions to include
data on how to build w/ systemd.  This is especially
useful because we tell the user to install the frr.service
file and the frr.service file expects systemd integration

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1792 from pguibert6WIND/issue_1786
Quentin Young [Fri, 23 Feb 2018 15:04:07 +0000 (10:04 -0500)]
Merge pull request #1792 from pguibert6WIND/issue_1786

tools: fix that filters issues on resulting file only

6 years agotools: fix that filters issues on resulting file only
Philippe Guibert [Fri, 23 Feb 2018 15:16:30 +0000 (16:16 +0100)]
tools: fix that filters issues on resulting file only

Because checkpatch result is applied to original and new file, the
analysis also parses what may be wrong with the original file.
Whereas the script should limit to analyse only what is wrong on new
file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: Fix up some code formatting issues.
Donald Sharp [Fri, 23 Feb 2018 12:50:23 +0000 (07:50 -0500)]
zebra: Fix up some code formatting issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Fix warning found in CI system
Donald Sharp [Sun, 18 Feb 2018 22:23:50 +0000 (17:23 -0500)]
zebra: Fix warning found in CI system

The Clang SA system found a new issue:

Dead store: Dead assignment.

This fixes that issue

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Make assignment from RB_ROOT in while loop work better
Donald Sharp [Sun, 18 Feb 2018 00:02:55 +0000 (19:02 -0500)]
*: Make assignment from RB_ROOT in while loop work better

Fix up the assignment of the variable = RB_ROOT inside of
while loop patter we were using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: On shutdown don't count removals
Donald Sharp [Fri, 16 Feb 2018 02:33:22 +0000 (21:33 -0500)]
zebra: On shutdown don't count removals

Some of the tables are no longer stored in the zvrf
and in the zns now.  On shutdown zns is cleaned up
after vrf( and rightly so!) As such we should not
attempt to count the information if we don't have
a zvrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add code to display interesting tables
Donald Sharp [Wed, 14 Feb 2018 03:38:47 +0000 (22:38 -0500)]
zebra: Add code to display interesting tables

With the ability of zebra to handle random tables,
add code to display those tables via the
show <ip|ipv6> route table (1-...) [json] command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Allow table creation for tables greater than 252
Donald Sharp [Wed, 14 Feb 2018 01:29:38 +0000 (20:29 -0500)]
zebra: Allow table creation for tables greater than 252

The linux kernel allows a vast expanse of tables to be used.
It would be useful for zebra to track these tables if they
are being used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Move zvrf->other_tables into zns
Donald Sharp [Wed, 14 Feb 2018 01:25:11 +0000 (20:25 -0500)]
zebra: Move zvrf->other_tables into zns

The other_tables data structure does not belong to a vrf.
It belongs to the zns.  This is because each vrf does not
need to have copies of each of other_tables.

Additionally move the array into a RB_TREE.  This will allow
us to sort quickly and easily expand the number of tables
we can support to beyond the ZEBRA_KERNEL_TABLE_MAX define.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Fix some compiler issues
Donald Sharp [Fri, 23 Feb 2018 07:07:47 +0000 (02:07 -0500)]
pimd: Fix some compiler issues

Fix some compiler issues that were not picked up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1723 from chiragshah6/ospf_vrf_dev
Rafael Zalamena [Thu, 22 Feb 2018 20:24:35 +0000 (17:24 -0300)]
Merge pull request #1723 from chiragshah6/ospf_vrf_dev

ospfd: fix ospf interface and neighbor json

6 years agoMerge pull request #1756 from qlyoung/stylechecker
Philippe Guibert [Thu, 22 Feb 2018 17:55:48 +0000 (18:55 +0100)]
Merge pull request #1756 from qlyoung/stylechecker

tools: improve checkpatch.sh

6 years agotools: improve checkpatch.sh
Quentin Young [Thu, 15 Feb 2018 18:37:03 +0000 (13:37 -0500)]
tools: improve checkpatch.sh

* Send reports to stderr; this allows you to get just the end result by
  redirecting stderr
* Don't attempt to copy nonexistent files

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoFRR: Update Community.md to reflect release process
Donald Sharp [Thu, 22 Feb 2018 13:48:45 +0000 (08:48 -0500)]
FRR: Update Community.md to reflect release process

This is the new release process for FRR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1749 from msablic/pim_mtrace_cc
Donald Sharp [Thu, 22 Feb 2018 13:15:38 +0000 (08:15 -0500)]
Merge pull request #1749 from msablic/pim_mtrace_cc

pimd: Multicast traceroute client and router

6 years agozebra: fix rnh deleting nht entry
Don Slice [Wed, 21 Feb 2018 18:45:05 +0000 (10:45 -0800)]
zebra: fix rnh deleting nht entry

Problem seen when a prefix was learned with nexthops from multiple
route sources (static and ospf in this case) and the link to that
nexthop flaps.  The nht entry was incorrectly deleted so when the
link came back up the static was not re-installed correctly.

Ticket: CM-19675
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>