]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #4850 from lkrishnamoor/show_cli
Russ White [Sat, 19 Oct 2019 01:30:37 +0000 (21:30 -0400)]
Merge pull request #4850 from lkrishnamoor/show_cli

bgpd: Adding new bgp evpn cli's for ip-prefix lookup

4 years agoMerge pull request #5180 from mjstapp/fix_nhrp_sa
Quentin Young [Fri, 18 Oct 2019 17:16:02 +0000 (13:16 -0400)]
Merge pull request #5180 from mjstapp/fix_nhrp_sa

nhrpd: clean up SA warning

4 years agoMerge pull request #5172 from donaldsharp/sa_clean_and_clean
Renato Westphal [Fri, 18 Oct 2019 02:14:31 +0000 (23:14 -0300)]
Merge pull request #5172 from donaldsharp/sa_clean_and_clean

Sa clean and clean

4 years agoMerge pull request #5182 from qlyoung/fix-doc-index-read-quanta
Renato Westphal [Fri, 18 Oct 2019 02:11:05 +0000 (23:11 -0300)]
Merge pull request #5182 from qlyoung/fix-doc-index-read-quanta

doc: fix read-quanta .. index copy-paste err

4 years agoMerge pull request #5181 from ghasemnaddaf/vrrp_updates
Quentin Young [Thu, 17 Oct 2019 22:55:08 +0000 (18:55 -0400)]
Merge pull request #5181 from ghasemnaddaf/vrrp_updates

vrrpd: use CS2MS instead of constant 10 everywhere

4 years agovrrpd: use CS2MS instead of constant 10 everywhere
Ghasem Naddaf [Wed, 16 Oct 2019 22:47:12 +0000 (15:47 -0700)]
vrrpd: use CS2MS instead of constant 10 everywhere

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
vrrpd: use CS2MS instead of constant 10 everywhere

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agonhrpd: clean up SA warning
Mark Stapp [Thu, 17 Oct 2019 13:52:51 +0000 (09:52 -0400)]
nhrpd: clean up SA warning

Try to signal to SA/clang more clearly to clean up an SA warning
in the nhrp-specific linkedlist code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodoc: fix read-quanta .. index copy-paste err
Quentin Young [Thu, 17 Oct 2019 19:53:19 +0000 (19:53 +0000)]
doc: fix read-quanta .. index copy-paste err

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5179 from ashish12pant/large_comm
Donald Sharp [Thu, 17 Oct 2019 17:47:20 +0000 (13:47 -0400)]
Merge pull request #5179 from ashish12pant/large_comm

tests: bgp community and bgp large-community

4 years agoMerge pull request #5165 from donaldsharp/evpn_fixup
Sri Mohana Singamsetty [Thu, 17 Oct 2019 17:15:01 +0000 (10:15 -0700)]
Merge pull request #5165 from donaldsharp/evpn_fixup

bgpd: return created bgp_path_info

4 years agoMerge pull request #5171 from donaldsharp/remove_getrusage
Mark Stapp [Thu, 17 Oct 2019 16:26:28 +0000 (12:26 -0400)]
Merge pull request #5171 from donaldsharp/remove_getrusage

*: Allow disabling of `getrusage` calls

4 years agoMerge pull request #5150 from qlyoung/bgp-vector-io-4
Mark Stapp [Thu, 17 Oct 2019 14:57:47 +0000 (10:57 -0400)]
Merge pull request #5150 from qlyoung/bgp-vector-io-4

BGP vector I/O - Redux

4 years agoMerge pull request #5161 from sworleys/Fix-Rule-Dbl-Free
Mark Stapp [Thu, 17 Oct 2019 14:31:40 +0000 (10:31 -0400)]
Merge pull request #5161 from sworleys/Fix-Rule-Dbl-Free

lib,zebra: Fix PBR Rule Ifp Reference if Interface is Deleted

4 years agoMerge pull request #5175 from opensourcerouting/debug-nb-yang
Mark Stapp [Thu, 17 Oct 2019 14:07:05 +0000 (10:07 -0400)]
Merge pull request #5175 from opensourcerouting/debug-nb-yang

lib, vtysh: add new libyang option to the "debug northbound" command

4 years agoMerge pull request #5167 from mjstapp/test_nhrp_list_sa
Sri Mohana Singamsetty [Thu, 17 Oct 2019 05:22:05 +0000 (22:22 -0700)]
Merge pull request #5167 from mjstapp/test_nhrp_list_sa

nhrpd: be more careful in linkedlist macro

4 years agoMerge pull request #5176 from qlyoung/alpine-update-mpfr-dep
Donatas Abraitis [Thu, 17 Oct 2019 05:13:01 +0000 (08:13 +0300)]
Merge pull request #5176 from qlyoung/alpine-update-mpfr-dep

