]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agozebra: handle label manager & fuzzing growths
Quentin Young [Tue, 24 Apr 2018 21:43:47 +0000 (17:43 -0400)]
zebra: handle label manager & fuzzing growths

Label manager reaches its hands into session / IO code for zserv for
whatever reason, gotta handle that.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: optimize zserv_process_messages
Quentin Young [Tue, 24 Apr 2018 21:03:19 +0000 (17:03 -0400)]
zebra: optimize zserv_process_messages

* Simplify zapi_msg <-> zserv interaction
* Remove header validity checks, as they're already performed before the
  packet ever makes it here
* Perform the same kind of batch processing done in zserv_write by
  copying multiple inbound packets under lock instead of doing serial
  locking
* Perform self-scheduling under the same lock

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: optimize zserv_write
Quentin Young [Tue, 24 Apr 2018 18:51:26 +0000 (14:51 -0400)]
zebra: optimize zserv_write

Dequeue all pending messages when writing and push them all into the
write buffer. This removes the necessity to self-schedule, avoiding a
mutex lock, and should also maximize throughput by not writing 1 packet
per job.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozserv: optimize zserv_read
Quentin Young [Tue, 24 Apr 2018 15:36:25 +0000 (11:36 -0400)]
zserv: optimize zserv_read

* Increase the maximum number of packets to read per read job
* Store read packets in a local cached buffer to avoid mutex overhead
* Only update last-read time / last-command if we actually read a packet
* Add missing log line for corrupt header case

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: refactor zserv names, consolidate events
Quentin Young [Mon, 23 Apr 2018 22:35:35 +0000 (18:35 -0400)]
zebra: refactor zserv names, consolidate events

* Add centralized thread scheduling dispatchers for client threads and
  the main thread

* Rename everything in zserv.c to stop using a combination of:
  - zebra_server_*
  - zebra_*
  - zserv_*

  Everything in zserv.c now begins with zserv_*.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: reorganize zserv.c by pthread affinity
Quentin Young [Mon, 23 Apr 2018 20:58:14 +0000 (16:58 -0400)]
zebra: reorganize zserv.c by pthread affinity

Since it is already quite difficult to understand the various pieces
going on here, I reorganized the file to make it much cleaner and easier
to understand. The organization is now:

zserv.c:
 ,---------------------------------.
/ include statements               |
| ...                              |
| ...                              |
| -------------------------------- |
| Client pthread server functions  |
| ...                              |
| ...                              |
| -------------------------------- |
| Main pthread server functions    |
| ...                              |
| ...                              |
| -------------------------------- |
| CLI commands, other              |
| ...                              |
| ...                              |
\_________________________________/

No code has been changed; the functions have merely been moved around.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix session stats data race, memory leak
Quentin Young [Mon, 23 Apr 2018 20:18:46 +0000 (16:18 -0400)]
zebra: fix session stats data race, memory leak

* Time counters need to use atomic access between threads
* After a client disconnects, we properly kill the thread but need to
  free its frr_pthread as well

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: fix some memory errors, scheduling bugs
Quentin Young [Sat, 21 Apr 2018 07:55:44 +0000 (03:55 -0400)]
zebra: fix some memory errors, scheduling bugs

* Add doc comments explaining hairy bits of thread lifecycle
* Remove t_suicide as it no longer makes sense
* Remove client double-free
* Remove unnecessary THREAD_OFF being used in incorrect pthread context
* Eliminate unnecessary racey access to client's obuf_fifo
* Ensure zserv_process_messages() reschedules itself if it has not
  finished its work

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: multithreaded zserv
Quentin Young [Wed, 14 Mar 2018 04:49:34 +0000 (00:49 -0400)]
zebra: multithreaded zserv

Handle each zclient in its own thread.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 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

5 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

5 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

5 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

5 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>
5 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

5 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

5 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

5 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)

5 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

5 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

5 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

5 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

5 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"

5 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>
5 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>
5 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>
5 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

5 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>
6 years agozebra: ipset and ipset entry deletion remove entry from hash list too
Philippe Guibert [Thu, 26 Apr 2018 11:31:16 +0000 (13:31 +0200)]
zebra: ipset and ipset entry deletion remove entry from hash list too

This commit is a fix that removes the structure from the hash list,
instead of just removing that structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agozebra: rework pbr ipset entry
Philippe Guibert [Tue, 27 Mar 2018 09:27:10 +0000 (11:27 +0200)]
zebra: rework pbr ipset entry

