]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years ago*: PBR - netlink interaction and basic definitions
vivek [Sun, 4 Feb 2018 12:33:33 +0000 (12:33 +0000)]
*: PBR - netlink interaction and basic definitions

Implement netlink interactions for Policy Based Routing. This includes
APIs to install and uninstall rules and handle notifications from the
kernel related to rule addition or deletion. Various definitions are
added to facilitate this.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, vtysh: Start cli for nexthop-group
Donald Sharp [Fri, 26 Jan 2018 15:59:15 +0000 (10:59 -0500)]
lib, vtysh: Start cli for nexthop-group

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Isolate nexthop_group functions to nexthop_group.c
Donald Sharp [Fri, 26 Jan 2018 15:12:35 +0000 (10:12 -0500)]
lib: Isolate nexthop_group functions to nexthop_group.c

Also modify `struct route_entry` to use nexthop_groups.
Move ALL_NEXTHOPS loop to nexthop_group.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, zebra: Allow zapi to send down the tableid
Donald Sharp [Fri, 9 Feb 2018 23:38:02 +0000 (18:38 -0500)]
lib, zebra: Allow zapi to send down the tableid

Allow the calling daemon to pass down what table-id we
want to use to install the route.  Useful for PBR.

The vrf id passed must be the VRF_DEFAULT else this
value is ignored.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd, lib, zebra: Switch to work_queue_free_and_null
Donald Sharp [Mon, 5 Feb 2018 15:40:09 +0000 (10:40 -0500)]
bgpd, lib, zebra: Switch to work_queue_free_and_null

The work_queue_free function free'd up the wq pointer but
did not set it too NULL.  This of course causes situations
where we may use the work_queue after it is freed.  Let's
modify the work_queue to set the pointer for you.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1808 from qlyoung/debug-mt-safe
Renato Westphal [Fri, 9 Mar 2018 14:25:37 +0000 (11:25 -0300)]
Merge pull request #1808 from qlyoung/debug-mt-safe

MT-safe debug facilities

6 years agoMerge pull request #1852 from donaldsharp/notify_owner_fail
Renato Westphal [Fri, 9 Mar 2018 02:33:21 +0000 (23:33 -0300)]
Merge pull request #1852 from donaldsharp/notify_owner_fail

*: Add code to notify on successful route removal

6 years ago*: Add code to notify on route removal status
Donald Sharp [Thu, 8 Mar 2018 15:25:12 +0000 (10:25 -0500)]
*: Add code to notify on route removal status

If a interested party removes one of it's routes let
it know that it has happened as asked for.

Add a ZAPI_ROUTE_REMOVED to the send of the route_notify_owner
Add a ZAPI_ROUTE_REMOVE_FAIL to the send of the route_notify_owner

Add code in sharpd to notice this and to allow it to keep
track of routes removed for that invocation and give timing
results.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1814 from chiragshah6/mdev
Jafar Al-Gharaibeh [Fri, 9 Mar 2018 00:05:32 +0000 (18:05 -0600)]
Merge pull request #1814 from chiragshah6/mdev

ospf6d: assign zebra router-id to ospf6 instance

6 years agoMerge pull request #1843 from chiragshah6/ospf_vrf_dev
Renato Westphal [Thu, 8 Mar 2018 22:04:08 +0000 (19:04 -0300)]
Merge pull request #1843 from chiragshah6/ospf_vrf_dev

zebra/ospfd:  Treat vrf interface similar to loopback

6 years agoospfd: Treat vrf interface as loopback type
Chirag Shah [Tue, 6 Mar 2018 20:55:59 +0000 (12:55 -0800)]
ospfd: Treat vrf interface as loopback type

Ticket:CM-19914

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agozebra: set vrf as loopback upon interface add
Chirag Shah [Tue, 6 Mar 2018 20:50:32 +0000 (12:50 -0800)]
zebra: set vrf as loopback upon interface add