fix alpine 🎿🎿🎿 docker build 🛠️

4 years agotests: Add test cases for bgp community and large community
Ashish Pant [Thu, 17 Oct 2019 03:49:26 +0000 (09:19 +0530)]
tests: Add test cases for bgp community and large community

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Test cases to check functionality of bgp large community and
bgp community path attribute

4 years agotests: Update cli error list and retry function
Ashish Pant [Wed, 16 Oct 2019 23:48:50 +0000 (05:18 +0530)]
tests: Update cli error list and retry function

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Add cli error returned for invalid bgp-community-list command

Fix retry function to avoid retries when expected is False

4 years agotests: Update bgp api for community and aggregate address
Ashish Pant [Wed, 16 Oct 2019 23:44:55 +0000 (05:14 +0530)]
tests: Update bgp api for community and aggregate address

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Add support for not sending community data in bgp and update
aggregate address configuration code

4 years agotests: Add verify community list api
Ashish Pant [Wed, 16 Oct 2019 23:41:42 +0000 (05:11 +0530)]
tests: Add verify community list api

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Api checks if community list is present in the system or not

4 years agotests: Add step api in topojson
Ashish Pant [Wed, 16 Oct 2019 23:15:28 +0000 (04:45 +0530)]
tests: Add step api in topojson

Signed-off-by: Ashish Pant <ashish12pant@gmail.com>
Print messages with a step number to log from test case

4 years agoalpine: clean up dep block
Quentin Young [Wed, 16 Oct 2019 20:38:27 +0000 (20:38 +0000)]
alpine: clean up dep block

Wrap to 80 cols...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoalpine: update mpfr3 -> mpfr4
Quentin Young [Wed, 16 Oct 2019 20:37:44 +0000 (20:37 +0000)]
alpine: update mpfr3 -> mpfr4

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: silence compiler warning in the gRPC plugin
Renato Westphal [Wed, 16 Oct 2019 20:13:28 +0000 (17:13 -0300)]
lib: silence compiler warning in the gRPC plugin

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib, vtysh: add new libyang option to the "debug northbound" command
Renato Westphal [Wed, 16 Oct 2019 19:59:54 +0000 (16:59 -0300)]
lib, vtysh: add new libyang option to the "debug northbound" command

Guard the libyang debug messages under this command so that only
people interested on those messages will see them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agovtysh: remove DEFPY variable names
Renato Westphal [Wed, 16 Oct 2019 16:05:17 +0000 (13:05 -0300)]
vtysh: remove DEFPY variable names

Some DEFPY commands were copied to vtysh without being cleaned up
properly. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #5078 from lkrishnamoor/advertise-routes
Russ White [Wed, 16 Oct 2019 19:05:23 +0000 (15:05 -0400)]
Merge pull request #5078 from lkrishnamoor/advertise-routes

bgpd: Fix "show bgp l2vpn evpn neighbors x.x.x.x advertised-routes json"

4 years agoMerge pull request #5118 from lkrishnamoor/routes_json
Russ White [Wed, 16 Oct 2019 19:01:13 +0000 (15:01 -0400)]
Merge pull request #5118 from lkrishnamoor/routes_json

bgpd: Fix in "show bgp l2vpn evpn neighbors X.X.X.X routes json"

4 years agobgpd: In redistribution aspath cannot be NULL
Donald Sharp [Wed, 16 Oct 2019 15:03:49 +0000 (11:03 -0400)]
bgpd: In redistribution aspath cannot be NULL

Coverity has found a path where the attr.aspath may be NULL.

assert that the aspath is non-null so we can make this go away.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: zrt->table cannot crash here
Donald Sharp [Wed, 16 Oct 2019 14:33:19 +0000 (10:33 -0400)]
zebra: zrt->table cannot crash here

If we have a zrt data structure then we have a table pointer
as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Coverity SA doesn't trust the CLI
Donald Sharp [Wed, 16 Oct 2019 14:30:28 +0000 (10:30 -0400)]
lib: Coverity SA doesn't trust the CLI

Fix with some asserts to show Coverity SA that we mean
real(:trademark:) business.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: `struct bgp_path_info *`->attr must not be NULL
Donald Sharp [Wed, 16 Oct 2019 14:25:19 +0000 (10:25 -0400)]
bgpd: `struct bgp_path_info *`->attr must not be NULL

We make the assumption that ->attr is not NULL throughout
the code base.  We are totally inconsistent about application
of this though.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agodoc: Add MRAI timer documentation to bgp docs
Donald Sharp [Wed, 16 Oct 2019 12:09:48 +0000 (08:09 -0400)]
doc: Add MRAI timer documentation to bgp docs