Add ns_id into zebra_pbr ipset
This is important so that each ipset entry knows on which NETNS the
ipset entry must be inkected

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #2282 from dslicenc/cm20939-nbr-msg
Renato Westphal [Fri, 25 May 2018 13:20:39 +0000 (10:20 -0300)]
Merge pull request #2282 from dslicenc/cm20939-nbr-msg

bgpd: improve error message for neighbor not found

6 years ago*: remove update-autotools
Quentin Young [Thu, 24 May 2018 22:45:49 +0000 (22:45 +0000)]
*: remove update-autotools

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: additional neighbor message improvement
Don Slice [Thu, 24 May 2018 14:58:37 +0000 (10:58 -0400)]
bgpd: additional neighbor message improvement

Added improved error message text to other places that could also
encounter the same condition.  In testing found that in certain
case, duplicate error messages were previously issued.  This fix
also removes the duplicates.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: improve error message for neighbor not found
Don Slice [Wed, 23 May 2018 12:09:59 +0000 (08:09 -0400)]
bgpd: improve error message for neighbor not found

Problem reported due to tab completion showing all possible peers
in every vrf, but when neighbor in wrong vrf entered "no such
neighbor" is the error message.  Making it slightly more clear
with "no such neighbor in the view/vrf" to clue the user that they
may have specified the wrong vrf.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agozebra: Fix RULE notification netlink messages
Donald Sharp [Thu, 24 May 2018 13:03:11 +0000 (09:03 -0400)]
zebra: Fix RULE notification netlink messages

Fix the code so that we would actually start receiving
RULE netlink notifications.

The Kernel expects the long long to be a bit field
value, while the newer netlink message types are
an enum.  So we need to convert the message type
number to a bit position and set that value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Remove unnecessary function parameter
Donald Sharp [Wed, 23 May 2018 13:37:06 +0000 (09:37 -0400)]
zebra: Remove unnecessary function parameter

The snl variable is no longer needed to be passed around, so
remove it from the calling path.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Move where we check for non-kernel netlink messages
Donald Sharp [Wed, 23 May 2018 13:24:12 +0000 (09:24 -0400)]
zebra: Move where we check for non-kernel netlink messages

Move where we check for non-kernel netlink messages to
a slightly earlier spot.  This will allow in subsuquent
commits the removal of an extra parameter that needs to
be passed around.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Ignore most netlink notifications from ourselves
Donald Sharp [Wed, 23 May 2018 12:25:51 +0000 (08:25 -0400)]
zebra: Ignore most netlink notifications from ourselves

The BPF filter was an exclusion list of netlink messages
we did not want to receive from our self.  The problem
with this is that the exclusion list was and will be
ever growing.  So switch the test around to an inclusion
list since it is shorter and not growing.  Right
now this is RTM_NEWADDR and RTM_DELADDR.

Change some of the debug messages to error messages
so that when something slips through and it is unexpected
during development we will see the problem.

Also try to improve the documentation about what
the filter is doing and leave some breadcrumbs for
future developers to know where to change code
when new functionality is added.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2279 from donaldsharp/evpn_moo_moo
Renato Westphal [Thu, 24 May 2018 02:17:02 +0000 (23:17 -0300)]
Merge pull request #2279 from donaldsharp/evpn_moo_moo

Evpn SA/CI issues found

6 years agoMerge pull request #2278 from donaldsharp/uninited_variable
Renato Westphal [Thu, 24 May 2018 01:58:52 +0000 (22:58 -0300)]
Merge pull request #2278 from donaldsharp/uninited_variable

bgpd: Fix use of uninitialized variable

6 years agoMerge pull request #2254 from qlyoung/fixup-vtysh-comments
Rafael Zalamena [Wed, 23 May 2018 17:00:15 +0000 (14:00 -0300)]
Merge pull request #2254 from qlyoung/fixup-vtysh-comments

misc cleanup for comments + docs

6 years agodoc: remove duplicated packages from dep list
Quentin Young [Wed, 23 May 2018 15:35:41 +0000 (15:35 +0000)]
doc: remove duplicated packages from dep list

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: make `frr` a system group
Quentin Young [Tue, 22 May 2018 21:23:37 +0000 (21:23 +0000)]
doc: make `frr` a system group

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: add install-info build dependency
Quentin Young [Tue, 22 May 2018 21:19:28 +0000 (21:19 +0000)]
doc: add install-info build dependency

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: remove recommendation against integrated conf
Quentin Young [Thu, 17 May 2018 21:07:32 +0000 (21:07 +0000)]
doc: remove recommendation against integrated conf

