]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 years agovrf: VRF_DEFAULT must be 0, remove useless code 7018/head
Christophe Gouault [Mon, 24 Aug 2020 16:01:15 +0000 (18:01 +0200)]
vrf: VRF_DEFAULT must be 0, remove useless code

Code was added in the past to support a value of VRF_DEFAULT different
from 0. This option was abandoned, the default vrf id is always 0.

Remove this code, this will simplify the code and improve performance
(use a constant value instead of a function that performs tests).

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
4 years agozebra: always display vrf in show ip route json
Christophe Gouault [Thu, 20 Aug 2020 09:15:33 +0000 (11:15 +0200)]
zebra: always display vrf in show ip route json

In route json outputs, always display the vrf even if it is the
default vrf.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
4 years agozebra: simplify and optimize vrf display in show ip route
Christophe Gouault [Thu, 20 Aug 2020 09:15:33 +0000 (11:15 +0200)]
zebra: simplify and optimize vrf display in show ip route

In all outputs (text and json): simplify and optimize the vrf name
display, use the vrf_id_to_name() handler.

Note: vrf_id_to_name() has a safeguard system that prevents from
crashing when the vrf cannot be found because it changed in some
(unexpected) manner, it returns "n/a".

Note: "vrf n/a" will now be displayed instead of "vrf UNKNOWN" in this
case, like in most other frr components.

This safeguard was missing for show ip route json, so this
optimization also fixes a potential crash.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
4 years agolib: optimize vrf_id_to_name(VRF_DEFAULT) case
Christophe Gouault [Wed, 26 Aug 2020 14:26:49 +0000 (16:26 +0200)]
lib: optimize vrf_id_to_name(VRF_DEFAULT) case

vrf_id_to_name() looks up in a RB_TREE to find the VRF entry, then
reads the name.

Avoid it for VRF_DEFAULT, which always exists and for which the
translation is straightforward.

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
4 years agozebra: fix show ip route output
Christophe Gouault [Thu, 20 Aug 2020 09:15:33 +0000 (11:15 +0200)]
zebra: fix show ip route output

Variable "show ip route" commands invoke the same helper
(do_show_ip_route), potentially several times.

When asking to dump a non-default vrf, all vrfs or all tables, the
output is messy, the header summarizing abbreviations is repeated
several times, excess line feeds appear, the default table of default
VRF is concatenated to the previous table output...

Normalize the output:

- whatever the case, display the common header at most once, if there
  is at least an entry to dump.

- when using a "vrf all" or "table all" command, prepend a line with
  the VRF and table (even for the default vrf or table).

- when dumping a specific vrf or table, prepend a line with the VRF
  and table.

Example (vrf all)
=================

router# show ip route vrf all
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF main:
C>* 10.0.2.0/24 is directly connected, mgmt0, 00:24:09
K>* 10.0.2.2/32 [0/100] is directly connected, mgmt0, 00:24:09
C>* 10.125.0.0/24 is directly connected, ntfp2, 00:00:26

VRF private:
S>* 1.1.1.0/24 [1/0] via 10.125.0.2, loop0, 00:00:29
C>* 10.125.0.0/24 is directly connected, loop0, 00:00:42

Example (main vrf)
==================

router# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

C>* 10.0.2.0/24 is directly connected, mgmt0, 00:24:41
K>* 10.0.2.2/32 [0/100] is directly connected, mgmt0, 00:24:41
C>* 10.125.0.0/24 is directly connected, ntfp2, 00:00:58

Example (specific vrf)
======================

router# show ip route vrf private
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF private:
S>* 1.1.1.0/24 [1/0] via 10.125.0.2, loop0, 00:01:23
C>* 10.125.0.0/24 is directly connected, loop0, 00:01:36

Example (all tables)
====================

router# show ip route table all
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF main table 200:
S>* 4.4.4.4/32 [1/0] via 10.125.0.3, ntfp2, 00:01:51

VRF main table 254:
C>* 10.0.2.0/24 is directly connected, mgmt0, 00:25:34
K>* 10.0.2.2/32 [0/100] is directly connected, mgmt0, 00:25:34
C>* 10.125.0.0/24 is directly connected, ntfp2, 00:01:51

Example (all vrf, all table)
============================

router# show ip route table all vrf all
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF main table 200:
S>* 4.4.4.4/32 [1/0] via 10.125.0.3, ntfp2, 00:02:15

VRF main table 254:
C>* 10.0.2.0/24 is directly connected, mgmt0, 00:25:58
K>* 10.0.2.2/32 [0/100] is directly connected, mgmt0, 00:25:58
C>* 10.125.0.0/24 is directly connected, ntfp2, 00:02:15

VRF private table 200:
S>* 2.2.2.0/24 [1/0] via 10.125.0.2, loop0, 00:02:18

VRF private table 254:
S>* 1.1.1.0/24 [1/0] via 10.125.0.2, loop0, 00:02:18
C>* 10.125.0.0/24 is directly connected, loop0, 00:02:31

Example (specific table)
========================

router# show ip route table 200
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