We were missing the bgp MRAI timer documentation.  Add it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Check setsockopt return codes
Donald Sharp [Wed, 16 Oct 2019 11:58:44 +0000 (07:58 -0400)]
bgpd: Check setsockopt return codes

Let end user know that a setsockopt failed and we may
be experiencing degraded performance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: Allow disabling of `getrusage` calls
Donald Sharp [Wed, 16 Oct 2019 17:19:09 +0000 (13:19 -0400)]
*: Allow disabling of `getrusage` calls

getrusage, in a heavily stressed system, can account for
signficant running time due to process switching to the kernel.
Allow the end-operator to specify `--disable-cpu-time` to
avoid this call.  Additionally we cause `show thread cpu` to
not show up if this is selected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agonhrpd: be more careful with linked lists
Mark Stapp [Wed, 16 Oct 2019 12:51:43 +0000 (08:51 -0400)]
nhrpd: be more careful with linked lists

NHRPD has its own linked-list implementation, and one of the
apis is a little free and easy with pointers. Also be safer
with one list iteration operation.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodoc: add documentation for write- and read-quanta
Quentin Young [Wed, 16 Oct 2019 14:41:54 +0000 (14:41 +0000)]
doc: add documentation for write- and read-quanta

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5155 from GalaxyGorilla/libyang_debug_logging
Donald Sharp [Wed, 16 Oct 2019 13:11:48 +0000 (09:11 -0400)]
Merge pull request #5155 from GalaxyGorilla/libyang_debug_logging

lib: Let libyang log everything possible

4 years agoMerge pull request #5139 from donaldsharp/zebra_write_cmd_missing
Donatas Abraitis [Wed, 16 Oct 2019 11:18:17 +0000 (14:18 +0300)]
Merge pull request #5139 from donaldsharp/zebra_write_cmd_missing

lib, zebra: Fix last write command written

4 years agobgpd: return created bgp_path_info
Donald Sharp [Wed, 16 Oct 2019 11:01:20 +0000 (07:01 -0400)]
bgpd: return created bgp_path_info

In bgp_create_evpn_bgp_path_info we create a bgp_path_info
that should be returned since we need it later.

Found by Coverity Scan.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Let libyang log everything possible
GalaxyGorilla [Tue, 15 Oct 2019 11:15:22 +0000 (11:15 +0000)]
lib: Let libyang log everything possible

Currently libyang logs errors only (LY_LLERR by default), independent of
FRR's log level. This commit lets libyang log everything including all
sorts of debug logs (when libyang is built in 'Debug' mode). FRR's
logging infrastructure filters logs out according to the configured log
level.

There is a very small performance overhead involved, even when libyang
is build in 'Release' mode. This overhead is mainly affecting config
processing and barely measurable being around 0-3% of the processing
time without this change.

Signed-off-by: Sascha Kattelmann <sascha@netdef.org>
4 years agoMerge pull request #5097 from ton31337/fix/do_not_reconnect_if_prefix_overflow
Donald Sharp [Tue, 15 Oct 2019 20:18:19 +0000 (16:18 -0400)]
Merge pull request #5097 from ton31337/fix/do_not_reconnect_if_prefix_overflow

bgpd: Keep the session down if maximum-prefix is reached

4 years agoMerge pull request #5088 from pogojotz/revert-asm-equiv-in-MTYPE
Donald Sharp [Tue, 15 Oct 2019 19:49:31 +0000 (15:49 -0400)]
Merge pull request #5088 from pogojotz/revert-asm-equiv-in-MTYPE

lib: Revert usage of asm-code in MTYPE definitions

4 years agozebra: Don't bother ref'ing ifp in zebra_pbr_rule
Stephen Worley [Tue, 15 Oct 2019 19:39:49 +0000 (15:39 -0400)]
zebra: Don't bother ref'ing ifp in zebra_pbr_rule

If we only really use the ifp for the name, then
don't bother referencing the ifp. If that ifp is
freed, we don't expect zebra to handle the rules that
use it (that's pbrd's job), so it is going to be
pointing to unintialized memory when we decide to remove
that rule later. Thus, just keep the name in the data
and dont mess with pointer refs.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #5134 from sudhanshukumar22/bgp-snmp-issue
Quentin Young [Tue, 15 Oct 2019 19:33:38 +0000 (15:33 -0400)]
Merge pull request #5134 from sudhanshukumar22/bgp-snmp-issue

lib: changes for making snmp socket non-blocking

4 years agoMerge pull request #5145 from Spantik/2796
Quentin Young [Tue, 15 Oct 2019 19:27:51 +0000 (15:27 -0400)]
Merge pull request #5145 from Spantik/2796

lib: Clean up the index that is being used for storing FD and events.

