]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agozebra: update dataplane flowspec address family in ipset_info
Philippe Guibert [Thu, 28 Oct 2021 16:28:42 +0000 (18:28 +0200)]
zebra: update dataplane flowspec address family in ipset_info

It is needed for the ipset entry to know for which address family
this ipset entry applies to. Actually, the family is in the original
ipset structure and was not passed as attribute in the dataplane
ipset_info structure. Add it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agozebra: fix flowspec ipset operations
Philippe Guibert [Thu, 28 Oct 2021 11:42:57 +0000 (13:42 +0200)]
zebra: fix flowspec ipset operations

When injecting an ipset entry into the zebra dataplane context, the
ipset name is stored in a separate structure. This will permit the
flowspec plugin to be able to know which ipset has to be appended with
relevant ipset entry.
The problem was that the zebra dataplane objects related to ipset entries
is made up of an union between the ipset structure and the ipset info
structure. This was implying that the two structures were on the same
memory zone, and when extracting the data stored, the data were incomplete.

Fix this by replacing the union structure by a defined struct.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9909 from pguibert6WIND/ospf6_dumb_contexxt
Igor Ryzhov [Wed, 3 Nov 2021 12:58:58 +0000 (15:58 +0300)]
Merge pull request #9909 from pguibert6WIND/ospf6_dumb_contexxt

ospf6d: avoid writing dumb ospf6 info at startup

2 years agoospf6d: avoid writing dumb ospf6 info at startup
Philippe Guibert [Wed, 27 Oct 2021 14:45:05 +0000 (16:45 +0200)]
ospf6d: avoid writing dumb ospf6 info at startup

in show: 'show ipv6 ospf6' handler command, the reason of SPF
executation is looked up and displayed. At startup, SPF has been
started, but shows no specific reason. Instead of dumping non
initialised string context, reset the string context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9930 from donaldsharp/all_protocol_sporadic
Martin Winter [Tue, 2 Nov 2021 00:03:28 +0000 (01:03 +0100)]
Merge pull request #9930 from donaldsharp/all_protocol_sporadic

tests: All_protocol_startup sporadic failure

2 years agoMerge pull request #9922 from donaldsharp/fix_scripting
Martin Winter [Mon, 1 Nov 2021 22:35:12 +0000 (23:35 +0100)]
Merge pull request #9922 from donaldsharp/fix_scripting

lib: Return Null when we have an empty string for script name

2 years agotests: All_protocol_startup sporadic failure
Donald Sharp [Mon, 1 Nov 2021 19:08:50 +0000 (15:08 -0400)]
tests: All_protocol_startup sporadic failure

the test_nexthop_groups function is failing occassionally
because the test executes 4 in succession sharp install
routes commands.  When I dumped the rib on a failed test
run there were only 2 of the 4 routes in the rib and
the two that were in were the last 2 installed.
The sharp daemon setups a event process where it
installs routes `automatically`.  If the previous
run is not finished entering a new command to install
the routes will mess up the last one from ever happening.
It is assumed that the user doesn't do stupid stuff here.
In this case I am just adding a small sleep between each
installation to just let the test proceed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Return Null when we have an empty string for script name
Donald Sharp [Fri, 29 Oct 2021 17:03:42 +0000 (13:03 -0400)]
lib: Return Null when we have an empty string for script name

The script entries were being stored in a hash lookup with
the script name a pre-defined array of characters.  The hash
lookup is succeeding since it is auto-installed at script
start time irrelevant if there is a handler function.

Modify the code so that if the scriptname is an empty
string "\0" just return a NULL so that zebra does
not attempt to actually load up the script

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9928 from donaldsharp/isis_topo1_fix
Igor Ryzhov [Mon, 1 Nov 2021 09:25:32 +0000 (12:25 +0300)]
Merge pull request #9928 from donaldsharp/isis_topo1_fix

tests: isis_topo1 needs to wait for results under load

2 years agotests: isis_topo1 needs to wait for results under load
Donald Sharp [Mon, 1 Nov 2021 00:08:29 +0000 (20:08 -0400)]
tests: isis_topo1 needs to wait for results under load

the isis_topo1 test has two functions where immediately
after the test ensures that the routes are in isis
tests to see if they are in the rib.  Under system
load I am seeing this test failing because the
routes are still queued.  Modify the zebra check
for the isis routes to look for the proper results
for 10 seconds.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9916 from donaldsharp/run_and_expect_failure
Donatas Abraitis [Sun, 31 Oct 2021 18:46:14 +0000 (20:46 +0200)]
Merge pull request #9916 from donaldsharp/run_and_expect_failure

tests: Fix `check_ping` function in test_bgp_srv6l3vpn_to_bgp_vrf.py

2 years agoMerge pull request #9920 from donaldsharp/zebra_seg6local_race
Martin Winter [Fri, 29 Oct 2021 23:36:35 +0000 (01:36 +0200)]
Merge pull request #9920 from donaldsharp/zebra_seg6local_race

tests: zebra_seg6local has a race condition

2 years agoMerge pull request #9912 from donaldsharp/netlink_modifications
Russ White [Fri, 29 Oct 2021 18:45:58 +0000 (14:45 -0400)]
Merge pull request #9912 from donaldsharp/netlink_modifications

Netlink modifications