Move setting vrf loopback flag on ifp after
zebra vrf type is set (ziftype).

Zebra connected not to announce unnumbered for
VRF interface (similar to loopback).

Ticket:CM-19914

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com
6 years agoMerge pull request #1842 from donaldsharp/zserv_buffer_size
Renato Westphal [Thu, 8 Mar 2018 20:27:21 +0000 (17:27 -0300)]
Merge pull request #1842 from donaldsharp/zserv_buffer_size

lib: Increase zapi buffer size

6 years agoMerge pull request #1826 from qlyoung/lsan-suppressions
Martin Winter [Wed, 7 Mar 2018 21:47:43 +0000 (22:47 +0100)]
Merge pull request #1826 from qlyoung/lsan-suppressions

tools: add LeakSanitizer suppressions list

6 years agolib: Increase zapi buffer size
Donald Sharp [Tue, 6 Mar 2018 21:07:14 +0000 (16:07 -0500)]
lib: Increase zapi buffer size

The buffer size is currently 4k.  Increase x4 times to allow for bigger
messages to be sent over the zapi.

The current size sufficient for most cases, but there are a couple
of cases with installing data to the kernel ip rules where we will
quickly hit this 4k size limit.  I forsee flowspec getting close
to this limit as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1428 from LabNConsulting/working/master/indent
Donald Sharp [Wed, 7 Mar 2018 15:44:37 +0000 (10:44 -0500)]
Merge pull request #1428 from LabNConsulting/working/master/indent

frr: conform with COMMUNITY.md formatting rules

6 years agoMerge pull request #1816 from pguibert6WIND/issue_clear_ipv6
Quentin Young [Wed, 7 Mar 2018 15:28:29 +0000 (10:28 -0500)]
Merge pull request #1816 from pguibert6WIND/issue_clear_ipv6

bgpd: clear ip bgp instances with safi invalid

6 years agobgpd: clear ip bgp instances with invalid safi
Philippe Guibert [Fri, 2 Mar 2018 14:43:07 +0000 (15:43 +0100)]
bgpd: clear ip bgp instances with invalid safi

This commit fixes the handling of incoming parameters passed in
following vty functions:

clear ip bgp ipv6 [safi] prefix []
clear ip bgp [vrf ] ipv6 [safi] prefix []

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #1812 from qlyoung/bgpd-fix-update-group-commands
Christian Franke [Wed, 7 Mar 2018 13:50:50 +0000 (14:50 +0100)]
Merge pull request #1812 from qlyoung/bgpd-fix-update-group-commands

bgpd: fix update-group show commands

6 years agoMerge pull request #1841 from qlyoung/fix-ospf-shutdown-thread-heap-uaf
Olivier Dugeon [Wed, 7 Mar 2018 09:41:53 +0000 (10:41 +0100)]
Merge pull request #1841 from qlyoung/fix-ospf-shutdown-thread-heap-uaf

ospfd: cancel SR thread at shutdown

6 years agoMerge pull request #1840 from pguibert6WIND/issue_1829
Donald Sharp [Wed, 7 Mar 2018 02:24:25 +0000 (21:24 -0500)]
Merge pull request #1840 from pguibert6WIND/issue_1829

Misc BGP VRF fixes

6 years agobgpd: another change to keep indent.py happy
Lou Berger [Tue, 6 Mar 2018 19:10:38 +0000 (14:10 -0500)]
bgpd: another change to keep indent.py happy

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agopimd: another change to keep indent.py happy
Lou Berger [Tue, 6 Mar 2018 19:09:19 +0000 (14:09 -0500)]
pimd: another change to keep indent.py happy