4 years agozebra: Use the rule ifindex as a hash key, not ifp
Stephen Worley [Tue, 15 Oct 2019 18:50:10 +0000 (14:50 -0400)]
zebra: Use the rule ifindex as a hash key, not ifp

Use the ifindex value as a primary hash key/identifier, not
the ifp pointer. It is possible for that data to be freed
and then we would not be able to hash and find the rule entry
anymore. Using the ifindex, we can still find the rule even
if the interface is removed.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Use ifindex_t for struct pbr_rule
Stephen Worley [Tue, 15 Oct 2019 18:48:33 +0000 (14:48 -0400)]
lib: Use ifindex_t for struct pbr_rule

We should be using the ifindex_t typedef here for the
type, not uint32_t.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Only free if rule was found/release in table
Stephen Worley [Tue, 15 Oct 2019 17:42:15 +0000 (13:42 -0400)]
zebra: Only free if rule was found/release in table

We were seeing a double free on shutdown if the
hash release fails here due to the interface state
changing. We probably shouldn't free the data if its
still being handled in the table so adding a check there
and a debug message.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib, zebra: Fix last write command written
Donald Sharp [Fri, 11 Oct 2019 12:56:39 +0000 (08:56 -0400)]
lib, zebra: Fix last write command written

With commit: a9ff90c41b0a95195d19d451ee83eb460e1599d0
the vrf_id_t was changed from a uint16_t to a uint32_t

Zebra tracked the last command sent to it's peer via peeking
into the data it was sending to each client ( since we had
lost the idea of what the command was when it was time to track
the data ).

Add a define to track this and add a bit of verbiage
to the code to allow us to notice when we screw with
the header again so that this is just fixed correctly
when it happens again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5153 from opensourcerouting/fix_libyang_warning
Donald Sharp [Tue, 15 Oct 2019 18:38:04 +0000 (14:38 -0400)]
Merge pull request #5153 from opensourcerouting/fix_libyang_warning

lib: fix harmless lyd_schema_sort() warning

4 years agobgpd: speak soothing words to scanbuild
Quentin Young [Tue, 15 Oct 2019 18:25:02 +0000 (18:25 +0000)]
bgpd: speak soothing words to scanbuild

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5156 from donaldsharp/soft_reconfig_the_peer
Russ White [Tue, 15 Oct 2019 15:37:07 +0000 (11:37 -0400)]
Merge pull request #5156 from donaldsharp/soft_reconfig_the_peer

bgpd: Soft reconfig-in should find the right bgp_path_info

4 years agoMerge pull request #5022 from chiragshah6/mdev
Russ White [Tue, 15 Oct 2019 15:34:22 +0000 (11:34 -0400)]
Merge pull request #5022 from chiragshah6/mdev

bgpd: evpn fix advertise-svi-ip display in show commands

4 years agoMerge pull request #5152 from donaldsharp/evpn_es_not_locking
Russ White [Tue, 15 Oct 2019 15:09:12 +0000 (11:09 -0400)]
Merge pull request #5152 from donaldsharp/evpn_es_not_locking

Some bgp evpn fixes

4 years agobgpd: Soft reconfig-in should find the right bgp_path_info
Donald Sharp [Tue, 15 Oct 2019 12:27:22 +0000 (08:27 -0400)]
bgpd: Soft reconfig-in should find the right bgp_path_info

When using soft reconfiguration inbound we are storing packet
data on the side for replaying when necessary.  The problem here
is that we are just grabbing the first bgp_path_info and using
that as the base.  What happens when we have soft-reconfig turned
on with multiple bgp_path_info's for a path?  This was introduced
in commit 8692c506520f6b268525b80890702432c95f13c4, yes back
in 2012!  I would argue, though, that it was just broken
in a different way before this.

Choose the correct bgp_path_info that corresponds to the peer
we received the data from for rethinking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5119 from lkrishnamoor/community-list
Donatas Abraitis [Tue, 15 Oct 2019 10:35:27 +0000 (13:35 +0300)]
Merge pull request #5119 from lkrishnamoor/community-list

bgpd: Implement "sh bgp l2vpn evpn community|large-community X"

4 years agolib: Clean up the index that is being used for storing FD and events.
Spantik [Mon, 14 Oct 2019 12:17:29 +0000 (05:17 -0700)]
lib: Clean up the index that is being used for storing FD and events.

When POLLNVAL is received for a FD then that FD is removed from the
pfd array and also array is rearranged using memmove. When memmove
is used then unused index are not cleanedup. When a new FD takes
up that index then it ends up using stale events without any handler
set for the same.