Missed this in code review

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: clean up 18.04 build doc
Quentin Young [Thu, 17 May 2018 21:06:32 +0000 (21:06 +0000)]
doc: clean up 18.04 build doc

Some excess underlines, 4-space indents and typos cleaned up.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agovtysh: rewrap comments
Quentin Young [Thu, 17 May 2018 17:04:57 +0000 (17:04 +0000)]
vtysh: rewrap comments

fixup comments for vtysh

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2280 from qlyoung/docuser
Renato Westphal [Tue, 22 May 2018 18:52:27 +0000 (15:52 -0300)]
Merge pull request #2280 from qlyoung/docuser

doc: move -r option docs to zebra only

6 years agoMerge pull request #2277 from pguibert6WIND/fix_case_zclient_broken
Donald Sharp [Tue, 22 May 2018 18:44:31 +0000 (14:44 -0400)]
Merge pull request #2277 from pguibert6WIND/fix_case_zclient_broken

zebra: upon zclient breaking, flush PBR entries

6 years agodoc: move -r option docs to zebra only
Quentin Young [Tue, 22 May 2018 17:50:30 +0000 (17:50 +0000)]
doc: move -r option docs to zebra only

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2268 from opensourcerouting/rpki-spec-fix
Donald Sharp [Tue, 22 May 2018 17:11:21 +0000 (13:11 -0400)]
Merge pull request #2268 from opensourcerouting/rpki-spec-fix

redhat: Fix RPKI RPM build option (Master Branch)

6 years agoMerge pull request #2273 from qlyoung/remove-retain-mode
Renato Westphal [Tue, 22 May 2018 15:49:24 +0000 (12:49 -0300)]
Merge pull request #2273 from qlyoung/remove-retain-mode

*: remove -r from daemons except zebra

6 years agozebra: upon zclient breaking, flush PBR entries
Philippe Guibert [Tue, 22 May 2018 10:22:08 +0000 (12:22 +0200)]
zebra: upon zclient breaking, flush PBR entries

In case, the BGP or PBR daemon leaves, the PBR contexts created by this
daemon are flushed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #2257 from donaldsharp/evpn_fixes
Lou Berger [Tue, 22 May 2018 15:33:01 +0000 (11:33 -0400)]
Merge pull request #2257 from donaldsharp/evpn_fixes

bgpd: Lock the parent rn as well

6 years agoMerge pull request #2220 from LabNConsulting/working/master/fix-asan
Quentin Young [Tue, 22 May 2018 15:15:28 +0000 (11:15 -0400)]
Merge pull request #2220 from LabNConsulting/working/master/fix-asan

*: fix compile with -enable-address-sanitizer configured

6 years agobgpd: Ensure virt->vrfs is valid
Donald Sharp [Tue, 22 May 2018 14:54:20 +0000 (10:54 -0400)]
bgpd: Ensure virt->vrfs is valid

Move the list_delete_and_null of the virt->vrfs code to
the actual deletion function to ensure proper lifecycle.
This assumption allows us to know that irt->vrfs is always
true so remove the NULL check on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Free vni list on actual deletion
Donald Sharp [Tue, 22 May 2018 14:50:53 +0000 (10:50 -0400)]
bgpd: Free vni list on actual deletion

The irt->vnis list was being freed on going down,
but actually delete it from the deletion function.  Then
we can know that the irt->vnis is a valid list anywhere
we have a irt pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Ensure we don't dereference a non-valid pointer
Donald Sharp [Tue, 22 May 2018 14:44:32 +0000 (10:44 -0400)]
bgpd: Ensure we don't dereference a non-valid pointer

The attr->ecommunity may be null coming into the function
at this point.  Ensure that it is.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix use of uninitialized variable
Donald Sharp [Tue, 22 May 2018 13:53:01 +0000 (09:53 -0400)]
bgpd: Fix use of uninitialized variable

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2262 from donaldsharp/v6_replace_semantics
Renato Westphal [Tue, 22 May 2018 12:05:06 +0000 (09:05 -0300)]
Merge pull request #2262 from donaldsharp/v6_replace_semantics

