]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #2368 from qlyoung/fix-show-bgp-l2vpn-evpn-missing-docstring
Renato Westphal [Tue, 5 Jun 2018 14:14:09 +0000 (11:14 -0300)]
Merge pull request #2368 from qlyoung/fix-show-bgp-l2vpn-evpn-missing-docstring

bgpd: fix missing docstring

6 years agoMerge pull request #2352 from qlyoung/fix-yet-another-vtysh-read-bug
Renato Westphal [Tue, 5 Jun 2018 14:05:48 +0000 (11:05 -0300)]
Merge pull request #2352 from qlyoung/fix-yet-another-vtysh-read-bug

vtysh: fix potential stack buffer overflow

6 years agoMerge pull request #2366 from msablic/pim_doc
Donald Sharp [Tue, 5 Jun 2018 11:41:31 +0000 (07:41 -0400)]
Merge pull request #2366 from msablic/pim_doc

doc: expanded PIM doc. w/ missing commands

6 years agoMerge pull request #2371 from gromit1811/pim-rp-lookup-messages-fix
Donald Sharp [Tue, 5 Jun 2018 11:40:53 +0000 (07:40 -0400)]
Merge pull request #2371 from gromit1811/pim-rp-lookup-messages-fix

pimd: Fix debug messages

6 years agoMerge pull request #2372 from gromit1811/pim-comment-fix
Donald Sharp [Tue, 5 Jun 2018 11:37:31 +0000 (07:37 -0400)]
Merge pull request #2372 from gromit1811/pim-comment-fix

pimd: Comment spelling fix

6 years agopimd: Comment spelling fix
Martin Buck [Tue, 5 Jun 2018 08:36:30 +0000 (10:36 +0200)]
pimd: Comment spelling fix

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
6 years agodoc: expanded PIM doc. w/ missing commands
Mladen Sablic [Mon, 4 Jun 2018 18:45:30 +0000 (20:45 +0200)]
doc: expanded PIM doc. w/ missing commands

PIM documantation was missing commands relevant to PIM protocol
that were documented in COMMANDS file of pimd directory.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
6 years agobgpd: fix missing docstring
Quentin Young [Mon, 4 Jun 2018 21:51:07 +0000 (21:51 +0000)]
bgpd: fix missing docstring

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1976 from pguibert6WIND/issue_1968
Donald Sharp [Mon, 4 Jun 2018 13:36:01 +0000 (09:36 -0400)]
Merge pull request #1976 from pguibert6WIND/issue_1968

Issue 1968 / ip route <> table X

6 years agoMerge pull request #2259 from ppmathis/enhancement/peer-enforce-first-as
Donald Sharp [Mon, 4 Jun 2018 13:35:00 +0000 (09:35 -0400)]
Merge pull request #2259 from ppmathis/enhancement/peer-enforce-first-as

bgpd: Move 'enforce-first-as' from global to peer

6 years agoMerge pull request #2355 from opensourcerouting/fix-build-freebsd-snmp
Donald Sharp [Mon, 4 Jun 2018 12:36:02 +0000 (08:36 -0400)]
Merge pull request #2355 from opensourcerouting/fix-build-freebsd-snmp

build: append -std=gnu99 after SNMP_CFLAGS

6 years agoMerge pull request #2356 from opensourcerouting/doc-ldpd-rfcs
Donald Sharp [Mon, 4 Jun 2018 12:35:03 +0000 (08:35 -0400)]
Merge pull request #2356 from opensourcerouting/doc-ldpd-rfcs

doc: list RFCs supported by ldpd in overview.rst

6 years agopimd: Fix debug messages
Martin Buck [Mon, 4 Jun 2018 12:27:48 +0000 (14:27 +0200)]
pimd: Fix debug messages

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
6 years agozebra: Add some vrf information to debug messages
Donald Sharp [Tue, 29 May 2018 14:33:04 +0000 (10:33 -0400)]
zebra: Add some vrf information to debug messages

When debugging code in redistribute.c, it is useful to output
the vrf we think the interface is in.  So display it
when we are debugging.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Actually release peer from bgp_peer hash
Donald Sharp [Thu, 31 May 2018 16:56:21 +0000 (12:56 -0400)]
bgpd: Actually release peer from bgp_peer hash