VRF main table 200:
S>* 4.4.4.4/32 [1/0] via 10.125.0.3, ntfp2, 00:05:26

Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
4 years agoMerge pull request #7036 from ton31337/fix/do_not_allow_setting_maximum-prefix-out_global
Donald Sharp [Sat, 19 Sep 2020 12:32:02 +0000 (08:32 -0400)]
Merge pull request #7036 from ton31337/fix/do_not_allow_setting_maximum-prefix-out_global

bgpd: maximum-prefix-out command fixes

4 years agoMerge pull request #7133 from Niral-Networks/niral_fix_ospf_timer
Donald Sharp [Sat, 19 Sep 2020 12:18:46 +0000 (08:18 -0400)]
Merge pull request #7133 from Niral-Networks/niral_fix_ospf_timer

ospfd : Fix for ospf dead interval and hello due.

4 years agoMerge pull request #7097 from mjstapp/fix_ubu20_doc_pip2
Donatas Abraitis [Sat, 19 Sep 2020 12:11:25 +0000 (15:11 +0300)]
Merge pull request #7097 from mjstapp/fix_ubu20_doc_pip2

doc: clarify python and pip2 for ubuntu 20

4 years agoMerge pull request #7069 from opensourcerouting/fix-set-metric
Donald Sharp [Sat, 19 Sep 2020 12:06:36 +0000 (08:06 -0400)]
Merge pull request #7069 from opensourcerouting/fix-set-metric

lib: fix the "set metric" route-map command

4 years agoospfd : Fix for ospf dead interval and hello due. 7133/head
Kaushik [Sat, 19 Sep 2020 07:29:25 +0000 (00:29 -0700)]
ospfd : Fix for ospf dead interval and hello due.

1. Ospf dead-interval will be set as 4 times of hello-interval, incase
if it is not set by using "ip ospf dead-interval <dead-val>".
2. On resetting hello-interval using "no ip ospf hello-interval" the
dead interval and hello due will be changed accordingly.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
4 years agoMerge pull request #6814 from gpnaveen/ospf_basic_functionality
Donald Sharp [Sat, 19 Sep 2020 01:20:04 +0000 (21:20 -0400)]
Merge pull request #6814 from gpnaveen/ospf_basic_functionality

tests: ospf basic functionality topojson testcases.

4 years agoMerge pull request #7074 from Niral-Networks/acl_fix
Donald Sharp [Sat, 19 Sep 2020 00:46:37 +0000 (20:46 -0400)]
Merge pull request #7074 from Niral-Networks/acl_fix

ospfd : Resolving conflict in distribute-list update during MaxAge LSA.

4 years agoMerge pull request #7079 from opensourcerouting/nested-yang-augmentations
Donald Sharp [Sat, 19 Sep 2020 00:43:20 +0000 (20:43 -0400)]
Merge pull request #7079 from opensourcerouting/nested-yang-augmentations

lib: better support for nested YANG augmentations

4 years agoMerge pull request #7131 from mjstapp/fix_topo_py2_iter
Donald Sharp [Fri, 18 Sep 2020 22:15:43 +0000 (18:15 -0400)]
Merge pull request #7131 from mjstapp/fix_topo_py2_iter

tests: use .items instead of .iteritems in topotests

4 years agoMerge pull request #7130 from volta-networks/fix_ldp_sync_topotest
Donald Sharp [Fri, 18 Sep 2020 22:00:42 +0000 (18:00 -0400)]
Merge pull request #7130 from volta-networks/fix_ldp_sync_topotest

tests: increase timeout to avoid intermittent LDP Sync test failure

4 years agotests: use .items instead of .iteritems in topotests 7131/head
Mark Stapp [Fri, 18 Sep 2020 18:03:49 +0000 (14:03 -0400)]
tests: use .items instead of .iteritems in topotests

Avoid py2-only .iteritems() api.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7086 from ckishimo/flush_type5
Donald Sharp [Fri, 18 Sep 2020 18:58:14 +0000 (14:58 -0400)]
Merge pull request #7086 from ckishimo/flush_type5

ospfd: flush type 5 when type 7 is removed

4 years agoMerge pull request #7077 from ckishimo/debug
Donald Sharp [Fri, 18 Sep 2020 18:56:12 +0000 (14:56 -0400)]
Merge pull request #7077 from ckishimo/debug

ospfd: fix debug ospf nssa prints wrong info

4 years agotests: increase timeout to avoid intermittent LDP Sync test failure 7130/head
Karen Schoener [Fri, 18 Sep 2020 17:54:51 +0000 (13:54 -0400)]
tests: increase timeout to avoid intermittent LDP Sync test failure

Signed-off-by: Karen Schoener <karen@voltanet.io>
4 years agoMerge pull request #7129 from kuldeepkash/bgp_basic_functionality
Donald Sharp [Fri, 18 Sep 2020 16:31:17 +0000 (12:31 -0400)]
Merge pull request #7129 from kuldeepkash/bgp_basic_functionality

tests: Add bgp_route_aggregation test suite

4 years agoMerge pull request #7089 from pguibert6WIND/netns-refactor
Russ White [Fri, 18 Sep 2020 15:02:30 +0000 (11:02 -0400)]
Merge pull request #7089 from pguibert6WIND/netns-refactor

Netns refactor