V6 replace semantics

6 years ago*: remove -r from daemons except zebra
Quentin Young [Wed, 16 May 2018 21:07:54 +0000 (21:07 +0000)]
*: remove -r from daemons except zebra

This option is only implemented by 4 daemons:
- BGPD
- RIPD
- RIPNGD
- Zebra

Manpages and documentation say that the option causes routes to not be
uninstalled from zebra when the daemon terminates. This is true for RIPD
and RIPNGD. This is not true for BGPD; in that daemon it only prevents
transmission of Cease / Peer Unconfig NOTIFICATION messages to peers.

Moreover, when any daemon disconnects from Zebra, all of its routes are
uninstalled from Zebra and the kernel regardless of this option,
rendering the option largely vestigial.

It is still useful in Zebra, where it prevents all routes from being
uninstalled when Zebra shuts down, so it is left there.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agovtysh: reconnect to daemons when connection lost
Mladen Sablic [Mon, 21 May 2018 18:00:51 +0000 (20:00 +0200)]
vtysh: reconnect to daemons when connection lost

Functionality to let vtysh attempt to reconnect to daemons when
connection is lost (e.g. crash or restart).

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
6 years agoospf6d: Fix inter area prefix
Chirag Shah [Thu, 17 May 2018 21:20:25 +0000 (14:20 -0700)]
ospf6d: Fix inter area prefix

Inter Area Prefix LSA ECMP is not working properly.
Two ABRs advertising IAP routes to backbone, not installed
with correct cost or if ABR restarted the route is removed
from backbone.
The current implementation ABR was not suppressing IAP update
for prefix cost is not better or route is not installed.
The better cost or path route was overwritten with non optimal
cost. This caused a loop with nexthops pointing each other
at backbone and non-backbone routers.

Consider to only send BEST/installed route's IAP notification
at ABRs.
When receiving IAP update from multiple ABRs, preserve multiple
advertising routers under the prefix route node.
Upon LSA maxage only remove the advertising route's which is
impacted and update route's nexthops and update FIB.

Testing Done:
Top to Bottom is part of area 0 on the Right, and
from Left side in area 1.
Top and Bottom act as ABRs.
H1 route is sent as Inter-Area Prefix to Right.
Trigger multiple triggers for ABR routes.
1) Shutting down link between, top to right to eliminate nhs
2) Restart frr at Top.
3) Restart frr at Right.

                                     +-----------+
                                     .           |
                                   ,'|   Top     |`.
                                  /  .           |  \
                                ,' ,'+.----------+`. `.
                               /  /  `          `.  \  ',
                             ,' ,' ,'             \  `.  .
                            -  /  `                `.  ', `,
                          ,` ,` ,'                   \   \  \
                         '  -  `                      `.  `, `,
       +--------+    +--`--`--`--+                  +---'---'--'+    +--------+
       |        |    |           |                  |           |    |        |
       |    H1  ------  Left     |                  |   Right   ------   H2   |
       |        |    |           |                  |           |    |        |
       +--------+    +-----------+                  +----.--,-,-+    +--------+
                        `.  `   \                       -  / /
                          \  `.  `                    ,' .` `
                           '   .  \                  /  /  '
                            `.  \  `.               `  / ,'
                              \  `   .            ,`  / /
                               `. `.  .          /   / /
                                 \  .  \       ,'   ' /
                                  '  '--'--------+,'.`
                                   `.|           - /
                                     '  mid1     |/
                                     |           -
                                     +-----------+

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #2267 from donaldsharp/flim_flam
Renato Westphal [Mon, 21 May 2018 12:49:45 +0000 (09:49 -0300)]
Merge pull request #2267 from donaldsharp/flim_flam

zebra: Cleanup some nits from Review Comments

6 years agozebra: Cleanup some nits from Review Comments
Donald Sharp [Mon, 21 May 2018 11:18:18 +0000 (07:18 -0400)]
zebra: Cleanup some nits from Review Comments

1) Small formating mistake fixed
2) Rename of a variable to give it a slightly better name

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2256 from donaldsharp/zebra_vxlan_flim_flam
Philippe Guibert [Mon, 21 May 2018 07:10:21 +0000 (09:10 +0200)]
Merge pull request #2256 from donaldsharp/zebra_vxlan_flim_flam

Zebra performance improvements at scale for vxlan code