When we are determining the state of a peer, we sometimes
detect that we should update the peer->su.  The bgp->peer_hash
keeps a hash of peers based upon the peer->su.  This requires
us to release the stored value before we re-insert it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: open per vrf listen socket for linux type vrfs
Lou Berger [Sat, 2 Jun 2018 19:01:36 +0000 (15:01 -0400)]
bgpd: open per vrf listen socket for linux type vrfs

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agolib: fix setsockopt arg
Lou Berger [Sun, 6 May 2018 15:25:58 +0000 (11:25 -0400)]
lib: fix setsockopt arg

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agodoc: list RFCs supported by ldpd in overview.rst
Renato Westphal [Sun, 3 Jun 2018 01:36:10 +0000 (22:36 -0300)]
doc: list RFCs supported by ldpd in overview.rst

This is only a minor step in the direction of actually writing
documentation for ldpd...

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agobuild: append -std=gnu99 after SNMP_CFLAGS
Renato Westphal [Sun, 3 Jun 2018 01:00:32 +0000 (22:00 -0300)]
build: append -std=gnu99 after SNMP_CFLAGS

Programs that link to libnetsnmp must be compiled using a special set
of flags as specified by the "net-snmp-config --base-cflags" command
(whose output is stored in the SNMP_CFLAGS variable). The problem is
that "net-snmp-config --base-cflags" can output -std=c99 in addition to
other compiler flags in some platforms, and this breaks the build since
FRR souce code makes use of some GNU compiler extensions (e.g. allow
trailing commas in function parameter lists). In order to solve this
problem, append -std=gnu99 after SNMP_CFLAGS in all makefiles where this
variable is used. This way the -std=c99 flag will be overwritten when it's
present. Source files that don't link to libnetsnmp will be compiled using
either -std=gnu99 or -std=gnu11 depending on the compiler availability.

Fixes #1617.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agoMerge pull request #2245 from donaldsharp/type_4
Russ White [Fri, 1 Jun 2018 20:00:14 +0000 (16:00 -0400)]
Merge pull request #2245 from donaldsharp/type_4

Support EVPN Type 4 Routes

6 years agovtysh: fix potential stack buffer overflow
Quentin Young [Fri, 1 Jun 2018 19:25:03 +0000 (19:25 +0000)]
vtysh: fix potential stack buffer overflow

If vtysh was instructed to perform line-by-line processing on the output
of a command executed against a daemon and this output, as received by
vtysh, was not terminated with a newline, vtysh could print contents of
memory to its output device.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2329 from pguibert6WIND/issue_2275_proposal
Quentin Young [Fri, 1 Jun 2018 16:39:20 +0000 (12:39 -0400)]
Merge pull request #2329 from pguibert6WIND/issue_2275_proposal

doc: inform the diff between config from zebra and outside

6 years agoMerge pull request #2309 from opensourcerouting/master-mpls_te_print_detail-fix
Olivier Dugeon [Fri, 1 Jun 2018 14:32:15 +0000 (16:32 +0200)]
Merge pull request #2309 from opensourcerouting/master-mpls_te_print_detail-fix

isisd: fix mpls_te_print_detail to not read out-of-bounds

6 years agozebra: keep one command to handle vty with/without table param
Philippe Guibert [Thu, 17 May 2018 13:34:51 +0000 (15:34 +0200)]
zebra: keep one command to handle vty with/without table param

That fix is a workaround from a vtysh limitation.
Because table identifier should be accessible in configuration only for
vrf netns backends, there was a need to differentiate the vty commands.
Unfortunately, vtysh parses the two commands without knowing which
command has really been installed.
Using one single vty command will avoid having this issue in vtysh.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add in show vrf information about vrf backend kind
Philippe Guibert [Thu, 10 May 2018 08:05:28 +0000 (10:05 +0200)]
zebra: add in show vrf information about vrf backend kind

By default, nothing is displayed. If vrf backend is linux network
namespaces, then "netns-based vrfs" is displayed, before dumping the
list of VRFs.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add show ip route table vrf command
Philippe Guibert [Wed, 28 Mar 2018 09:06:39 +0000 (11:06 +0200)]
zebra: add show ip route table vrf command