4 years agoMerge pull request #7128 from donaldsharp/pbr_vrf_disable
Mark Stapp [Fri, 18 Sep 2020 14:53:15 +0000 (10:53 -0400)]
Merge pull request #7128 from donaldsharp/pbr_vrf_disable

Pbr vrf disable

4 years agotests: Add bgp_route_aggregation test suite 7129/head
Kuldeep Kashyap [Fri, 18 Sep 2020 14:10:06 +0000 (14:10 +0000)]
tests: Add bgp_route_aggregation test suite

1. Added 2 tests to verify bgp route aggregation using summary-only and
   as-set commands
2. Execution time is ~90 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
4 years agolib: Remove debug associated with vrf_get 7128/head
Donald Sharp [Fri, 18 Sep 2020 11:14:55 +0000 (07:14 -0400)]
lib: Remove debug associated with vrf_get

The vrf_get function is called throughout the code base
so much so that when you turn on vrf debugging it eclipses
everything else to a degree that is completely unreasonable.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agotests: Optimising a step for not true case. 6814/head
nguggarigoud [Fri, 18 Sep 2020 09:40:54 +0000 (15:10 +0530)]
tests: Optimising a step for not true case.

1. Optimising a step for not true case.
2. Fixing a timing issue in route calculation script.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
4 years agotests: removing initial wait time in ospf.py
nguggarigoud [Tue, 15 Sep 2020 04:16:55 +0000 (09:46 +0530)]
tests: removing initial wait time in ospf.py

1. Removed initial_wait in ospf library.
2. Removed one test case which was random
   failure, will add back after traiging.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: Adding daemon check for ospfd in common_config.py
nguggarigoud [Tue, 8 Sep 2020 05:59:21 +0000 (11:29 +0530)]
tests: Adding daemon check for ospfd in common_config.py

start ospfd only when ospf config is used.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
4 years agotests: ospf basic functionality topojson testcases.
naveen [Tue, 18 Aug 2020 10:28:34 +0000 (15:58 +0530)]
tests: ospf basic functionality topojson testcases.

1. Removed static sleeps.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: ospf_basic_functionality topojson testcases.
naveen [Tue, 28 Jul 2020 15:02:17 +0000 (20:32 +0530)]
tests: ospf_basic_functionality topojson testcases.

1. Adding 18 ospf testcases to topojson.
2. Adding ospf.py library.

Test suite execution time is ~18 minutes.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agoMerge pull request #7123 from qlyoung/rename-bgp-fsm-event-update
Donatas Abraitis [Fri, 18 Sep 2020 08:26:11 +0000 (11:26 +0300)]
Merge pull request #7123 from qlyoung/rename-bgp-fsm-event-update

bgpd: rename bgp_fsm_event_update

4 years agoMerge pull request #7125 from qlyoung/what-the-frick-robert
Donatas Abraitis [Fri, 18 Sep 2020 07:38:13 +0000 (10:38 +0300)]
Merge pull request #7125 from qlyoung/what-the-frick-robert

tools: fix vtysh failure error handling

4 years agolib: Add vrf name to vrf debugs
Donald Sharp [Fri, 18 Sep 2020 00:17:14 +0000 (20:17 -0400)]
lib: Add vrf name to vrf debugs

The vrf name was not being printed out in some vrf debugs.  Add
this data in so people don't have to remember the vrf id.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agolib: Actually call nexthop_group_disable_vrf
Donald Sharp [Fri, 18 Sep 2020 00:13:44 +0000 (20:13 -0400)]
lib: Actually call nexthop_group_disable_vrf

When the nexthop-groups were added to FRR for some
reason the call to nexthop_group_disable_vrf was
not added although it was written.

Add it in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agotools: fix vtysh failure error handling 7125/head
Quentin Young [Thu, 17 Sep 2020 19:46:55 +0000 (15:46 -0400)]
tools: fix vtysh failure error handling

Based on the current code, I think the intent was to gracefully handle
vtysh failures and print a useful error message. Barriers in the way of
that:

- Despite reading the results of subprocess.communicate(), there won't
  be anything there, because we aren't passing subprocess.PIPE as stdin
  and stderr when calling subprocess.Popen()
- Despite catching subprocess.TimeoutExpired, if we were to actually hit
  this case frr-reload.py would just crash because it's calling
  .communicate() on an unbound process variable, probably a copy-paste
  error
- Aside from that, building a kwargs dict to pass to a function that
  contains something if something else is not None and nothing if it is,
  is pointless when we could just pass the thing itself

Net result is that if vtysh fails to read an frr.conf due to syntax
errors, instead of crashing with a traceback, we actually handle the
error condition, log the problem and vtysh's output, and exit. Actually
we were printing the failed line just by chance because stderr wasn't
captured from the subprocess and I guess showed up as part of systemd's
error capturing or something, but the traceback did a good job of
obscuring that with useless noise.

Old:

frrinit.sh[32183]:  * Started watchfrr
frrinit.sh[32183]: line 20: % Unknown command: eee
frrinit.sh[32183]: Traceback (most recent call last):
frrinit.sh[32183]:   File "/usr/lib/frr/frr-reload.py", line 1316, in <module>
frrinit.sh[32183]:     newconf.load_from_file(args.filename)
frrinit.sh[32183]:   File "/usr/lib/frr/frr-reload.py", line 231, in load_from_file
frrinit.sh[32183]:     file_output = self.vtysh.mark_file(filename)
frrinit.sh[32183]:   File "/usr/lib/frr/frr-reload.py", line 146, in mark_file
frrinit.sh[32183]:     % (child.returncode, stderr))
frrinit.sh[32183]: __main__.VtyshException: vtysh (mark file) exited with status 2:
frrinit.sh[32183]: None

New:

frrinit.sh[30090]:  * Started watchfrr
frrinit.sh[30090]: vtysh failed to process new configuration: vtysh (mark file) exited with status 2:
frrinit.sh[30090]: line 20: % Unknown command: eee

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agobgpd: rename bgp_fsm_event_update 7123/head
Quentin Young [Thu, 17 Sep 2020 16:38:12 +0000 (12:38 -0400)]
bgpd: rename bgp_fsm_event_update

This function is poorly named; it's really used to allow the FSM to
decide the next valid state based on whether a peer has valid /
reachable nexthops as determined by NHT or BFD.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agoMerge pull request #7114 from donaldsharp/tip_count
Donatas Abraitis [Thu, 17 Sep 2020 12:10:13 +0000 (15:10 +0300)]
Merge pull request #7114 from donaldsharp/tip_count

bgpd: Avoid memset when tip hash is empty

4 years agoMerge pull request #7108 from qlyoung/remove-double-holdtimer-cancel
Donatas Abraitis [Thu, 17 Sep 2020 12:08:49 +0000 (15:08 +0300)]
Merge pull request #7108 from qlyoung/remove-double-holdtimer-cancel

bgpd: remove extra hold-timer reset

4 years agoMerge pull request #7117 from AnuradhaKaruppiah/mh-macip-fixes
Rafael Zalamena [Thu, 17 Sep 2020 10:03:36 +0000 (07:03 -0300)]
Merge pull request #7117 from AnuradhaKaruppiah/mh-macip-fixes

zebra: fixup a neigh del bug introduced by a previous commit for EVPN-MH MAC-IP sync

4 years agoMerge pull request #7103 from opensourcerouting/sysrepo-fixes
Donald Sharp [Thu, 17 Sep 2020 00:34:53 +0000 (20:34 -0400)]
Merge pull request #7103 from opensourcerouting/sysrepo-fixes

lib: sysrepo plugin fixes

4 years agozebra: fixup a neigh del bug introduced by a previous commit for MAC-IP sync 7117/head
Anuradha Karuppiah [Tue, 12 May 2020 02:10:13 +0000 (19:10 -0700)]
zebra: fixup a neigh del bug introduced by a previous commit for MAC-IP sync

Problem commit -
[
b169fd6fd59ed zebra: support for MAC-IP sync routes
]

That commit had accidentally replaced a mac-ip del to bgp with a mac
del (consequence of a bad cut-paste).

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 years agobgpd: Avoid memset when tip hash is empty 7114/head
Donald Sharp [Wed, 16 Sep 2020 21:48:15 +0000 (17:48 -0400)]
bgpd: Avoid memset when tip hash is empty

The tip hash is only used when we are dealing with
evpn.  In bgp_nexthop_self we are doing a memset
irrelevant of whether we will ever find data.  Yes
hash_lookup will return pretty quickly.

Modify the code to avoid doing a memset in the case
where the tip hash is empty as that we know we'll
never find anything.  With full BGP feeds this
small memset does take some time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7066 from donaldsharp/more_test_speedups
Martin Winter [Wed, 16 Sep 2020 20:27:16 +0000 (22:27 +0200)]
Merge pull request #7066 from donaldsharp/more_test_speedups

tests: Speed up topotests by being more aggressive

4 years agoMerge pull request #7107 from AnuradhaKaruppiah/mh-cleanup
Patrick Ruddy [Wed, 16 Sep 2020 14:42:49 +0000 (15:42 +0100)]
Merge pull request #7107 from AnuradhaKaruppiah/mh-cleanup

zebra: re-name some mh functions to make the code more readable

4 years agoMerge pull request #7106 from AnuradhaKaruppiah/dad-mh-fix
Rafael Zalamena [Wed, 16 Sep 2020 12:31:00 +0000 (09:31 -0300)]
Merge pull request #7106 from AnuradhaKaruppiah/dad-mh-fix

zebra: dup detected mac avoid update to bgpd

4 years agoMerge pull request #7109 from qlyoung/set-threadmaster-default-name
Rafael Zalamena [Wed, 16 Sep 2020 12:30:12 +0000 (09:30 -0300)]
Merge pull request #7109 from qlyoung/set-threadmaster-default-name

lib: set threadmaster name to 'default' if none

4 years agoMerge pull request #7105 from AnuradhaKaruppiah/l3vni-ecom-leak
Rafael Zalamena [Wed, 16 Sep 2020 10:34:09 +0000 (07:34 -0300)]
Merge pull request #7105 from AnuradhaKaruppiah/l3vni-ecom-leak

bgpd: fix ecom leak handling l3vni update

4 years agolib: set threadmaster name to 'default' if none 7109/head
Quentin Young [Wed, 16 Sep 2020 00:11:39 +0000 (20:11 -0400)]
lib: set threadmaster name to 'default' if none