2 years agotests: Fix zebra_seg6_route to not always reinstall the same route
Donald Sharp [Fri, 29 Oct 2021 14:21:28 +0000 (10:21 -0400)]
tests: Fix zebra_seg6_route to not always reinstall the same route

This code has two issues:

a) The loop to test for successful installation re-installs
the route every time it loops.  A system under load will
have issues ensuring the route is installed and repeated
attempts does not help

b) The nexthop group installation was always failing
but never noticed (because of the previous commit)
and the test was always passing, when it should
have never passed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9830 from idryzhov/config-timing-fixes
Donald Sharp [Fri, 29 Oct 2021 17:17:24 +0000 (13:17 -0400)]
Merge pull request #9830 from idryzhov/config-timing-fixes

tests: test_static_timing fixes

2 years agotests: zebra_seg6local has a race condition
Donald Sharp [Fri, 29 Oct 2021 12:47:05 +0000 (08:47 -0400)]
tests: zebra_seg6local has a race condition

The test is checking installing of seg6 routes by this
loop:

for up to 5 times:
    sharp install seg6 route
    show ip route and is it installed

The problem is that if the system is under heavy
load the installation may not have happened yet
and by immediately reinstalling the same route
the same thing could happen again.

Modify the code to pull the route installation
outside of the loop and to increase to 10 attempts
in case there is very heavy system load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9368 from donaldsharp/ospf_ensure_lsa_length
Igor Ryzhov [Fri, 29 Oct 2021 10:37:09 +0000 (13:37 +0300)]
Merge pull request #9368 from donaldsharp/ospf_ensure_lsa_length

ospfd: Ensure we have some non header lsa data

2 years agoMerge pull request #9851 from sartura/isis_unpack_item_ext_subtlvs_fixes
Igor Ryzhov [Fri, 29 Oct 2021 10:34:02 +0000 (13:34 +0300)]
Merge pull request #9851 from sartura/isis_unpack_item_ext_subtlvs_fixes

isisd: fix unpack_item_ext_subtlvs TLV parsing issues

2 years agoMerge pull request #9863 from ton31337/feature/prefix-list_autocomplete
Igor Ryzhov [Fri, 29 Oct 2021 10:30:04 +0000 (13:30 +0300)]
Merge pull request #9863 from ton31337/feature/prefix-list_autocomplete

lib: Add autocomplete for prefix-list under route-maps

2 years agoMerge pull request #9879 from Orange-OpenSource/link_state
Igor Ryzhov [Fri, 29 Oct 2021 10:26:23 +0000 (13:26 +0300)]
Merge pull request #9879 from Orange-OpenSource/link_state

lib: Fix comparison function in link_state.c

2 years agolib: Fix comparison function in link_state.c
Olivier Dugeon [Mon, 25 Oct 2021 09:52:19 +0000 (11:52 +0200)]
lib: Fix comparison function in link_state.c

ls_node_same, ls_attributes_same and ls_prefix_same are not producing expected
result due to a wrong usage of memcmp. In addition, if respective structures
are not initialized with 0, there is a risk that the comparison failed.

This patch correct usage of memcmp and expand comparison to each invidual
parameters of the respective structure for safer result.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agotests: Fix `check_ping` function in test_bgp_srv6l3vpn_to_bgp_vrf.py
Donald Sharp [Thu, 28 Oct 2021 19:51:46 +0000 (15:51 -0400)]
tests: Fix `check_ping` function in test_bgp_srv6l3vpn_to_bgp_vrf.py

The check_ping function `_check` function was asserting and being
passed to the topotests.run_and_expect() functionality causing
it to not run the full range of pings if one failed the test.

So effectively it was properly detecting pass / failure but
only allowing for 1 iteration if it was going to fail.

Modify the code to not assert and act like all the other
run_and_expect functionality.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9831 from manojvn/379909_383518
Igor Ryzhov [Thu, 28 Oct 2021 17:05:16 +0000 (20:05 +0300)]
Merge pull request #9831 from manojvn/379909_383518

ospf6d: minor code enhancements.

2 years agozebra: debug_nl.c ensure we can read RTM_NEWNEIGH bridge nested attrs
Donald Sharp [Thu, 28 Oct 2021 12:16:49 +0000 (08:16 -0400)]
zebra: debug_nl.c ensure we can read RTM_NEWNEIGH bridge nested attrs

The kernel can return to us nested attributes for BRIDGE RTM_NEWNEIGH
attributes.  Just ensure that we can parse and read them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Fix netlink RTM_NEWNEXTHOP parsing for nested attributes
Donald Sharp [Thu, 28 Oct 2021 12:10:28 +0000 (08:10 -0400)]
zebra: Fix netlink RTM_NEWNEXTHOP parsing for nested attributes

With the addition of resillient hashing for nexthops, the
parsing of nexthops requires telling the decoder functions
that there may be nested attributes.  This was found by
code inspection of iproute2/ipnexthop.c when trying to
understand resillient hashing as well as statistics
gathering for nexthops that are / will be in upstream
kernels in the near future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9870 from opensourcerouting/zebra-rib-select-order
Donald Sharp [Thu, 28 Oct 2021 11:59:54 +0000 (07:59 -0400)]
Merge pull request #9870 from opensourcerouting/zebra-rib-select-order

zebra: set SELECTED before going into dplane code