It is possible to get table per VRF, provided that vrf backend is
configured with NETNS.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: ns_table list is extended to support multiple NETNS
Philippe Guibert [Wed, 28 Mar 2018 08:58:28 +0000 (10:58 +0200)]
zebra: ns_table list is extended to support multiple NETNS

In the case where vrf backend is netns, then the list of ns tables may
be extended. A single list is kept,but an attribute is added: the ns_id.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: table_id election with the vrf backend
Philippe Guibert [Wed, 28 Mar 2018 08:46:14 +0000 (10:46 +0200)]
zebra: table_id election with the vrf backend

As table_id for VRF with netns backend is main table ( RT_TABLE_MAIN or
zebrad.rtm_table_default), this makes possible to return the table id
that wants to be configured for those cases. ( in addition to default
VRF). In other cases ( VRF Lite presumably), then vrf table_id is
returned.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add table keyword to route configuration vty command
Philippe Guibert [Wed, 28 Mar 2018 09:31:22 +0000 (11:31 +0200)]
zebra: add table keyword to route configuration vty command

Add the table keyword for all ip route/ip mroute/ipv6 route commands
that are available. Also, the main structure is being added a table
identifier.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agodoc: replace 'intact' keyword with something more clear
Philippe Guibert [Wed, 30 May 2018 09:46:13 +0000 (11:46 +0200)]
doc: replace 'intact' keyword with something more clear

Keeping the config intact might be misunderstood. I say that even if VRF
netns is automatically discovered, it is possible for administrator to
save the netns information in the config file, to bring more clarity (
hence the config commands available).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agodoc: inform the diff between config from zebra and outside
Philippe Guibert [Wed, 30 May 2018 09:38:24 +0000 (11:38 +0200)]
doc: inform the diff between config from zebra and outside

To avoid some confusions, it is precised in the documentation that
the configuration not done from zebra will not be injected in the
configuration context. As consequence, the config file will not be
impacted by underlying network context. But also, this will not be
possible for *Zebra* to attempt to modify outside networking objects.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #2324 from qlyoung/docuser
Martin Winter [Fri, 1 Jun 2018 01:01:09 +0000 (03:01 +0200)]
Merge pull request #2324 from qlyoung/docuser

doc: cleanup sharp.rst

6 years agoMerge pull request #2250 from donaldsharp/watchfrr
Martin Winter [Thu, 31 May 2018 23:20:26 +0000 (01:20 +0200)]
Merge pull request #2250 from donaldsharp/watchfrr

redhat: Make watchfrr the default

6 years agoMerge pull request #2332 from donaldsharp/sa_42
Renato Westphal [Thu, 31 May 2018 15:10:35 +0000 (12:10 -0300)]
Merge pull request #2332 from donaldsharp/sa_42

Sa 42

6 years agoMerge pull request #2325 from donaldsharp/aggregate
Renato Westphal [Thu, 31 May 2018 15:05:48 +0000 (12:05 -0300)]
Merge pull request #2325 from donaldsharp/aggregate

bgpd: Add null0 route back for aggregate-address route created.

6 years agobgpd: Fix SA issue with uninited ifindex value
Donald Sharp [Thu, 31 May 2018 13:37:34 +0000 (09:37 -0400)]
bgpd: Fix SA issue with uninited ifindex value

The rearrangement of where the decision point of
filling in the aggregate information, must have allowed
SA to find a path of code where we may use ifindex uninitialized.
While I don't think this is possible to happen, make this issue
go away.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoisisd: fix mpls_te_print_detail to not read out-of-bounds
Christian Franke [Fri, 25 May 2018 16:21:25 +0000 (18:21 +0200)]
isisd: fix mpls_te_print_detail to not read out-of-bounds

6 years agobgpd: Ignore return code for str2prefix
Donald Sharp [Wed, 30 May 2018 13:50:22 +0000 (09:50 -0400)]
bgpd: Ignore return code for str2prefix

The call to str2prefix_rd when we get to this point of the
code cannot fail.  As such let's just ignore the return code.