And also include the name of the threadmaster in its event hash name.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agobgpd: remove extra hold-timer reset 7108/head
Quentin Young [Wed, 16 Sep 2020 00:15:08 +0000 (20:15 -0400)]
bgpd: remove extra hold-timer reset

Handler function doesn't need to reset the hold timer, this is done
during the FSM update.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
4 years agozebra: re-name some mh functions to make the code more readable 7107/head
Anuradha Karuppiah [Sun, 31 May 2020 15:10:55 +0000 (08:10 -0700)]
zebra: re-name some mh functions to make the code more readable

As a part of the re-factoring some of the evpn_vni_es apis got re-named
as evpn_evpn_es. Changed them to evpn_es_evi to make it common to
vxlan and mpls.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
4 years agozebra: dup detected mac avoid update to bgpd 7106/head
Chirag Shah [Tue, 26 May 2020 18:43:14 +0000 (11:43 -0700)]
zebra: dup detected mac avoid update to bgpd

When a MAC is detected duplicate on a local
learn event (with freeze action),
do not send update to bgp to advertise into
evpn control plane.

With evpn mh, inform_client flag is set and
sends notification to bgp albeit dup detect
is set.

Check mac are detected as duplicate before
setting inform_client to true.

Ticket:CM-29817
Reviewed By:CCR-10329
Testing Done:

Enable DAD with freeze action
Upon local learn MAC detected as duplica

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: fix ecom leak handling l3vni update 7105/head
Quentin Young [Thu, 14 May 2020 22:33:10 +0000 (18:33 -0400)]
bgpd: fix ecom leak handling l3vni update

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #6905 from gpnaveen/topojson_kernel_version_check
Mark Stapp [Tue, 15 Sep 2020 19:43:25 +0000 (15:43 -0400)]
Merge pull request #6905 from gpnaveen/topojson_kernel_version_check

tests: Kernel version check for topojson scripts.

4 years agolib: simplify handling of the sysrepo startup configuration 7103/head
Renato Westphal [Sat, 12 Sep 2020 01:39:50 +0000 (22:39 -0300)]
lib: simplify handling of the sysrepo startup configuration

In the new Sysrepo, all SR_EV_ENABLED notifications are followed by
SR_EV_DONE notifications (assuming no errors occur), so there's no
need to special case the SR_EV_ENABLED event anymore (e.g. do full
transactions in one step).

While here, add a few more guarded debug messages to facilitate
troubleshooting.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agodoc: Say that maximum-prefix-out requires it's own update-group 7036/head
Donatas Abraitis [Wed, 2 Sep 2020 12:51:10 +0000 (15:51 +0300)]
doc: Say that maximum-prefix-out requires it's own update-group

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Create separate udpate-group when using `maximum-prefix-out` command
Donatas Abraitis [Wed, 2 Sep 2020 05:44:27 +0000 (08:44 +0300)]
bgpd: Create separate udpate-group when using `maximum-prefix-out` command

This is needed to avoid mangling update-group which is used for many peers.

Sent prefix count is managed by update-groups.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agolib: fix handling of deleted nodes in the sysrepo plugin
Renato Westphal [Sat, 12 Sep 2020 01:39:35 +0000 (22:39 -0300)]
lib: fix handling of deleted nodes in the sysrepo plugin

Make the sysrepo plugin ignore the deletion of configuration
nodes that don't exist anymore instead of logging an error and
rejecting the changes. This is necessary because Sysrepo delivers
delete notifications for all nodes of a deleted data tree instead
of delivering a single delete notification of the top-level subtree
node (which would suffice for the northbound layer).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: postpone the sysrepo plugin initialization
Renato Westphal [Sat, 12 Sep 2020 01:39:11 +0000 (22:39 -0300)]
lib: postpone the sysrepo plugin initialization

From Sysrepo's documentation:
"Note: do not use fork() after creating a connection. Sysrepo
internally stores PID of every created connection and this way a
mismatch of PID and connection is created".