Signed-off-by: Santosh P K <sapk@vmware.com>
4 years agobgpd: Implement "sh bgp l2vpn evpn community|large-community X"
Lakshman Krishnamoorthy [Mon, 7 Oct 2019 21:58:39 +0000 (14:58 -0700)]
bgpd: Implement "sh bgp l2vpn evpn community|large-community X"

Full output here: https://github.com/FRRouting/frr/pull/5119

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agoMerge pull request #5130 from donaldsharp/as_path_json_maximum_overdrive
Donatas Abraitis [Tue, 15 Oct 2019 06:14:16 +0000 (09:14 +0300)]
Merge pull request #5130 from donaldsharp/as_path_json_maximum_overdrive

bgpd: AS paths are uint32_t instead of integers

4 years agoMerge pull request #5128 from chiragshah6/yang_dev
Renato Westphal [Tue, 15 Oct 2019 01:40:59 +0000 (22:40 -0300)]
Merge pull request #5128 from chiragshah6/yang_dev

yang: zebra modules formatting

4 years agolib: fix harmless lyd_schema_sort() warning
Renato Westphal [Tue, 15 Oct 2019 01:20:24 +0000 (22:20 -0300)]
lib: fix harmless lyd_schema_sort() warning

The dnode member of the nb_config structure can be null on
daemons that don't implement any YANG module. As such, update
the nb_cli_show_config_prepare() function to always check if the
libyang data node that is going to be displayed is null or not
before operating on it.

This fixes the following warning (introduced by commit 5e6a9350c1):
libyang: Invalid arguments (lyd_schema_sort())

Reported-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgpd: Be careful about displaying vni's as labels.
Donald Sharp [Tue, 15 Oct 2019 01:09:55 +0000 (21:09 -0400)]
bgpd: Be careful about displaying vni's as labels.

When a type 2/3 or 5 route is received, verified and the
resulting route generated is pushed into the appropriate vrf
the vni's associated with the route are also passed in.
This is showing up as a Remote label when you dump
the route in bgp:

BGP routing table entry for 0.0.0.0/0^M
Paths: (1 available, best #1, table third)
   Advertised to non peer-group peers:
   10.10.120.22
   42001 42005 42006 42055
     10.10.120.22 from 10.10.120.22 (10.10.255.193)
       Origin IGP, valid, external, bestpath-from-AS 42001, best
       Remote label: 62750
       AddPath ID: RX 0, TX 2
       Last update: Fri Oct 11 12:59:56 2019

The `Remote label: 62750` is the mpls label version of the
vni passed in.  This is meaningless and confusing to the end
user.  Do not display this information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Refactor bgp_path_info creation
Donald Sharp [Tue, 15 Oct 2019 01:05:15 +0000 (21:05 -0400)]
bgpd: Refactor bgp_path_info creation

We are doing the same thing in multiple places.  Refactor.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Properly lock parent node for type4 routes
Donald Sharp [Tue, 15 Oct 2019 00:44:56 +0000 (20:44 -0400)]
bgpd: Properly lock parent node for type4 routes

When creating a bgp_path_info for a type 4 route the pi->extra->parent
and the route node for the originating table were not being locked
properly.  This will prevent BGP from not properly cleaning up
the data structures on cleanup.

Possibly every one of the functions that we use to create the
new bgp_path_info's should use an abstracted version of this code,
but I am unsure at this point in time if a type 4 should use the same
or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5083 from zays26/feature/vtysh-master
Quentin Young [Mon, 14 Oct 2019 19:34:44 +0000 (15:34 -0400)]
Merge pull request #5083 from zays26/feature/vtysh-master

vtysh: fix searching commands in parent nodes

4 years agoMerge pull request #5148 from qlyoung/fix-bgp-read-assert
Lou Berger [Mon, 14 Oct 2019 18:45:03 +0000 (14:45 -0400)]
Merge pull request #5148 from qlyoung/fix-bgp-read-assert

bgpd: move assert out of error case

4 years agobgpd: raise default & max r/w quanta to 64
Quentin Young [Mon, 7 Oct 2019 17:33:39 +0000 (17:33 +0000)]
bgpd: raise default & max r/w quanta to 64

Vectored writes are more efficient with a higher quantum.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: vector I/O
Quentin Young [Fri, 4 Oct 2019 18:52:24 +0000 (18:52 +0000)]
bgpd: vector I/O

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agobgpd: move assert out of error case
Quentin Young [Mon, 14 Oct 2019 16:09:36 +0000 (16:09 +0000)]
bgpd: move assert out of error case

bgp_process_packets has an assert to make sure an appropriate amount of
working space in the input buffer has been freed up for future reads.
However, this assert shouldn't be made when we have encountered an error
that's going to tear down the session, because in this case we may not
be able to process the full contents of the input buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5132 from sworleys/Fix-IF-Infinite-Loop
Russ White [Mon, 14 Oct 2019 18:21:19 +0000 (14:21 -0400)]
Merge pull request #5132 from sworleys/Fix-IF-Infinite-Loop

*: Fix Interface Infinite Loop Walk and Cleanup if_create Codepath

4 years agoRevert "Merge pull request #4885 from satheeshkarra/pim_mlag"
Quentin Young [Mon, 14 Oct 2019 17:15:09 +0000 (17:15 +0000)]
Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"

This reverts commit d563896dada99f3474d428f928786cbfde936fee, reversing
changes made to 09ea1a40386f02a13cdb0462cc55af0d03f0c277.

4 years agobgpd: move assert out of error case
Quentin Young [Mon, 14 Oct 2019 16:09:36 +0000 (16:09 +0000)]
bgpd: move assert out of error case

bgp_process_packets has an assert to make sure an appropriate amount of
working space in the input buffer has been freed up for future reads.
However, this assert shouldn't be made when we have encountered an error
that's going to tear down the session, because in this case we may not
be able to process the full contents of the input buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5141 from opensourcerouting/bfdd-fixes-bundle
Donald Sharp [Mon, 14 Oct 2019 12:15:57 +0000 (08:15 -0400)]
Merge pull request #5141 from opensourcerouting/bfdd-fixes-bundle

bfdd: pack of bug fixes

4 years agoMerge pull request #5117 from ton31337/fix/remove_deprecation_for_ip_prefix
Donald Sharp [Mon, 14 Oct 2019 12:14:05 +0000 (08:14 -0400)]
Merge pull request #5117 from ton31337/fix/remove_deprecation_for_ip_prefix

bgpd: Remove depracated `ip` prefix for as-path/extcommunity/large/co…

4 years agoMerge pull request #5142 from opensourcerouting/northbound-perf
Donald Sharp [Mon, 14 Oct 2019 12:08:35 +0000 (08:08 -0400)]
Merge pull request #5142 from opensourcerouting/northbound-perf

Northbound optimizations

4 years agoMerge pull request #4885 from satheeshkarra/pim_mlag
Jafar Al-Gharaibeh [Mon, 14 Oct 2019 06:07:24 +0000 (01:07 -0500)]
Merge pull request #4885 from satheeshkarra/pim_mlag

pimd, lib, Zebra: PIM MLAG Support

4 years agolib: use `prefix` for yang get prefix wrapper
Rafael Zalamena [Fri, 11 Oct 2019 23:15:46 +0000 (20:15 -0300)]
lib: use `prefix` for yang get prefix wrapper

This change fixes a static analyzer warning and should also make us
safer when using this function. At the moment the code that triggered
the warning is the only one that uses this function.

Passing anything other than `struct prefix` to `str2prefix` function is
dangerous, because the structure might be smaller than expected and we
might have an buffer overflow.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agolib: reduce memory allocation when processing large config transactions
Renato Westphal [Thu, 10 Oct 2019 01:20:26 +0000 (22:20 -0300)]
lib: reduce memory allocation when processing large config transactions

Remove the xpath field from the nb_config_cb structure in order
to reduce its size. This allows the northbound to spend less time
allocating memory during the processing of large configuration
transactions.

To make this work, use yang_dnode_get_path() to obtain the xpath
from the dnode field whenever necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: fix processing of the 'apply_finish' callbacks
Renato Westphal [Thu, 10 Oct 2019 02:24:04 +0000 (23:24 -0300)]
lib: fix processing of the 'apply_finish' callbacks

Commit 6b5d6e2dbc88 changed how we order configuration callbacks
and introduced a regression in the processing of the 'apply_finish'
callbacks. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: optimize loading of the startup configuration
Renato Westphal [Thu, 10 Oct 2019 01:17:08 +0000 (22:17 -0300)]
lib: optimize loading of the startup configuration

Load the startup configuration directly into the CLI shared candidate
configuration instead of loading it into a private candidate
configuration. This way we don't need to initialize the shared
candidate separately later as a copy of the running configuration,
which is a potentially expensive operation.

Also, make the northbound process SIGHUP correctly even when --tcli
is not used.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: avoid expensive operations when editing a candidate config
Renato Westphal [Sun, 6 Oct 2019 04:16:47 +0000 (01:16 -0300)]
lib: avoid expensive operations when editing a candidate config

nb_candidate_edit() was calling both the lyd_schema_sort() and
lyd_validate() functions whenever a new node was added to the
candidate configuration. This was done to ensure the candidate
is always ready to be displayed correctly (libyang only creates
default child nodes during the validation process, and data nodes
aren't guaranteed to be ordered by default).

The problem is that the two aforementioned functions are too
expensive to be called in the northbound hot path. Instead, it makes
more sense to call them only before displaying the configuration
(in which case a recursive sort needs to be done). Introduce the
nb_cli_show_config_prepare() to achieve that purpose.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: remove expensive error handling in the northbound CLI client
Renato Westphal [Sun, 6 Oct 2019 00:20:28 +0000 (21:20 -0300)]
lib: remove expensive error handling in the northbound CLI client

The nb_cli_apply_changes() function was creating a full copy of
the candidate configuration before editing it. This excerpt from
the northbond documentation explains why this was being done:
 "NOTE: the nb_cli_cfg_change() function clones the candidate
  configuration before actually editing it. This way, if any error
  happens during the editing, the original candidate is restored to
  avoid inconsistencies. Either all changes from the configuration
  command are performed successfully or none are. It's like a
  mini-transaction but happening on the candidate configuration
  (thus the northbound callbacks are not involved)".

The problem is that this kind of error handling is just too
expensive. A command should never fail to edit the candidate
configuration unless there's a bug in the code (e.g. when the
CLI wrapper command passes an integer value that YANG rejects due
to a "range" statement). In such cases, a command might fail to
be applied or applied only partially if it edits multiple YANG
nodes. When that happens, just log an error to make the operator
aware of the problem, but otherwise ignore it instead of rejecting
the command and restoring the candidate to its previous state. We
shouldn't add an extreme overhead to the northbound CLI client only
to handle errors that should never happen in practice.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: optimize VTY_CHECK_XPATH
Renato Westphal [Sat, 5 Oct 2019 23:52:36 +0000 (20:52 -0300)]
lib: optimize VTY_CHECK_XPATH

There's no need to check for removed configuration objects in the
following two cases:
* A private candidate configuration is being edited;
* The startup configuration is being read.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobfdd: don't allow link-local without interface
Rafael Zalamena [Fri, 11 Oct 2019 19:54:51 +0000 (16:54 -0300)]
bfdd: don't allow link-local without interface

When using link-local addresses we must provide scope-id to the
operating system so it knows where to send packets.

Spotted by Pavel Ivashchenko (@zays26).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: simplify session observers code
Rafael Zalamena [Fri, 11 Oct 2019 19:13:24 +0000 (16:13 -0300)]
bfdd: simplify session observers code

Don't be selective about what to observe, always observe all possible
aspects of the session that may change on run-time (i.e. bind address,
interface and VRF existence).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: set session down after disabling it
Rafael Zalamena [Fri, 11 Oct 2019 16:12:26 +0000 (13:12 -0300)]
bfdd: set session down after disabling it

If a session is no longer able to send/receive packets, it is very
likely it will be down in a few milliseconds so lets speed up the
process and correctly mark it as down.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agolib: require json-c
Quentin Young [Fri, 11 Oct 2019 16:15:38 +0000 (16:15 +0000)]
lib: require json-c

We have unsigned 4 byte integrals in the codebase that end up in json
output, so we need to force a json library that can handle these.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5138 from ghasemnaddaf/vrrp_updates
Quentin Young [Fri, 11 Oct 2019 16:04:32 +0000 (12:04 -0400)]
Merge pull request #5138 from ghasemnaddaf/vrrp_updates

doc: minor updates to vrrp doc

4 years agodoc: minor updates to vrrp doc
Ghasem Naddaf [Fri, 11 Oct 2019 15:28:12 +0000 (08:28 -0700)]
doc: minor updates to vrrp doc

fix wrapping and indentation

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agobfdd: disable sockets polling before closing it
Rafael Zalamena [Fri, 11 Oct 2019 14:15:56 +0000 (11:15 -0300)]
bfdd: disable sockets polling before closing it

Otherwise the `thread_read` will keep waking us up to handle closing
sockets which are never unregistered.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agobfdd: upon vrf disable, unlink bfd session with vrf
Philippe Guibert [Thu, 10 Oct 2019 07:07:21 +0000 (09:07 +0200)]
bfdd: upon vrf disable, unlink bfd session with vrf

bfd session has a vrf pointer that needs to be reset, when vrf is
disabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agobfdd: Fixing coredump in log
SumitAgarwal123 [Thu, 19 Sep 2019 10:04:48 +0000 (03:04 -0700)]
bfdd: Fixing coredump in log

Param missing in debug log, leading to coredump

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
4 years agoMerge pull request #5131 from donaldsharp/extra_clean
Russ White [Fri, 11 Oct 2019 11:24:39 +0000 (07:24 -0400)]
Merge pull request #5131 from donaldsharp/extra_clean

bgpd: When creating extra from stack ensure it is zero'ed out

4 years agolib: changes for making snmp socket non-blocking
sudhanshukumar22 [Thu, 10 Oct 2019 06:13:09 +0000 (23:13 -0700)]
lib: changes for making snmp socket non-blocking

Description: The changes have been done to make the snmp socket
non-blocking before calling snmp_read()

Problem Description/Summary :
vtysh hangs on first try to enter after a reboot with BGP dynamic peers

Expected Behavior :
VTYSH should not hang.

When we debug more into bgpd docker by doing gdb on its threads, we find the below thread of bgpd, which is causing the issue.
Thread 1 (Thread 0x7f1e1ec46d40 (LWP 47)):

0x00007f1e1d762593 in recvfrom () from /lib/x86_64-linux-gnu/libpthread.so.0
0x00007f1e1aadd09b in netsnmp_tcpbase_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aad9617 in netsnmp_transport_recv () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab2c07 in _sess_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3a29 in snmp_sess_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3a7b in snmp_read2 () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1aab3acf in snmp_read () from /usr/lib/x86_64-linux-gnu/libnetsnmp.so.30
0x00007f1e1b44d7ec in agentx_read (t=0x7fffa75f0080) at lib/agentx.c:63
0x00007f1e1e7d6451 in thread_call (thread=0x7fffa75f0080) at lib/thread.c:1620
0x00007f1e1e770699 in frr_run (master=0x559396ea60f0) at lib/libfrr.c:1011
0x0000559395b4d953 in main (argc=5, argv=0x7fffa75f02b8) at bgpd/bgp_main.c:492

(gdb) bt

0x00007f830c89d210 in __read_nocancel () from /lib/x86_64-linux-gnu/libpthread.so.0
0x000056450e1e8238 in vtysh_client_run (vclient=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:216
0x000056450e1e8c6b in vtysh_client_run_all (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable, continue_on_err=0, callback=0x0, cbarg=0x0) at vtysh/vtysh.c:356
0x000056450e1e8ddb in vtysh_client_execute (head_client=0x56450e4a8b40 <vtysh_client+24768>, line=0x56450e21add0 enable) at vtysh/vtysh.c:393
0x000056450e1e9c82 in vtysh_execute_func (line=0x56450e21add0 enable, pager=0) at vtysh/vtysh.c:598
0x000056450e1e9dee in vtysh_execute_no_pager (line=0x56450e21add0 enable) at vtysh/vtysh.c:619
0x000056450e1f7d48 in vtysh_read_file (confp=0x56451000a9d0, top_cfg=1) at vtysh/vtysh_config.c:494
0x000056450e1f7ef2 in vtysh_read_config (config_default_dir=0x56450e4edc20 <frr_config> /etc/frr/frr.conf, top_cfg=1) at vtysh/vtysh_config.c:522
0x000056450e1e5de4 in vtysh_apply_top_level_config () at vtysh/vtysh_main.c:301
0x000056450e1e7842 in main (argc=2, argv=0x7ffc81e6f598, env=0x7ffc81e6f5b0) at vtysh/vtysh_main.c:692

The fix has been taken from the following link.
https://sourceforge.net/p/net-snmp/patches/1348/

Signed-off-by: Preetham Singh <preetham.singh@broadcom.com>
4 years agoMerge pull request #4265 from pguibert6WIND/bgp_export_entries_to_table
Donald Sharp [Fri, 11 Oct 2019 01:28:51 +0000 (21:28 -0400)]
Merge pull request #4265 from pguibert6WIND/bgp_export_entries_to_table

bgpd: ability to export prefixes entries to a kernel table identifier

4 years agodoc: minor updates to vrrp doc
Ghasem Naddaf [Thu, 10 Oct 2019 23:04:58 +0000 (16:04 -0700)]
doc: minor updates to vrrp doc

clarify IPv6 address, debug config and default version

Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
4 years agoyang: add range to string nodes in zebra modules
Chirag Shah [Wed, 9 Oct 2019 01:17:12 +0000 (18:17 -0700)]
yang: add range to string nodes in zebra modules

Add range to few of the string nodes
(including vrf, iptable names)
Use interface reference instead of interface string.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoyang: align indent zebra modules
Chirag Shah [Sat, 5 Oct 2019 02:09:41 +0000 (19:09 -0700)]
yang: align indent zebra modules

Align zebra yang files based on pyang lint format.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: entries can be pushed in tables, under vrf netns backend
Philippe Guibert [Tue, 9 Jul 2019 09:09:19 +0000 (11:09 +0200)]
zebra: entries can be pushed in tables, under vrf netns backend

initially, vrf backend if vrf-lite, and a specific table identifier is
associated to a vrf. here, with netns vrf backend, there is no specific
table assigned to except default routing table. use the passed table_id
parameter in zapi api, and apply it to the entry to be pushed in, or to
be removed.

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