Found by Coverity SA.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: hash_get w/ hash_alloc_intern cannot fail
Donald Sharp [Wed, 30 May 2018 13:42:24 +0000 (09:42 -0400)]
pimd: hash_get w/ hash_alloc_intern cannot fail

The assignment of sa with the usage of hash_get and hash_alloc_intern
can never fail.  No need to look for a failure case.

Found by Coverity SA.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Notice when peer_clear fails
Donald Sharp [Wed, 30 May 2018 13:37:03 +0000 (09:37 -0400)]
bgpd: Notice when peer_clear fails

Issue Found by Coverity Scan.  When we call peer_clear we
are checking the return code in every other call.  Add
a bit of extra code to notice the failure and note it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix redundant or test
Donald Sharp [Wed, 30 May 2018 13:32:33 +0000 (09:32 -0400)]
bgpd: Fix redundant or test

The if statement had a second instance of the same variable
to test as part of the statement.

Found by SA.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoredhat: Fix old systems on upgrade path
Donald Sharp [Wed, 30 May 2018 11:53:28 +0000 (07:53 -0400)]
redhat: Fix old systems on upgrade path

Fix old systems in upgrade path to enable watchfrr when upgrading.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoredhat: Make watchfrr the default
Donald Sharp [Thu, 17 May 2018 11:58:02 +0000 (07:58 -0400)]
redhat: Make watchfrr the default

With systemd being the default on more systems now, lets
configure watchfrr to start else systemd systems on
redhat will not stay up for more than 1 minute.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd, lib: Cleanup CI warnings from system
Donald Sharp [Wed, 16 May 2018 12:17:53 +0000 (08:17 -0400)]
bgpd, lib: Cleanup CI warnings from system

Make the CI system happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: support for evpn type-4 route
mitesh [Fri, 13 Apr 2018 22:01:12 +0000 (15:01 -0700)]
*: support for evpn type-4 route

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: Add null0 route back for aggregate-address route created.
Donald Sharp [Wed, 30 May 2018 00:04:17 +0000 (20:04 -0400)]
bgpd: Add null0 route back for aggregate-address route created.

The aggregate-address command is not creating the null0
route.  This got lost somewhere in the last year or so.
Add this ability back for BGP route installs into
zebra.

We need this aggregate route installed into the rib
because we are drawing this traffic to us irrelevant
of the number of routes we do have for that prefix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: cleanup sharp.rst
Quentin Young [Tue, 29 May 2018 21:00:59 +0000 (21:00 +0000)]
doc: cleanup sharp.rst

The user doc index was not displaying correctly because of some syntax
errors in sharp.rst

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2142 from pguibert6WIND/fs_zebra_complement
Donald Sharp [Tue, 29 May 2018 15:33:00 +0000 (11:33 -0400)]
Merge pull request #2142 from pguibert6WIND/fs_zebra_complement

Flowspec complement : port support and policy routing per interface and plugin wrapper

6 years agoMerge pull request #2307 from opensourcerouting/master-isis-tlv-copy-fix
Jafar Al-Gharaibeh [Tue, 29 May 2018 14:34:59 +0000 (10:34 -0400)]
Merge pull request #2307 from opensourcerouting/master-isis-tlv-copy-fix

isisd: fix bug in tlv_copy of empty MT-router-info

6 years agoMerge pull request #2266 from chiragshah6/ospfv3_dev
Jafar Al-Gharaibeh [Tue, 29 May 2018 14:33:48 +0000 (10:33 -0400)]
Merge pull request #2266 from chiragshah6/ospfv3_dev

ospf6d: Fix inter area prefix

6 years agoMerge pull request #2312 from opensourcerouting/master-malloc-0-fix
Donald Sharp [Tue, 29 May 2018 14:21:43 +0000 (10:21 -0400)]
Merge pull request #2312 from opensourcerouting/master-malloc-0-fix

lib: make allocators work for allocation sizes of 0

6 years agolib: make allocators work for allocation sizes of 0
Christian Franke [Tue, 29 May 2018 12:47:20 +0000 (14:47 +0200)]
lib: make allocators work for allocation sizes of 0