Signed-off-by: Lou Berger <lberger@labn.net>
6 years ago*: conform with COMMUNITY.md formatting rules, via 'make indent'
Lou Berger [Tue, 6 Mar 2018 19:02:52 +0000 (14:02 -0500)]
*: conform with COMMUNITY.md formatting rules, via 'make indent'

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: another change to keep indent.py happy
Lou Berger [Tue, 6 Mar 2018 18:43:43 +0000 (13:43 -0500)]
bgpd: another change to keep indent.py happy

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agolib: change comment block to #define to avoid indent.py from breaking comment
Lou Berger [Tue, 6 Mar 2018 18:25:33 +0000 (13:25 -0500)]
lib: change comment block to #define to avoid indent.py from breaking comment
     due to DEFUN within comment

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMakefile.am: Add 'make indent' target
Lou Berger [Tue, 6 Mar 2018 18:04:04 +0000 (13:04 -0500)]
Makefile.am: Add 'make indent' target

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agotools: fix indent.py FRR indent pattern matching
Lou Berger [Tue, 6 Mar 2018 18:03:36 +0000 (13:03 -0500)]
tools: fix indent.py FRR indent pattern matching

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoospfd: cancel SR thread at shutdown
Quentin Young [Tue, 6 Mar 2018 18:42:53 +0000 (13:42 -0500)]
ospfd: cancel SR thread at shutdown

Otherwise if it is scheduled the thread pointer will be accessed after
the shutdown task finishes accessing, having deleted the structure that
owns said pointer, which causes a heap UAF.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: NS_DEFAULT wrong value
Philippe Guibert [Tue, 6 Mar 2018 17:12:57 +0000 (18:12 +0100)]
lib: NS_DEFAULT wrong value

The NS_DEFAULT value returns UNKNOWN in the case the vrf lite backend is
used, whereas this is wrong. This commit fixes the default value.
Also, it fixes the default value in the case NETNS support from system
is not ok, or some error can occur when reading default NS at startup.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: permit bgp vrf socket creation on some cases
Philippe Guibert [Tue, 6 Mar 2018 17:10:27 +0000 (18:10 +0100)]
bgpd: permit bgp vrf socket creation on some cases

When VRF is not yet available at startup, the check for main socket
presence must be done. As the main socket creation is made in a separate
place from vrf socket for netns, ths main socket creation must not be
prevented when a BGP VRF relies on vrf lite mechanism.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #1811 from donaldsharp/nht_send_type
Renato Westphal [Tue, 6 Mar 2018 16:48:40 +0000 (13:48 -0300)]
Merge pull request #1811 from donaldsharp/nht_send_type

lib, zebra: Add type and instance to nexthop update message

6 years agoMerge pull request #1833 from opensourcerouting/fix-vtysh-output-init
Quentin Young [Tue, 6 Mar 2018 16:47:47 +0000 (11:47 -0500)]
Merge pull request #1833 from opensourcerouting/fix-vtysh-output-init

vtysh: initialize vty structure correctly for output to terminal

6 years agoMerge pull request #1728 from mkanjari/evpn-bug-fixes
Philippe Guibert [Tue, 6 Mar 2018 16:27:10 +0000 (17:27 +0100)]
Merge pull request #1728 from mkanjari/evpn-bug-fixes

Evpn bug fixes

6 years agoMerge pull request #1818 from pguibert6WIND/issue_vrfnetns_capabilities
Renato Westphal [Tue, 6 Mar 2018 15:15:35 +0000 (12:15 -0300)]
Merge pull request #1818 from pguibert6WIND/issue_vrfnetns_capabilities

bgpd,ospfd: add sys_admin capabilities

6 years agoMerge pull request #1789 from Orange-OpenSource/master
Rafael Zalamena [Tue, 6 Mar 2018 00:55:59 +0000 (21:55 -0300)]
Merge pull request #1789 from Orange-OpenSource/master

ospfd: Add json output for Segment Routing

6 years agovtysh: initialize vty structure correctly for output to terminal
Christian Franke [Mon, 5 Mar 2018 23:46:01 +0000 (00:46 +0100)]
vtysh: initialize vty structure correctly for output to terminal

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoMerge pull request #1809 from donaldsharp/intf_json
Renato Westphal [Mon, 5 Mar 2018 22:33:05 +0000 (19:33 -0300)]
Merge pull request #1809 from donaldsharp/intf_json