Introduce a new "frr_very_late_init" hook in libfrr that is only
called after the daemon is forked (when the '-d' option is used)
and after the configuration is read. This way we can initialize
the sysrepo plugin correctly even when the daemon is daemonized,
and after the Sysrepo CLI commands are processed (only "debug
northbound client sysrepo" for now).

Fixes #7062

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoospfd: fix debug ospf nssa prints wrong info 7077/head
ckishimo [Thu, 10 Sep 2020 19:20:44 +0000 (12:20 -0700)]
ospfd: fix debug ospf nssa prints wrong info

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoMerge pull request #7099 from mjstapp/fix_doc_thread_rw
Lou Berger [Tue, 15 Sep 2020 15:20:13 +0000 (11:20 -0400)]
Merge pull request #7099 from mjstapp/fix_doc_thread_rw

doc: clarify independence of THREAD_READ and _WRITE

4 years agoMerge pull request #7082 from volta-networks/fix_isis_pseudo_lsp
Renato Westphal [Tue, 15 Sep 2020 14:25:04 +0000 (11:25 -0300)]
Merge pull request #7082 from volta-networks/fix_isis_pseudo_lsp

isisd: fix pseudonode LSP bug

4 years agoMerge pull request #7083 from volta-networks/isis_route_logs_improve
Renato Westphal [Tue, 15 Sep 2020 14:24:53 +0000 (11:24 -0300)]
Merge pull request #7083 from volta-networks/isis_route_logs_improve

isisd: improve route-event logs

4 years agotests: Addressing lint error. 6905/head
nguggarigoud [Tue, 15 Sep 2020 10:21:07 +0000 (15:51 +0530)]
tests: Addressing lint error.

Added new line to remove git link error.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: fixing pytest.skip error.
nguggarigoud [Tue, 15 Sep 2020 05:39:43 +0000 (11:09 +0530)]
tests: fixing pytest.skip error.

Updated scripts to handle skip on lower
kernel version.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: Moving kernel version check to API.
naveen [Tue, 18 Aug 2020 14:22:45 +0000 (19:52 +0530)]
tests: Moving kernel version check to API.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: Kernel version check for topojson scripts.
naveen [Wed, 12 Aug 2020 05:45:57 +0000 (11:15 +0530)]
tests: Kernel version check for topojson scripts.

1. Added linux kernel version check to avoid failures
in CI systems if matching kernel version not found.

Signed-off-by: naveen <nguggarigoud@vmware.com>
4 years agotests: Add topotest for BGP metric change 7069/head
Martin Winter [Mon, 14 Sep 2020 19:58:57 +0000 (21:58 +0200)]
tests: Add topotest for BGP metric change

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #7090 from dslicenc/comm-list-replace
Jafar Al-Gharaibeh [Mon, 14 Sep 2020 15:42:10 +0000 (10:42 -0500)]
Merge pull request #7090 from dslicenc/comm-list-replace

bgpd: correct community-list replace logic

4 years agodoc: updated user doc for routemap set metric cmd
David Schweizer [Mon, 14 Sep 2020 15:08:50 +0000 (17:08 +0200)]
doc: updated user doc for routemap set metric cmd

Updated the user documentation to reflect changes made to routemaps "set
metric" VTY shell command.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
4 years agodoc: clarify independence of THREAD_READ and _WRITE 7099/head
Mark Stapp [Mon, 14 Sep 2020 15:01:44 +0000 (11:01 -0400)]
doc: clarify independence of THREAD_READ and _WRITE

Make it clearer that the READ and WRITE tasks/events are
independent in the lib/thread apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodoc: clarify python and pip2 for ubuntu 20 7097/head
Mark Stapp [Mon, 14 Sep 2020 13:52:16 +0000 (09:52 -0400)]
doc: clarify python and pip2 for ubuntu 20

Must run the pip2 install script with python2 on ubuntu 20.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoMerge pull request #7093 from donaldsharp/pbr_flapping
Mark Stapp [Mon, 14 Sep 2020 12:13:48 +0000 (08:13 -0400)]
Merge pull request #7093 from donaldsharp/pbr_flapping

Pbr flapping

4 years agoMerge pull request #7065 from idryzhov/bgp-deprecated
Donatas Abraitis [Mon, 14 Sep 2020 09:45:08 +0000 (12:45 +0300)]
Merge pull request #7065 from idryzhov/bgp-deprecated

bgpd: remove deprecated commands

4 years agoisisd: improve route-event logs 7083/head
Emanuele Di Pascale [Tue, 8 Sep 2020 15:00:40 +0000 (17:00 +0200)]
isisd: improve route-event logs

suppress route-event logs that are uninformative and add more info to
the ones that matter, i.e. hints on what changed in a route update. The
suppressed logs can be enabled by defining EXTREME_DEBUG to 1, similarly
to what is done elsewhere in isisd (e.g. in isis_spf.c)

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoisisd: fix pseudonode LSP bug 7082/head
Emanuele Di Pascale [Fri, 11 Sep 2020 09:07:37 +0000 (11:07 +0200)]
isisd: fix pseudonode LSP bug

Currently, when the is-type of an area is changed and its circuits resign,
we are not resetting the DIS flag. Consequently, if the area type is reverted
we are not running the DR election and not regenerating the pseudonode LSP.

Also adding event debug logs for circuit commence/resign.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agobgpd: remove deprecated commands 7065/head
Igor Ryzhov [Tue, 8 Sep 2020 22:10:06 +0000 (01:10 +0300)]
bgpd: remove deprecated commands

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoospfd: flush type 5 when type 7 is removed 7086/head
ckishimo [Fri, 11 Sep 2020 14:20:29 +0000 (07:20 -0700)]
ospfd: flush type 5 when type 7 is removed

When the ASBR stops announcing a prefix into the NSSA area, the LSA
type 7 is removed from the area. However the ABR is refreshing the
type 5 in its LSDB while removing the Type 7 LSA. Routers outside
the area do not get an update.

With this change the LSA type 5 is flushed from the LSDB and the
change is announced to routers outside the area

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
4 years agoMerge pull request #7092 from sworleys/RPM-Link-Fix
Jafar Al-Gharaibeh [Sat, 12 Sep 2020 14:22:17 +0000 (09:22 -0500)]
Merge pull request #7092 from sworleys/RPM-Link-Fix

doc: fix rpm link under libyang help

4 years agoMerge pull request #7091 from opensourcerouting/nb-leafrefs
Donald Sharp [Sat, 12 Sep 2020 13:29:33 +0000 (09:29 -0400)]
Merge pull request #7091 from opensourcerouting/nb-leafrefs

lib: fix crashes with leafrefs that point to non-implemented modules

4 years agoospfd : Resolving conflict in distribute-list update during MaxAge LSA. 7074/head
Kaushik [Thu, 10 Sep 2020 08:58:56 +0000 (01:58 -0700)]
ospfd : Resolving conflict in distribute-list update during MaxAge LSA.

1. Fix for duplicating calls of ospf_external_lsa_refresh()
   in ospf_distribute_list_update_timer().
2. Added the comment and change from PR 6981.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
4 years agobgpd: correct community-list replace logic 7090/head
Don Slice [Thu, 10 Sep 2020 12:40:28 +0000 (12:40 +0000)]
bgpd: correct community-list replace logic

Problem rerported that if you enter an existing community list
sequence number with new community information, the entire community
list would be deleted.  This commit fixes the replace logic to do
the right thing.

Ticket: CM-30555
Signed-off-by: Don Slice <dslice@nvidia.com>
4 years agoMerge pull request #7084 from donaldsharp/pim_limitations
Jafar Al-Gharaibeh [Sat, 12 Sep 2020 03:15:02 +0000 (22:15 -0500)]
Merge pull request #7084 from donaldsharp/pim_limitations

pimd: Warn when we try to build MAXVIFS > 256

4 years agoMerge pull request #7095 from donaldsharp/coverity_5
Jafar Al-Gharaibeh [Sat, 12 Sep 2020 03:07:56 +0000 (22:07 -0500)]
Merge pull request #7095 from donaldsharp/coverity_5

isisd: ifp cannot be NULL

4 years agotests: Speed up topotests by being more aggressive 7066/head
Donald Sharp [Wed, 9 Sep 2020 03:04:42 +0000 (23:04 -0400)]
tests: Speed up topotests by being more aggressive

We have a bunch of tests that wait *then* check a command for success/failure.
Modify the tests to check *first* then to wait.  This reduces test
run times on my system by ~1400 seconds for a full run.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #7080 from opensourcerouting/staticd-minor-issues
Donald Sharp [Sat, 12 Sep 2020 00:07:19 +0000 (20:07 -0400)]
Merge pull request #7080 from opensourcerouting/staticd-minor-issues

staticd: remove dead code + minor fix

4 years agopimd: Warn when we try to build MAXVIFS > 256 7084/head
Donald Sharp [Fri, 11 Sep 2020 12:27:28 +0000 (08:27 -0400)]
pimd: Warn when we try to build MAXVIFS > 256

We use the pim mroute socket for kernel notifications of events.
Currently this is limited to 8 bits of data.  There are patches
coming down the pike in kernel land to allow this to expand.
Rather than fix this and all the other places we assume MAXVIFS < 256
in the pim code right now.  Leave a land mine for the developer
doing this work to point them in the right direction.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agopbrd: Ensure rule is installed on interface up 7093/head
Donald Sharp [Fri, 11 Sep 2020 17:05:55 +0000 (13:05 -0400)]
pbrd: Ensure rule is installed on interface up

If we are experiencing an interface that is bouncing
very fast and the last operation that we experienced
was a ifdown we will send rule deletions associated
with that interface.  If we have not received notification
that hte rule was removed *but* we immiedately get another
ifup notification when we go to install the rule we
are deciding that it's not ready to send down again,
as that we still think it is installed.

Force the rule installation when we have a interface up
event.

Ticket: CM-31042
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agobgpd, lib, pbrd, zebra: Pass by ifname
Donald Sharp [Thu, 10 Sep 2020 15:31:39 +0000 (11:31 -0400)]
bgpd, lib, pbrd, zebra: Pass by ifname

When installing rules pass by the interface name across
zapi.

This is being changed because we have a situation where
if you quickly create/destroy ephermeal interfaces under
linux the upper level protocol may be trying to add
a rule for a interface that does not quite exist
at the moment.  Since ip rules actually want the
interface name ( to handle just this sort of situation )
convert over to passing the interface name and storing
it and using it in zebra.

Ticket: CM-31042
Signed-off-by: Stephen Worley <sworley@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 years agoMerge pull request #6974 from liron-ze/high-cpu-usage
Renato Westphal [Fri, 11 Sep 2020 18:59:27 +0000 (15:59 -0300)]
Merge pull request #6974 from liron-ze/high-cpu-usage

zebra: Solve the problem of high CPU and memory usage when creating t…

4 years agoMerge pull request #6789 from volta-networks/feat_ldp_igp_sync
Renato Westphal [Fri, 11 Sep 2020 18:55:04 +0000 (15:55 -0300)]
Merge pull request #6789 from volta-networks/feat_ldp_igp_sync

ldpd: Add support for LDP-IGP Synchronization

4 years agolib: better support for nested YANG augmentations 7079/head
Renato Westphal [Thu, 10 Sep 2020 20:12:09 +0000 (17:12 -0300)]
lib: better support for nested YANG augmentations

Change the way the YANG schema node iteration functions work so that
the northbound layer won't have issues with more complex YANG modules
that contain multiple levels of YANG augmentations or modules that
augment themselves indirectly (by augmenting groupings).

Summary of the changes:
* Change the yang_snodes_iterate_subtree() function to always follow
  augmentations and add an optional "module" parameter to narrow down
  the iteration to nodes of a single module (which is necessary in
  some cases). Also, remove the YANG_ITER_ALLOW_AUGMENTATIONS flag
  as it's no longer necessary.
* Change yang_snodes_iterate_all() to do a DFS iteration on the resolved
  YANG data hierarchy instead of iterating over each module and their
  augmentations sequentially.

Reported-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoisisd: ifp cannot be NULL 7095/head
Donald Sharp [Fri, 11 Sep 2020 18:30:24 +0000 (14:30 -0400)]
isisd: ifp cannot be NULL

the ifp pointer cannot be NULL when we get to this point
in the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agostaticd: fix display of the "nexthop-vrf" parameter of static routes 7080/head
Renato Westphal [Fri, 11 Sep 2020 00:27:48 +0000 (21:27 -0300)]
staticd: fix display of the "nexthop-vrf" parameter of static routes

When the static route VRF and its nexthop VRF are inactive in the
kernel, both VRFs will have the same ID (VRF_UNKNOWN) even though
they might not be the same. This can cause "sh run" to not display
the "nexthop-vrf" parameter correctly when necessary. Change the
code to compare VRFs by their names to fix this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agostaticd: remove checks that are no longer necessary
Renato Westphal [Thu, 10 Sep 2020 21:45:42 +0000 (18:45 -0300)]
staticd: remove checks that are no longer necessary

All call sites of static_route_leak() are passing a non-null pointer
to the 'vty' parameter, hence remove the 'vty' null checks that
are no longer necessary.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agodoc: fix rpm link under libyang help 7092/head
Stephen Worley [Fri, 11 Sep 2020 18:11:48 +0000 (14:11 -0400)]
doc: fix rpm link under libyang help

Fix the rpm link under libyang help. The link was assuming
it was local without the https.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: fix crashes with leafrefs that point to non-implemented modules 7091/head
Renato Westphal [Fri, 11 Sep 2020 13:43:49 +0000 (10:43 -0300)]
lib: fix crashes with leafrefs that point to non-implemented modules

Whenever libyang loads a module that contains a leafref, it will
also implicitly load the module of the referring node if it's
not loaded already. That makes sense as otherwise it wouldn't be
possible to validate the leafref value correctly.

The problem is that loading a module implicitly violates the
assumption of the northbound layer that all loaded modules
are implemented (i.e. they have a northbound node associated
to each schema node). This means that loading a module that
isn't implemented can lead to crashes as the "priv" pointer
of schema nodes is no longer guaranteed to be valid. To fix this
problem, add a few null checks to ignore data nodes associated
to non-implemented modules.

The side effect of this change is harmless. If a daemon receives
configuration it doesn't support (e.g. BFD peers on staticd),
that configuration will be stored but otherwise ignored. This can
only happen when using a northbound client like gRPC, as the CLI
will never send to a daemon a command it doesn't support. This
minor problem should go away in the long run as FRR migrates to
a centralized management model, at which point the YANG-modeled
configuration of all daemons will be maintained in a single place.

Finally, update some daemons to stop implementing YANG modules
they don't need to (i.e. revert 1b741a01c and a74b47f5).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agobgp: remove duplicate command installs 7089/head
Pat Ruddy [Wed, 10 Jun 2020 13:39:37 +0000 (14:39 +0100)]
bgp: remove duplicate command installs

[no_]neighbor_nexthop_self_cmd & [no_]neighbor_nexthop_self_force_cmd
have duplicate install_element actions on the EVPN_NODE. This causes
duplicate command log errors which are caught by topotests. Remove
these.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
4 years agotest: topotest bgp_evpn_rt5 runs on kernel > 4.18
Philippe Guibert [Tue, 9 Jun 2020 14:49:51 +0000 (16:49 +0200)]
test: topotest bgp_evpn_rt5 runs on kernel > 4.18

if kernel is less than 4.18, then test will not run.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agotopotests: bgp_evpn_rt5 test uses ip link instead of bridge-utils
Philippe Guibert [Fri, 5 Jun 2020 13:59:43 +0000 (15:59 +0200)]
topotests: bgp_evpn_rt5 test uses ip link instead of bridge-utils

bridge-utils package is not available on tested distributions.
use ip link instead.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agotopotests: add bgp_evpn_rt5 test with vrf netns backend
Philippe Guibert [Tue, 3 Mar 2020 09:45:34 +0000 (10:45 +0100)]
topotests: add bgp_evpn_rt5 test with vrf netns backend

this test checks connectivity between a vrf-lite device and a vrf-netns
device. this ensures that evpn serice is importing appropriate evpn rt5
entries in the correct vrf.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 years agozebra: support for macvlan interfaces
Philippe Guibert [Thu, 6 Feb 2020 08:33:21 +0000 (09:33 +0100)]
zebra: support for macvlan interfaces

mac vlan interfaces are supported in different network namespaces.

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