Fixes: #2155
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoMerge pull request #2310 from opensourcerouting/master-gitignore-pytest-cache
Quentin Young [Tue, 29 May 2018 07:45:04 +0000 (03:45 -0400)]
Merge pull request #2310 from opensourcerouting/master-gitignore-pytest-cache

tests: add pytest cache to gitignore

6 years agotests: add pytest cache to gitignore
Christian Franke [Fri, 25 May 2018 15:39:26 +0000 (17:39 +0200)]
tests: add pytest cache to gitignore

6 years agoisisd: fix bug in tlv_copy of empty MT-router-info
Christian Franke [Mon, 28 May 2018 12:13:18 +0000 (14:13 +0200)]
isisd: fix bug in tlv_copy of empty MT-router-info

6 years agoMerge pull request #2248 from ppmathis/enhancement/bgp-adjacent-routes
Jafar Al-Gharaibeh [Sun, 27 May 2018 16:53:33 +0000 (12:53 -0400)]
Merge pull request #2248 from ppmathis/enhancement/bgp-adjacent-routes

bgpd: Improve show commands for adjacent routes (advertised/received-routes)

6 years agoMerge pull request #2283 from donaldsharp/ignore_some_more
Russ White [Sun, 27 May 2018 15:02:15 +0000 (11:02 -0400)]
Merge pull request #2283 from donaldsharp/ignore_some_more

zebra: netlink cleanups

6 years agoMerge pull request #2291 from qlyoung/top-cleanup
Russ White [Sun, 27 May 2018 15:00:28 +0000 (11:00 -0400)]
Merge pull request #2291 from qlyoung/top-cleanup

*: remove update-autotools

6 years agoMerge pull request #2295 from qlyoung/sort-vni
Russ White [Sun, 27 May 2018 14:59:19 +0000 (10:59 -0400)]
Merge pull request #2295 from qlyoung/sort-vni

sort vni's

6 years agoMerge pull request #2289 from qlyoung/list-sort
Russ White [Sun, 27 May 2018 14:56:57 +0000 (10:56 -0400)]
Merge pull request #2289 from qlyoung/list-sort

linklist sorting + hash table -> linklist

6 years agoMerge pull request #2301 from LabNConsulting/working/master/bgpd-issue-2263-no-label...
Russ White [Sun, 27 May 2018 14:51:43 +0000 (10:51 -0400)]
Merge pull request #2301 from LabNConsulting/working/master/bgpd-issue-2263-no-label-auto

bgpd: issue 2263: fix "no label vpn export auto"

6 years agobgpd: issue 2263: fix "no label vpn export auto"
G. Paul Ziemba [Sat, 26 May 2018 14:05:42 +0000 (07:05 -0700)]
bgpd: issue 2263: fix "no label vpn export auto"

This command should unset the label (instead of wrongly
setting to "auto")

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agozebra: Add a breadcrumb for when we ignore a route
Donald Sharp [Fri, 25 May 2018 18:45:16 +0000 (14:45 -0400)]
zebra: Add a breadcrumb for when we ignore a route

When we receive a route that we think we own and we
are not in startup conditions, then add a small debug
to help debug the issue when this happens, instead
of silently just ignoring the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools, zebra: Use different protocol value for our statics
Donald Sharp [Fri, 25 May 2018 18:36:12 +0000 (14:36 -0400)]
tools, zebra: Use different protocol value for our statics

The re-use of RTPROT_STATIC has caused too many collisions
where other legitimate route sources are causing us to
believe we are the originator of the route.  Modify
the code so that if another protocol inserts RTPROT_STATIC
we will assume it's a Kernel Route.

Fixes: #2293
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2300 from ajones-rvbd/ajones-issue-2299
Donald Sharp [Fri, 25 May 2018 22:44:40 +0000 (18:44 -0400)]
Merge pull request #2300 from ajones-rvbd/ajones-issue-2299

zebra/if_netlink: trivial cleanup of IFLA_WIRELESS

6 years agozebra/if_netlink: trivial cleanup of IFLA_WIRELESS
Arthur Jones [Fri, 25 May 2018 21:34:32 +0000 (14:34 -0700)]
zebra/if_netlink: trivial cleanup of IFLA_WIRELESS