vrf nexthop cleanups

6 years agoMerge pull request #1827 from opensourcerouting/fix-ringbuf-test-setup
Quentin Young [Mon, 5 Mar 2018 20:13:46 +0000 (15:13 -0500)]
Merge pull request #1827 from opensourcerouting/fix-ringbuf-test-setup

tests: fix python test description for test_ringbuf

6 years agotests: update gitignore
Christian Franke [Mon, 5 Mar 2018 18:49:31 +0000 (19:49 +0100)]
tests: update gitignore

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agotests: fix python test description for test_ringbuf
Christian Franke [Mon, 5 Mar 2018 18:43:39 +0000 (19:43 +0100)]
tests: fix python test description for test_ringbuf

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agotools: add LeakSanitizer suppressions list
Quentin Young [Mon, 5 Mar 2018 18:20:22 +0000 (13:20 -0500)]
tools: add LeakSanitizer suppressions list

Building FRR with AddressSanitizer is kind of annoying since
libpython3.5 leaks memory, clippy links libpython3.5 and clippy runs as
part of the build process. LeakSanitizer has a way to suppress leaks at
runtime by setting the LSAN_OPTIONS environment variable to contain a
file path to a suppression list:

LSAN_OPTIONS=suppressions=path/to/suppr.txt

This commit provides the file. Setting this environment variable to

LSAN_OPTIONS=suppressions=../tools/lsan-suppressions.txt

before building should allow a clean build with ASAN enabled. The
relative path is there because LeakSanitizer looks at paths relative to
the binary it is sanitizing; clippy is in lib/ so the path is set
relative to lib/.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1797 from chiragshah6/ospfv3_dev
Russ White [Fri, 2 Mar 2018 20:56:08 +0000 (15:56 -0500)]
Merge pull request #1797 from chiragshah6/ospfv3_dev

ospf6d: ECMP for external routes

6 years agobgpd,ospfd: add sys_admin capabilities
Philippe Guibert [Fri, 2 Mar 2018 14:20:43 +0000 (15:20 +0100)]
bgpd,ospfd: add sys_admin capabilities

This capability, when used, is mapped over linux sys_admin capability.
This is necessary from the daemon perspective, in order to handle NETNS
based VRFs, because calling setns() requires sys admin capability.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #1815 from donaldsharp/ospf_sr_cleanup
Olivier Dugeon [Fri, 2 Mar 2018 12:26:13 +0000 (13:26 +0100)]
Merge pull request #1815 from donaldsharp/ospf_sr_cleanup

ospfd: Cleanup ospf SR log messages

6 years agoospfd: Cleanup ospf SR log messages
Donald Sharp [Fri, 2 Mar 2018 10:15:33 +0000 (05:15 -0500)]
ospfd: Cleanup ospf SR log messages

When OSPF SR is not configured one would expect
to not see any output from it at all in the debug
log with no debugs turned on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospf6d: assign zebra router-id to ospf6 instance
Chirag Shah [Tue, 27 Feb 2018 19:24:16 +0000 (11:24 -0800)]
ospf6d: assign zebra router-id to ospf6 instance

Store zebra router-id in global structure.
Before router ospf6 instance created,
zebra router-id callback called.

During ospf6 main execution zebra init happens,
but default instance does not execute until
cli replay 'router ospf6'.
Call ospf6_router_id_change during 'router ospf6'
to assign zebra router id to ospf6 instance.

Ticket:CM-19937
Testing Done:
Assign Loopback /32 (6.6.6.6/32) address,
restart frr with (router ospf6 in frr.conf).
ospf6 default instance assigned 6.6.6.6 router-id.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agolib: add mt-safe debugging facilities
Quentin Young [Wed, 28 Feb 2018 21:14:45 +0000 (16:14 -0500)]
lib: add mt-safe debugging facilities