2 years agoospf6d: Add autocomplete for `area X filter-list prefix`
Donatas Abraitis [Thu, 28 Oct 2021 11:00:43 +0000 (14:00 +0300)]
ospf6d: Add autocomplete for `area X filter-list prefix`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: Add autocomplete for `area X filter-list prefix`
Donatas Abraitis [Thu, 28 Oct 2021 11:00:17 +0000 (14:00 +0300)]
ospfd: Add autocomplete for `area X filter-list prefix`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agolib: Add autocomplete for prefix-list under route-maps
Donatas Abraitis [Thu, 21 Oct 2021 19:38:31 +0000 (22:38 +0300)]
lib: Add autocomplete for prefix-list under route-maps

```
exit1-debian-9(config-route-map)# match ip route-source prefix-list ?
  <cr>
  PREFIXLIST_NAME  IP prefix-list name
     p1 p2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9908 from pguibert6WIND/isis_default_vrf_name_changed
Russ White [Wed, 27 Oct 2021 20:11:49 +0000 (16:11 -0400)]
Merge pull request #9908 from pguibert6WIND/isis_default_vrf_name_changed

isisd: make isis work with default vrf name different than 'default'

2 years agoMerge pull request #9907 from donaldsharp/script_fixes
Russ White [Wed, 27 Oct 2021 19:30:49 +0000 (15:30 -0400)]
Merge pull request #9907 from donaldsharp/script_fixes

zebra: Recent Merge broke --enable-werror

2 years agoMerge pull request #9837 from idryzhov/cleanup-if-by-name-vrf-all
Russ White [Wed, 27 Oct 2021 19:29:39 +0000 (15:29 -0400)]
Merge pull request #9837 from idryzhov/cleanup-if-by-name-vrf-all

*: fix usage of if_lookup_by_name_all_vrf

2 years agoisisd: fix unpack_item_ext_subtlvs TLV parsing issues
Juraj Vijtiuk [Sat, 16 Oct 2021 22:57:51 +0000 (00:57 +0200)]
isisd: fix unpack_item_ext_subtlvs TLV parsing issues

isis_tlvs.c would fail at multiple places if incorrect
TLVs were received in unpack_item_ext_subtlvs(),
causing stream assertion violations.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
2 years agoisisd: make isis work with default vrf name different than 'default'
Philippe Guibert [Wed, 27 Oct 2021 12:56:37 +0000 (14:56 +0200)]
isisd: make isis work with default vrf name different than 'default'

The problem is related to startup configuration, which is not operational
on default vrf name.

To reproduce the issue, run the two daemons:
zebra -o vrf0 &
isisd -f /tmp/isisd.conf

router isis 1
 lsp-gen-interval 2
 net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
 metric-style wide
 redistribute ipv4 connected level-2
 redistribute ipv6 connected level-2

The obtained show running-config looks like below:

router isis 1 vrf default
 lsp-gen-interval 2
 net 10.0000.0000.0000.0000.0000.0000.0000.0000.0000.00
 metric-style wide
 redistribute ipv4 connected level-2
 redistribute ipv6 connected level-2

The default vrf name is obtained by zebra daemon. While isis is not
connected to zebra, i.e. at startup, when loading a startup configuration,
the macro VRF_DEFAULT_NAME is used and returns 'default'.

But because zebra connected and forces to a new default vrf name, the
configuration is not seen as the default one, and further attempts to
configure the isis instance via 'router isis 1' will trigger creation
of an other instance.

To handle this situation, at vrf_enable() event, which is called for
each default vrf name change, the associated isis instance is updated
with th new vrf name. The same is done for NB yang path.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agozebra: Recent Merge broke --enable-werror
Donald Sharp [Wed, 27 Oct 2021 11:57:43 +0000 (07:57 -0400)]
zebra: Recent Merge broke --enable-werror

Recent code broke upon compiling with --enable-dev-build
and --enable-werror.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9902 from LabNConsulting/working/lb/lutil-wait-optimization
Donald Sharp [Wed, 27 Oct 2021 10:57:26 +0000 (06:57 -0400)]
Merge pull request #9902 from LabNConsulting/working/lb/lutil-wait-optimization

tests: topotests/lib/lutil.py: optimize wait to not repeat command after expected result found

2 years agoMerge pull request #9862 from donaldsharp/all_protocol_retry
Christian Hopps [Wed, 27 Oct 2021 04:56:06 +0000 (00:56 -0400)]
Merge pull request #9862 from donaldsharp/all_protocol_retry

tests: all_protocol_startup needs some tweaks to allow for processing

2 years agoMerge pull request #9083 from mobash-rasool/pim-upst-3
Jafar Al-Gharaibeh [Wed, 27 Oct 2021 04:17:56 +0000 (23:17 -0500)]
Merge pull request #9083 from mobash-rasool/pim-upst-3

pimd: In Prune Pending state, the holdtime change is not taking effect

2 years agoMerge pull request #9440 from dlqs/dplanehook2
Quentin Young [Tue, 26 Oct 2021 19:26:32 +0000 (15:26 -0400)]
Merge pull request #9440 from dlqs/dplanehook2

2 years agoMerge pull request #9846 from idryzhov/lib-zebra-netns
Mark Stapp [Tue, 26 Oct 2021 16:50:26 +0000 (12:50 -0400)]
Merge pull request #9846 from idryzhov/lib-zebra-netns

lib: move zebra-only netns stuff to zebra

2 years agoMerge pull request #9820 from idryzhov/if-nb-config
Mark Stapp [Tue, 26 Oct 2021 15:50:05 +0000 (11:50 -0400)]
Merge pull request #9820 from idryzhov/if-nb-config

*: fix interface config write in NB-converted daemons

2 years agoMerge pull request #9854 from opensourcerouting/zapi-call-table
Russ White [Tue, 26 Oct 2021 15:33:44 +0000 (11:33 -0400)]
Merge pull request #9854 from opensourcerouting/zapi-call-table

*: convert zclient callbacks to table

2 years agoMerge pull request #9840 from donaldsharp/lu_commands
Lou Berger [Tue, 26 Oct 2021 15:27:34 +0000 (11:27 -0400)]
Merge pull request #9840 from donaldsharp/lu_commands

tests/topotests/lib/lutil.py

2 years agoMerge pull request #9895 from ton31337/fix/double_capability_logging
Russ White [Tue, 26 Oct 2021 15:17:33 +0000 (11:17 -0400)]
Merge pull request #9895 from ton31337/fix/double_capability_logging

Capability logging nits

2 years agoMerge pull request #9791 from opensourcerouting/bgp-json-mem-fix
Igor Ryzhov [Tue, 26 Oct 2021 15:06:47 +0000 (18:06 +0300)]
Merge pull request #9791 from opensourcerouting/bgp-json-mem-fix

bgpd: Fix json object memory leaks and double-free

2 years agotests: topotests/lib/lutil.py: optimize wait to not repeat command after expected...
Lou Berger [Tue, 26 Oct 2021 14:56:50 +0000 (10:56 -0400)]
tests: topotests/lib/lutil.py: optimize wait to not repeat command after expected result found

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoMerge pull request #9898 from donaldsharp/nexthop_stuff
Igor Ryzhov [Tue, 26 Oct 2021 14:45:16 +0000 (17:45 +0300)]
Merge pull request #9898 from donaldsharp/nexthop_stuff

include, zebra: Add recent nexthop.h

2 years agoMerge pull request #9886 from slankdev/fix-srv6-hardcode
Igor Ryzhov [Tue, 26 Oct 2021 14:43:54 +0000 (17:43 +0300)]
Merge pull request #9886 from slankdev/fix-srv6-hardcode

lib: fix srv6 route hardcode with BGP

2 years agobgpd: Unify AddPath capability for OPEN logging
Donatas Abraitis [Tue, 26 Oct 2021 07:41:04 +0000 (10:41 +0300)]
bgpd: Unify AddPath capability for OPEN logging

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Unify multiprotocol capability for OPEN logging
Donatas Abraitis [Tue, 26 Oct 2021 07:37:22 +0000 (10:37 +0300)]
bgpd: Unify multiprotocol capability for OPEN logging

Before:
```
192.168.10.17 OPEN has MultiProtocol Extensions capability (1), length 4
192.168.10.17 OPEN has MP_EXT CAP for afi/safi: IPv4/unicast
```

After:
```
192.168.10.17 OPEN has MultiProtocol Extensions capability (1), length 4
192.168.10.17 OPEN has MultiProtocol Extensions capability for afi/safi: IPv4/unicast
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospf6d: remove unnecessary break.
Manoj Naragund [Tue, 26 Oct 2021 07:45:25 +0000 (00:45 -0700)]
ospf6d: remove unnecessary break.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2 years agoospf6d: prefix structure compare changes.
Manoj Naragund [Fri, 22 Oct 2021 07:46:27 +0000 (00:46 -0700)]
ospf6d: prefix structure compare changes.