With:
commit ba7773964c87019308e65a15b509e9889f7edc49
Author: Renato Westphal <renato@opensourcerouting.org>
Date:   Wed Sep 20 22:12:56 2017 -0300

We added our own copy of if_link.h (among others).  This
file unconditionally defines IFLA_WIRELESS, so we don't need
the conditional defines in the if_netlink.c code...

Issue: https://github.com/FRRouting/frr/issues/2299
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
6 years agoMerge pull request #2272 from msablic/vtysh_reconnect
Quentin Young [Fri, 25 May 2018 18:09:44 +0000 (14:09 -0400)]
Merge pull request #2272 from msablic/vtysh_reconnect

vtysh: reconnect to daemons when connection lost

6 years agobgpd: sort vni's in running config
Quentin Young [Fri, 25 May 2018 16:39:38 +0000 (16:39 +0000)]
bgpd: sort vni's in running config

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add proper doc comments for hash & linklist
Quentin Young [Thu, 24 May 2018 18:43:57 +0000 (18:43 +0000)]
lib: add proper doc comments for hash & linklist

* Remove references to ospf source files from linklist.[ch]
* Remove documentation comments from hash.c and linklist.c
* Add comprehensive documentation comments to linklist.h and hash.h

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add hash_to_list()
Quentin Young [Thu, 24 May 2018 15:44:54 +0000 (15:44 +0000)]
lib: add hash_to_list()

Convenience function to convert hash table to an unsorted linked list.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: add list_sort(), list_dup()
Quentin Young [Thu, 24 May 2018 07:04:48 +0000 (07:04 +0000)]
lib: add list_sort(), list_dup()

* list_dup(): duplicates a linked list
* list_sort(): in-place sort of linked list w/ ascending quicksort

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: attributes presence checked when mpreach is present
Philippe Guibert [Fri, 25 May 2018 10:22:14 +0000 (12:22 +0200)]
bgpd: attributes presence checked when mpreach is present

On the case where an mp_unreach attribute is received, while there is no
mp_reach attribute too, it is not necessary to check for missing
attributes.

Fixes: 67495ddb2e5b ("bgpd: Fixes for recent well-known-attr check patch.")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: do not install BGP FS entries, while table range not obtained
Philippe Guibert [Wed, 23 May 2018 12:14:53 +0000 (14:14 +0200)]
bgpd: do not install BGP FS entries, while table range not obtained

Sometimes at startup, BGP Flowspec may be allocated a routing table
identifier not in the range of the predefined table range.
This issue is due to the fact that BGP peering goes up, while the BGP
did not yet retrieve the Table Range allocator.
The fix is done so that BGP PBR entries are not installed while
routing table identifier range is not obtained. Once the routing table
identifier is obtained, parse the FS entries and check that all selected
entries are installed, and if not, install it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: enhance debug bgp pbr error vty command
Philippe Guibert [Wed, 23 May 2018 12:10:38 +0000 (14:10 +0200)]
bgpd: enhance debug bgp pbr error vty command

Added following vty command:
[no] debug bgp pbr error

This permits dumping on the logs some errors related to PBR.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: increase buffer size to store ecomunity as a string
Philippe Guibert [Wed, 23 May 2018 10:10:00 +0000 (12:10 +0200)]
bgpd: increase buffer size to store ecomunity as a string

On the case where an ecom from FS redirect is received, the ecom may be
with the format A.B.C.D:E. On this case, the printable format of the
Flowspec redirect VRF ecom value may use more bytes in the buffer
dedicated for that. The buffer that stores the ecommunity is increased.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: brace zebra pbr traces
Philippe Guibert [Mon, 21 May 2018 10:02:52 +0000 (12:02 +0200)]
bgpd: brace zebra pbr traces

By default, some debug traces were displayed. Those pbr traces are
hidden with 'debug bgp zebra' command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add ZAPI_XXX_FAIL_REMOVE flag in switch
Philippe Guibert [Fri, 18 May 2018 16:15:47 +0000 (18:15 +0200)]
bgpd: add ZAPI_XXX_FAIL_REMOVE flag in switch

The new enums for handling REMOVE failures are appended in the switch
case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agopbrd: add ZAPI_RULE_FAIL_REMOVE flag in switch
Philippe Guibert [Fri, 18 May 2018 15:11:50 +0000 (17:11 +0200)]
pbrd: add ZAPI_RULE_FAIL_REMOVE flag in switch