The current strategy for fine-grained debugging across FRR is to use
static long int bitfields, in combination with helper macros that are
copy-pasted between daemons, to hold state on what debugging information
should be collected at any given time. This has a couple of problems:

* These bitfields are generally extern'd and accessed everywhere, so
  they are not MT-safe or easy to make MT-safe
* Lots of code duplication from copy-pasting the DEBUG_* macros...
* Code duplication because of the "term" vs "conf" debugging concept

This patch aims to remedy that by providing some infrastructure to work
with debugs. The core concept of using bitfields has been retained, but
the number of these for each debug has been reduced to 1. This allows
easy use of lock-free methods for synchronizing access to debugging
info.

The helper macros have also been retained but they are now collected in
one place and perform exclusively atomic operations.

Finally there is a bit of code that allows daemons to register
callbacks, which I used to implement a command that will toggle all
debugging for any daemons that use these facilities.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: fix update-group show commands
Quentin Young [Thu, 1 Mar 2018 18:43:54 +0000 (13:43 -0500)]
bgpd: fix update-group show commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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 agolib, zebra: Add type and instance to nexthop update message
Donald Sharp [Thu, 1 Mar 2018 00:22:47 +0000 (19:22 -0500)]
lib, zebra: Add type and instance to nexthop update message

Add the originating routes type and instance to the nexthop
update message.  This is necessary because there exist
scenarios where BGP needs to make a decision about the
originating route type and instance to know if it is
going to be doing a route replace to a route that would
resolve to itself.

Signed-off-by: Donald Sharp <sharpd@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 agoospfd: Add vrf to nhlfe route add
Donald Sharp [Thu, 1 Mar 2018 00:16:51 +0000 (19:16 -0500)]
ospfd: Add vrf to nhlfe route add

So when a ospf SR is sending down routes to the kernel
ensure that the nexthop vrf_id is set appropriately.
Yes SR is in the default VRF.  But for people who
run across this code in the future, they will know
to do the right thing from it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup api_nh in bgpd a bit
Donald Sharp [Thu, 1 Mar 2018 00:10:02 +0000 (19:10 -0500)]
bgpd: Cleanup api_nh in bgpd a bit

The api_nh was being figured 2 times, also refactor
the vrf_id placement as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>:
6 years agozebra: Use the passed in nexthops vrf
Donald Sharp [Wed, 28 Feb 2018 23:55:10 +0000 (18:55 -0500)]
zebra: Use the passed in nexthops vrf

When decoding and creating the appropriate data structures
for a nexthop, use the passed in vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Use STREAM_GET
Donald Sharp [Wed, 28 Feb 2018 23:53:44 +0000 (18:53 -0500)]
lib: Use STREAM_GET

The addition of some rmac code snuck in the usage of a
stream_get instead of a STREAM_GET()

We need to be using STREAM_GET()

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: add atomic bitwise OR, AND
Quentin Young [Wed, 28 Feb 2018 21:11:42 +0000 (16:11 -0500)]
lib: add atomic bitwise OR, AND

* Add support for C11 bitwise OR & AND operations
* Add atomic versions of bitfield macros

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
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 agoospfd: Add json output for Segment Routing
Olivier Dugeon [Fri, 9 Feb 2018 11:06:35 +0000 (12:06 +0100)]
ospfd: Add json output for Segment Routing

 - To ease checking the Segment Routing conformity in topotest,
add json output to 'show ip ospf database segment-routing' CLI.
 - Update ospfd user guide accordingly
 - Update OSPF-SR documentation with supported features and interoperability

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
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 agoMerge branch 'master' into evpn-bug-fixes
Mitesh Kanjariya [Tue, 27 Feb 2018 10:47:36 +0000 (02:47 -0800)]
Merge branch 'master' into evpn-bug-fixes

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>