Description:
Code changes involve replacing memcmp with prefix_same,
for comparing prefix structures.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2 years agoospf6d: minor code enhancements.
Manoj Naragund [Fri, 22 Oct 2021 07:33:10 +0000 (00:33 -0700)]
ospf6d: minor code enhancements.

Description:
code changes involve removal of increment and decrement operators
during function calls. These expressions make code less readable.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2 years agobgpd: Remove double logging for Graceful Restart capability
Donatas Abraitis [Tue, 26 Oct 2021 07:29:06 +0000 (10:29 +0300)]
bgpd: Remove double logging for Graceful Restart capability

```
192.168.10.17 OPEN has Graceful Restart capability (64), length 6
192.168.10.17 OPEN has Graceful Restart capability
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9873 from bhinin/dynamic_peer_count_reset
Donatas Abraitis [Tue, 26 Oct 2021 05:59:39 +0000 (08:59 +0300)]
Merge pull request #9873 from bhinin/dynamic_peer_count_reset

bgpd: Reset dynamic peer counter

2 years agoMerge pull request #9883 from pguibert6WIND/iface_deleted_omitted_gre_tundest
Jafar Al-Gharaibeh [Tue, 26 Oct 2021 03:44:39 +0000 (22:44 -0500)]
Merge pull request #9883 from pguibert6WIND/iface_deleted_omitted_gre_tundest

zebra: GRE_UPDATE message incomplete

2 years agoMerge pull request #9882 from donaldsharp/version_doc
Jafar Al-Gharaibeh [Tue, 26 Oct 2021 03:31:05 +0000 (22:31 -0500)]
Merge pull request #9882 from donaldsharp/version_doc

doc: Remove reference to non-existent command

2 years agolib: fix srv6 route hardcode with BGP
Hiroki Shirokura [Mon, 25 Oct 2021 23:36:14 +0000 (23:36 +0000)]
lib: fix srv6 route hardcode with BGP

zclient_send_localsid is called by various routing protocol daemons. To set the
srv6 endpoint function. Fix a hard-coded error in the initial implementation.
Before this PR, the srv6 function will be registered to zebra as a BGP route
even if isisd executes zclient_send_localsid.

Signed-off-by: Hiroki Shirokura <hiroki.shirokura@linecorp.com>
2 years agoMerge pull request #9881 from donaldsharp/micro_scale_fixes_1
Igor Ryzhov [Mon, 25 Oct 2021 21:19:14 +0000 (00:19 +0300)]
Merge pull request #9881 from donaldsharp/micro_scale_fixes_1

tests: Fix accidental 10 second wait

2 years agoinclude, zebra: Add recent nexthop.h
Donald Sharp [Mon, 25 Oct 2021 18:11:37 +0000 (14:11 -0400)]
include, zebra: Add recent nexthop.h

Add actual recent nexthop.h file from kernel
and fix up resulting fallout because FRR's
original nexthop.h did not match upstream
linux kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9316 from ton31337/fix/send_best_path_reason_for_zebra
Donald Sharp [Mon, 25 Oct 2021 15:09:20 +0000 (11:09 -0400)]
Merge pull request #9316 from ton31337/fix/send_best_path_reason_for_zebra

bgpd: Send BGP best path reason to Zebra

2 years agoMerge pull request #9876 from donaldsharp/ttl_unset
Donatas Abraitis [Mon, 25 Oct 2021 14:41:57 +0000 (17:41 +0300)]
Merge pull request #9876 from donaldsharp/ttl_unset

bgpd: When issuing `no ... ebgp-multihop` always resets

2 years agozebra: GRE_UPDATE message incomplete
Philippe Guibert [Thu, 7 May 2020 09:21:16 +0000 (11:21 +0200)]
zebra: GRE_UPDATE message incomplete

when gre information could not be retrieved because GRE interface has
been deleted, a GRE_UPDATE message may be sent to NHRP. In that case,
the gre values are reset. There was a missing tunnel destination value,
which has been omitted.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agotests: Attempt to fix bgp_l3vpn_to_direct timing issues
Donald Sharp [Fri, 15 Oct 2021 19:56:44 +0000 (15:56 -0400)]
tests: Attempt to fix bgp_l3vpn_to_direct timing issues

The bgp_l3vpn_to_direct test is failing sometimes because
the 2.2.2.2 route is dissapearing.  What is happening?

The log file for the failed test run shows us this:

build 15-Oct-2021 07:26:12 scripts/adjacencies.py:8 WAIT:r4:ping 2.2.2.2 -c 1: 0. packet loss:wait:PE->P2 (loopback) ping:60:0.5:
build 15-Oct-2021 07:26:12 Fri Oct 15 14:26:12 2021 (#9) scripts/adjacencies.py:8 COMMAND:r4:ping 2.2.2.2 -c 1: 0. packet loss:wait:PE->P2 (loopback) ping:
build 15-Oct-2021 07:26:12 COMMAND OUTPUT:PING 2.2.2.2 (2.2.2.2) 56(84) bytes of data.
build 15-Oct-2021 07:26:12 64 bytes from 2.2.2.2: icmp_seq=1 ttl=64 time=0.143 ms
build 15-Oct-2021 07:26:12
build 15-Oct-2021 07:26:12 --- 2.2.2.2 ping statistics ---
build 15-Oct-2021 07:26:12 1 packets transmitted, 1 received, 0% packet loss, time 0ms
build 15-Oct-2021 07:26:12 rtt min/avg/max/mdev = 0.143/0.143/0.143/0.000 ms:
build 15-Oct-2021 07:26:12 Done after 1 loops, time=0.024507761001586914, Found= 0% packet loss
build 15-Oct-2021 07:26:12 Fri Oct 15 14:26:12 2021 (#9) scripts/adjacencies.py:9 COMMAND:r4:ping 2.2.2.2 -c 1: 0. packet loss:pass:PE->P2 (loopback) ping +0.02 secs:
build 15-Oct-2021 07:26:12 2021-10-15 14:26:12,446 WARNING: topolog.r4: LinuxNamespace(r4): proc failed: rc 2 pid 28826
build 15-Oct-2021 07:26:12 args: /usr/bin/nsenter -a -t 27444 -F --wd=/tmp/topotests/bgp_l3vpn_to_bgp_direct.test_bgp_l3vpn_to_bgp_direct/r4 /bin/bash -c ping 2.2.2.2 -c 1
build 15-Oct-2021 07:26:12 stdout: connect: Network is unreachable:
build 15-Oct-2021 07:26:17 COMMAND OUTPUT:connect: Network is unreachable:
build 15-Oct-2021 07:26:17 R:9    r4     PE->P2 (loopback) ping +0.02 secs                        0    1

So the 2.2.2.2 route is coming/going and is failing on these test lines:

luCommand(
    "r1", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)
luCommand(
    "r3", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)
luCommand(
    "r4", "ping 2.2.2.2 -c 1", " 0. packet loss", "wait", "PE->P2 (loopback) ping", 60
)

So the 2.2.2.2 routes on r1,3 and 4 are received via ospf, but are
modified by some other process to add labels ( probably ldp, since
it is running too ).  The 2nd ping to 2.2.2.2 is failing because
the 2.2.2.2 route on r4 is being replaced.  As an example here
is `ip monitor all` on r4 during boot up.  Please note timestamps
are not necessarily representative of what we will see on the
loaded ci system.

[2021-10-15T15:46:52.261456] [NEXTHOP]id 27 via 10.0.2.2 dev r4-eth0 scope link proto zebra
[2021-10-15T15:46:52.261490] [ROUTE]2.2.2.2 nhid 27 via 10.0.2.2 dev r4-eth0 proto ospf metric 20
<snip>
[2021-10-15T15:46:53.556405] [NEXTHOP]Deleted id 27 via 10.0.2.2 dev r4-eth0 scope link proto zebra
<snip>
[2021-10-15T15:46:53.566575] [NEXTHOP]id 32 via 10.0.2.2 dev r4-eth0 scope link proto zebra
[2021-10-15T15:46:53.566585] [ROUTE]2.2.2.2 nhid 32 via 10.0.2.2 dev r4-eth0 proto ospf metric 20

For a small amount of time the route was *gone*.  I believe the upstream
CI system hits that window sometimes, causing the test to fail.

This patch attempts to ensure that the 2.2.2.2 route should be learned
appropriately ( thus slowing it down ) before the test moves onto
the ping.  I suspect the long term answer might be to add a test to
the scripts/adjancies.py script to ensure that the test does not
continue until the appropriate label is in place, but I want to
make the test run a bit more perscriptive in what it is looking
for here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: Remove reference to non-existent command
Donald Sharp [Mon, 25 Oct 2021 13:03:48 +0000 (09:03 -0400)]
doc: Remove reference to non-existent command

The `neighbor <peer> version <X>` command does not
exist.  I am unable to find it going back to version
2.0 of FRR.  So this command has been not in the system
for a very long time.

In any event bgp already supports version 4 of bgp and
it auto-negotiates this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years ago*: fix interface config write in NB-converted daemons
Igor Ryzhov [Wed, 13 Oct 2021 15:30:06 +0000 (18:30 +0300)]
*: fix interface config write in NB-converted daemons

When writing the config from the NB-converted daemon, we must not rely
on the operational data. This commit changes the output of the interface
configuration to use only config data. As the code is the same for all
daemons, move it to the lib and remove all the duplicated code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agotests: Fix accidental 10 second wait
Donald Sharp [Mon, 25 Oct 2021 12:00:23 +0000 (08:00 -0400)]
tests: Fix accidental 10 second wait

Recent commit 83f325901aec28774ecb had a accidental
turn of a 1 second wait into a 10 second wait
between retries.  10 seconds is too long.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9824 from idryzhov/nb-cli-const-lyd-node
Donald Sharp [Mon, 25 Oct 2021 11:55:39 +0000 (07:55 -0400)]
Merge pull request #9824 from idryzhov/nb-cli-const-lyd-node

lib: northbound cli show/cmd functions must not modify data nodes

2 years agoMerge pull request #9877 from opensourcerouting/ospf_gr_topo1-fix
Donald Sharp [Mon, 25 Oct 2021 11:00:19 +0000 (07:00 -0400)]
Merge pull request #9877 from opensourcerouting/ospf_gr_topo1-fix

tests: Fix frequent failure of ospf_gr_topo1 on slower systems

2 years agotests: Fix frequent failure of ospf_gr_topo1 on slower systems
Martin Winter [Sun, 24 Oct 2021 22:53:49 +0000 (00:53 +0200)]
tests: Fix frequent failure of ospf_gr_topo1 on slower systems

Test doesn't wait long enough when it checks the routers after
restart. On slower systems, it frequently failed as it ran out
of time

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2 years agobgpd: When issuing `no ... ebgp-multihop` always resets
Donald Sharp [Sun, 24 Oct 2021 19:02:11 +0000 (15:02 -0400)]
bgpd: When issuing `no ... ebgp-multihop` always resets

When removing the command `no neighbor <X> ebgp-multihop <Y>`
the bgp code was always resetting the connection even if
the command would do nothing.

Fixes: #6464
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9670 from LabNConsulting/chopps/fix-valgrind-fail-check
Donald Sharp [Sun, 24 Oct 2021 12:30:29 +0000 (08:30 -0400)]
Merge pull request #9670 from LabNConsulting/chopps/fix-valgrind-fail-check

Chopps/fix valgrind fail check

2 years agoMerge pull request #9874 from donaldsharp/micro_scale_fixes
Martin Winter [Sat, 23 Oct 2021 16:08:36 +0000 (18:08 +0200)]
Merge pull request #9874 from donaldsharp/micro_scale_fixes

Micro scale fixes

2 years agoMerge pull request #9742 from elimbaum/add-vlan-actions
Jafar Al-Gharaibeh [Sat, 23 Oct 2021 05:06:16 +0000 (00:06 -0500)]
Merge pull request #9742 from elimbaum/add-vlan-actions

pbrd: add vlan actions to vty

2 years agotests: bfd_isis_topo1 expects unreasonable convergence times under load
Donald Sharp [Fri, 22 Oct 2021 19:27:50 +0000 (15:27 -0400)]
tests: bfd_isis_topo1 expects unreasonable convergence times under load

When our ci test system is under high load, expecting bfd to converge
in under 2 seconds is not going to happen.  Modify the test suites
to just ensure that things converge.  If we need actual functional
testing of bfd response times the topotests are not an appropriate place
to do this or we need to modify the test system to gather the data for
how long it takes after the tests are run.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Fix bgp_ecmp_topo3 to look for a bit more state
Donald Sharp [Fri, 22 Oct 2021 18:20:16 +0000 (14:20 -0400)]
tests: Fix bgp_ecmp_topo3 to look for a bit more state

During a local CI run, bgp_ecmp_topo3 was failing
to properly notice the fast-convergence command
issued before the interface is shut down.  As
such there exists a race condition where under
high load the zebra process can actually shut
an interface down before we have properly ensured
that fast convergence is on for ibgp.

Modify the test for in two ways:

1) Ensure that previous section makes sure
that we have properly converged for when we
bring back up the interfaces instead of
assuming that we have done so.

2) After issuing the fast-convergence command.
Ensure that bgp has fully processed it and is
ready to receive the interface down events
as triggers for shutting down the ibgp session.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Make test_ldp_topo1.py aware of how many neighbors it needs
Donald Sharp [Fri, 22 Oct 2021 18:18:33 +0000 (14:18 -0400)]
tests: Make test_ldp_topo1.py aware of how many neighbors it needs

On a local CI run.  The test_ldp_topo1.py showed fail to converge
on r3.  r3 has 2 neighbors but only 1 was up when we got to
further steps in the test suites.

Modify the neighbor checking to `know` how many neighbors
should be operational and continue looking for them until
they are up and running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: fix --valgrind-memleaks option
Christian Hopps [Tue, 21 Sep 2021 00:39:09 +0000 (20:39 -0400)]
tests: fix --valgrind-memleaks option

Previously, when a valgrind memleak was discovered, would cause a
catastrophic pytest failure. Now correctly fails the current pytest as
intended.

As a result of this fix --valgrind-memleaks now works in distributed
pytest mode as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotests: revert default enable of memleak tests
Christian Hopps [Sun, 26 Sep 2021 05:52:11 +0000 (01:52 -0400)]
tests: revert default enable of memleak tests

Revert the accidental enabling of the optional memleak tests that came
with the large micronet changeset.

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agotests: fix missing space in --valgrind-extra option
Christian Hopps [Sun, 26 Sep 2021 05:51:53 +0000 (01:51 -0400)]
tests: fix missing space in --valgrind-extra option

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoMerge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup
Sri Mohana Singamsetty [Fri, 22 Oct 2021 16:26:06 +0000 (09:26 -0700)]
Merge pull request #9378 from AnuradhaKaruppiah/evpn-mh-cleanup

evpn-mh: fixes for sync-MAC-IP handling on ES bond del/add

2 years agotests: all_protocol_startup needs some tweaks to allow for processing
Donald Sharp [Thu, 21 Oct 2021 14:21:40 +0000 (10:21 -0400)]
tests: all_protocol_startup needs some tweaks to allow for processing

The nexthop group code is installing routes and nexthop groups
and immediately expecting zebra to have processed the results
as a result there is a situation when the CI system is under
intense load that the nexthop group might not have been processed.

Add a bit of code to allow the test to give FRR some time
to finish work before declaring it not working.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #9860 from pguibert6WIND/nhrp_align_privs
Mark Stapp [Fri, 22 Oct 2021 14:19:34 +0000 (10:19 -0400)]
Merge pull request #9860 from pguibert6WIND/nhrp_align_privs

nhrpd: align nhrp privs with definition from others

2 years agoMerge pull request #9765 from idryzhov/lib-bool-thread-add
Mark Stapp [Fri, 22 Oct 2021 13:59:54 +0000 (09:59 -0400)]
Merge pull request #9765 from idryzhov/lib-bool-thread-add

lib: change thread_add_* API

2 years agoMerge pull request #9866 from ewlumpkin/comment_spelling_fixes
Donald Sharp [Fri, 22 Oct 2021 13:38:44 +0000 (09:38 -0400)]
Merge pull request #9866 from ewlumpkin/comment_spelling_fixes

lib: finish fixing spelling in lib files

2 years agozebra: set SELECTED before going into dplane code
David Lamparter [Thu, 21 Oct 2021 15:54:42 +0000 (17:54 +0200)]
zebra: set SELECTED before going into dplane code

There is a bit of an impedance mismatch in the sequence of events here.
Depending on the dplane behavior, the `ROUTE_ENTRY_SELECTED` bit will be
inconsistent for rib_process_result().

With an asynchronous dataplane:
0. rib_process() is called
1. rib_install_kernel() is called, dplane action is queued
2. rib_install_kernel() returns
3. rib_process() sets the SELECTED bit appropriately, returns
4. dplane is done, triggers rib_process_result()
5. SELECTED bit is seen in "after" state
(5a. NHT code looks at the SELECTED bit, works correctly.)

With a synchronous dataplane:
0. rib_process() is called
1. rib_install_kernel() is called, dplane action is executed
2. dplane (should) trigger rib_process_result()
3. SELECTED bit is seen in "before" state
(3a. NHT code looks at the SELECTED bit, fails.)
4. rib_install_kernel() returns
5. rib_process() sets the SELECTED bit appropriately, too late.

Essentially, poking the dataplane is a sequencing point where control is
handed over to the dplane.  Control may or may not return immediately.
Doing /anything/ after triggering the dataplane is a recipe for odd race
conditions.

(FWIW, I'm not sure rib_process_result() is called correctly in the
synchronous case, but that's a separate problem.)

Unfortunately, this change might have some unforeseen side effects.  I
haven't dug through the code to see if anything breaks.  There
/shouldn't/ be anything looking at the SELECTED bit here, but who knows.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: finish fixing spelling in lib files
ewlumpkin [Fri, 22 Oct 2021 02:56:56 +0000 (02:56 +0000)]
lib: finish fixing spelling in lib files

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2 years agonhrpd: align nhrp privs with definition from others
Philippe Guibert [Tue, 10 Dec 2019 09:54:27 +0000 (10:54 +0100)]
nhrpd: align nhrp privs with definition from others

nhrp_privs global context is aligned with other daemon contexts

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9843 from opensourcerouting/vtysh-startup-cost
Donald Sharp [Wed, 20 Oct 2021 22:52:00 +0000 (18:52 -0400)]
Merge pull request #9843 from opensourcerouting/vtysh-startup-cost

vtysh: improve startup time by ca. ×6

2 years agoMerge pull request #9783 from mjstapp/fix_bgp_lu_lsp
Russ White [Wed, 20 Oct 2021 22:22:01 +0000 (18:22 -0400)]
Merge pull request #9783 from mjstapp/fix_bgp_lu_lsp

bgpd, tests: BGP-labeled-unicast advertise implicit-null in more cases

2 years agotests: relax requirements for test_static_timing
Igor Ryzhov [Wed, 13 Oct 2021 21:13:57 +0000 (00:13 +0300)]
tests: relax requirements for test_static_timing

When the CI system is heavily loaded, we might see the following failures:

```
test failed at "test_config_timing/test_static_timing": assert 20.083204 <= 19.487716
```

Currently we allow each step to run 2 times slower than the initial
measurement. Let's allow them to run 3 times slower.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agotests: fix test_static_timing route removal
Igor Ryzhov [Wed, 13 Oct 2021 21:13:57 +0000 (00:13 +0300)]
tests: fix test_static_timing route removal

On the first step, the test creates 10000 static routes. It passes 10000
to `get_ip_networks` and it generates 10000 /22 routes.

On the fourth step, the test tries to remove 5000 previously created
routes. It passes 5000 to `get_ip_networks` and here starts the problem.
Instead of generating 5000 /22 routes, it generates 5000 /21 routes. And
the whole step is a no-op, we constantly see the following logs:
```
% Refusing to remove a non-existent route
```

To consistently generate same routes, `get_ip_networks` must always use
the same prefix length.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9856 from donaldsharp/always_true
Igor Ryzhov [Wed, 20 Oct 2021 20:16:58 +0000 (23:16 +0300)]
Merge pull request #9856 from donaldsharp/always_true

zebra: Fix code paths that always resolve to true

2 years agoMerge pull request #9855 from donaldsharp/ospf_fini
David Lamparter [Wed, 20 Oct 2021 17:19:43 +0000 (19:19 +0200)]
Merge pull request #9855 from donaldsharp/ospf_fini

2 years agolib: change thread_add_* API
Igor Ryzhov [Wed, 6 Oct 2021 19:06:23 +0000 (22:06 +0300)]
lib: change thread_add_* API

Do not return pointer to the newly created thread from various thread_add
functions. This should prevent developers from storing a thread pointer
into some variable without letting the lib know that the pointer is
stored. When the lib doesn't know that the pointer is stored, it doesn't
prevent rescheduling and it can lead to hard to find bugs. If someone
wants to store the pointer, they should pass a double pointer as the last
argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9811 from donaldsharp/rib_update_fix
Igor Ryzhov [Wed, 20 Oct 2021 16:44:45 +0000 (19:44 +0300)]
Merge pull request #9811 from donaldsharp/rib_update_fix

Various thread functional fixes

2 years agoMerge pull request #9847 from ton31337/feature/prefix-list_autocomplete
Igor Ryzhov [Wed, 20 Oct 2021 15:45:07 +0000 (18:45 +0300)]
Merge pull request #9847 from ton31337/feature/prefix-list_autocomplete

bgpd: Add autocomplete for set/match community/large/ext lists

2 years agozebra: Fix code paths that always resolve to true
Donald Sharp [Wed, 20 Oct 2021 14:15:41 +0000 (10:15 -0400)]
zebra: Fix code paths that always resolve to true

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: modify rib_update to be a bit smarter about malloc
Donald Sharp [Tue, 12 Oct 2021 17:23:40 +0000 (13:23 -0400)]
zebra: modify rib_update to be a bit smarter about malloc

rib_update() was mallocing memory then attempting to schedule
and if the schedule failed( it was already going to be run )
FRR would then free the memory.  Fix this memory usage pattern

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Add a thread_is_scheduled function
Donald Sharp [Tue, 12 Oct 2021 17:22:54 +0000 (13:22 -0400)]
lib: Add a thread_is_scheduled function

The function thread_is_scheduled allows us to know if
the particular thread is scheduled for execution or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>