The notification handler consecutive to an add/remove of a rule in zebra
is being added the FAIL_REMOVE flag. It is mapped on REMOVE flag
behaviour for now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: upon uninstalling pbr rule, update local structure
Philippe Guibert [Mon, 21 May 2018 14:40:31 +0000 (16:40 +0200)]
bgpd: upon uninstalling pbr rule, update local structure

Currently, uninstall pbr rule is not handled by BGP notification
handler. So the uninstall update of the structure is done, immediately
after sending the request of uninstall to zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add pbr objects fail_remove value into notification
Philippe Guibert [Fri, 18 May 2018 14:22:23 +0000 (16:22 +0200)]
zebra: add pbr objects fail_remove value into notification

After PBR or BGP sends back a request for sending a rule/ipset/ipset
entry/iptable delete, there may be issue in deleting it. A notification
is sent back with a new value indicating that the removal failed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: PBR show debugging IPSET/IPTABLE hooks declared
Philippe Guibert [Tue, 22 May 2018 07:42:55 +0000 (09:42 +0200)]
zebra: PBR show debugging IPSET/IPTABLE hooks declared

This hook can be used if the plugin module wrap_script is used.
This hook is called to dump the debugging status of this module, on the
vty.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: PBR config and monitor IPSET/IPTABLE hooks declared
Philippe Guibert [Fri, 4 May 2018 11:57:31 +0000 (13:57 +0200)]
zebra: PBR config and monitor IPSET/IPTABLE hooks declared

The following PBR handlers: ipset, and iptables will prioritary
call the hook from a possible plugin.
If a plugin is attached, then it will return a positive value.
That is why the return status is tested against 0 value, since that
means that there are no plugin module plugged

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: initialise nexthop structure, before filling in some attributes
Philippe Guibert [Thu, 3 May 2018 12:11:03 +0000 (14:11 +0200)]
bgpd: initialise nexthop structure, before filling in some attributes

In order to have a clean structure, a reset is done before using the
struct nexthop.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: traffic rate value is ignored for searching bpa
Philippe Guibert [Thu, 3 May 2018 12:09:35 +0000 (14:09 +0200)]
bgpd: traffic rate value is ignored for searching bpa

There are cases where a redirect IP or redirect VRF stops the ecom
parsing, then ignores a subsequent rate value, letting passed value to
0. Consequently, a new table identifier may be elected, despite the
routing procedure is the same. This fix ignores the rate value in bpa
list.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: handle more than one ext. community
Philippe Guibert [Thu, 3 May 2018 12:08:38 +0000 (14:08 +0200)]
bgpd: handle more than one ext. community

The ecommunity was badly read. This fix ensures that all ecom are reads
and stored in local structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add vty command to restrict FS policy routing to a defined interface
Philippe Guibert [Wed, 25 Apr 2018 16:29:35 +0000 (18:29 +0200)]
bgpd: add vty command to restrict FS policy routing to a defined interface

policy routing is configurable via address-family ipv4 flowspec
subfamily node. This is then possible to restrict flowspec operation
through the BGP instance, to a single or some interfaces, but not all.

Two commands available:
[no] local-install [IFNAME]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: display if FS entry is installed in PBR or not
Philippe Guibert [Fri, 20 Apr 2018 09:41:54 +0000 (11:41 +0200)]
bgpd: display if FS entry is installed in PBR or not

Once PBR rules installed, an information is printed in the main
show bgp ipv4 flowspec detail information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: pbr support for port redirecting
Philippe Guibert [Fri, 30 Mar 2018 10:25:03 +0000 (12:25 +0200)]
bgpd: pbr support for port redirecting

Ability for BGP FS to convert some rules containining at least one
address and one port information into a pbr_match_entry rule.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add 3 fields to ipset_entry : src,dst port, and proto
Philippe Guibert [Fri, 30 Mar 2018 11:01:39 +0000 (13:01 +0200)]
bgpd: add 3 fields to ipset_entry : src,dst port, and proto

Those 3 fields are read and written between zebra and bgpd.
This permits extending the ipset_entry structure.
Combinatories will be possible:
- filtering with one of the src/dst port.
- filtering with one of the range src/ range dst port
usage of src or dst is exclusive in a FS entry.
- filtering a port or a port range based on either src or dst port.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: do not account twice references to rule context
Philippe Guibert [Fri, 18 May 2018 14:14:46 +0000 (16:14 +0200)]
bgpd: do not account twice references to rule context

When rule add transaction is sent from bgpd to zebra, the reference
context must not be incremented while the confirmation message of
install has not been sent back; unless if the transaction failed to be
sent.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add missing ecommunity flowspec to display
Philippe Guibert [Thu, 17 May 2018 07:30:28 +0000 (09:30 +0200)]
bgpd: add missing ecommunity flowspec to display

On some cases, the ecommunity flowspec for redirect vrf is not displayed
in all cases. On top of that, display the values if ecom can no be
decoded.
Also, sub_type and type are changed from int to u_int8_t, because the
values contains match the type and sub type of extended communities.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: update comment when calling pbr southbound interface
Philippe Guibert [Thu, 3 May 2018 06:56:42 +0000 (08:56 +0200)]
zebra: update comment when calling pbr southbound interface

Some documentation is updated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: improve flowspec update of route to NH/VRF
Philippe Guibert [Mon, 21 May 2018 16:35:38 +0000 (18:35 +0200)]
bgpd: improve flowspec update of route to NH/VRF

The debugging message in charge of showing if the route is added or
witdrawn is changed accordingly to reflect this status.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add notify value in zlog notification message for pbr
Philippe Guibert [Mon, 30 Apr 2018 08:35:10 +0000 (10:35 +0200)]
bgpd: add notify value in zlog notification message for pbr

notifications values from zebra related to pbr are dumped.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handle iptable list of interfaces
Philippe Guibert [Wed, 25 Apr 2018 16:34:27 +0000 (18:34 +0200)]
zebra: handle iptable list of interfaces

Upon reception of an iptable_add or iptable_del, a list of interface
indexes may be passed in the zapi interface. The list is converted in
interface name so that it is ready to be passed to be programmed to the
underlying system.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add 3 fields to ipset_entry : src,dst port, and proto
Philippe Guibert [Fri, 30 Mar 2018 11:01:39 +0000 (13:01 +0200)]
zebra: add 3 fields to ipset_entry : src,dst port, and proto

Those 3 fields are read and written between zebra and bgpd.
This permits extending the ipset_entry structure.
Combinatories will be possible:
- filtering with one of the src/dst port.
- filtering with one of the range src/ range dst port
usage of src or dst is exclusive in a FS entry.
- filtering a port or a port range based on either src or dst port.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: pbr vty show command for ipset and iptables
Philippe Guibert [Mon, 23 Apr 2018 13:17:19 +0000 (15:17 +0200)]
zebra: pbr vty show command for ipset and iptables

Two new vty show functions available:
show pbr ipset <NAME>
show pbr iptables <NAME>

Those function dump the underlying "kernel" contexts. It relies on the
zebra pbr contexts. This helps then to know which zebra pbr
context has been configured since those contexts are mainly configured
by BGP Flowspec.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: add netlink rule support for fwmark option
Philippe Guibert [Fri, 27 Apr 2018 14:32:51 +0000 (16:32 +0200)]
zebra: add netlink rule support for fwmark option

When a mark is set, incoming traffic having that mark set can be
redirected to a specific table identifier. This work is done through
netlink.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: handle notification in case pbr ipset, or iptables is removed
Philippe Guibert [Mon, 23 Apr 2018 13:31:04 +0000 (15:31 +0200)]
zebra: handle notification in case pbr ipset, or iptables is removed

In cast the removal of an iptable or an ipset pbr context is done,
then a notification is sent back to the relevant daemon that sent the
message.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: cleanup zebra policy context
Philippe Guibert [Wed, 21 Mar 2018 16:52:41 +0000 (17:52 +0100)]
zebra: cleanup zebra policy context

Upon the remote daemon leaving, some contexts may have to be flushed.
This commit does the change. IPset and IPSet Entries and iptables are
flushed.

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