]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

3 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

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

3 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

3 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

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

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

3 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

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

3 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

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

3 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

3 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

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

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

3 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

3 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

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

3 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

3 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

3 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

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

3 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

3 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>
3 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>
3 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>
3 years agoMerge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap
Mark Stapp [Wed, 20 Oct 2021 12:13:17 +0000 (08:13 -0400)]
Merge pull request #9766 from opensourcerouting/typesafe-member-nhrp-zap

lib: add typesafe membership-test functions

3 years agotests: When heavily loaded do not send SIGBUS so fast
Donald Sharp [Wed, 20 Oct 2021 12:02:10 +0000 (08:02 -0400)]
tests: When heavily loaded do not send SIGBUS so fast

Our topotests send SIGBUS 2 seconds after a SIGTERM is
initiated.  This is bad because under a heavily loaded
topotest system we may have a case where the system has
not had a chance to properly shut down the daemon.
Extend the time greatly before topotests send SIGBUS.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopathd: Call frr_fini() before exit
Donald Sharp [Wed, 20 Oct 2021 12:00:57 +0000 (08:00 -0400)]
pathd: Call frr_fini() before exit

pathd was never calling frr_fini and as such the
proper shutdown was not happening for libfrr.
This includes logging.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Close log files before exiting
Donald Sharp [Wed, 20 Oct 2021 12:00:02 +0000 (08:00 -0400)]
ospfd: Close log files before exiting

When doing a normal exit from ospf we should close
the log file as that we are leaving a bunch of
unterminated logging processes by not doing so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add autocomplete for community/large/extcommunity stuff
Donatas Abraitis [Tue, 19 Oct 2021 12:14:19 +0000 (15:14 +0300)]
bgpd: Add autocomplete for community/large/extcommunity stuff

```
exit1-debian-9(config)# route-map test1 permit 10
exit1-debian-9(config-route-map)# match community ?
  (1-99)               Community-list number (standard)
  (100-500)            Community-list number (expanded)
  COMMUNITY_LIST_NAME  Community-list name
     testas
exit1-debian-9(config-route-map)# match large-community ?
  (1-99)                Large Community-list number (standard)
  (100-500)             Large Community-list number (expanded)
  LCOMMUNITY_LIST_NAME  Large Community-list name
     LCL-ORIGINATED-ALL
exit1-debian-9(config-route-map)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years ago*: convert zclient callbacks to table
David Lamparter [Wed, 20 Oct 2021 11:07:47 +0000 (13:07 +0200)]
*: convert zclient callbacks to table

This removes a giant `switch { }` block from lib/zclient.c and
harmonizes all zclient callback function types to be the same (some had
a subset of the args, some had a void return, now they all have
ZAPI_CALLBACK_ARGS and int return.)

Apart from getting rid of the giant switch, this is a minor security
benefit since the function pointers are now in a `const` array, so they
can't be overwritten by e.g. heap overflows for code execution anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Reset dynamic peer counter
Abhishek Naik [Tue, 19 Oct 2021 23:45:26 +0000 (23:45 +0000)]
bgpd: Reset dynamic peer counter

Dynamic peer count is inconsistent in
"show bgp summary json" and "show bgp summary failed json" due to
dynamic peer counter 'dn_count' being reused without resetting

Signed-off-by: Abhishek Naik <bhini@amazon.com>
3 years agoMerge pull request #9848 from ton31337/feature/as-path_autocomplete
Russ White [Tue, 19 Oct 2021 23:18:28 +0000 (19:18 -0400)]
Merge pull request #9848 from ton31337/feature/as-path_autocomplete

bgpd: Add autocomplete for as-path filters

3 years agoMerge pull request #9839 from donaldsharp/test_ospf_summarization
Russ White [Tue, 19 Oct 2021 23:17:35 +0000 (19:17 -0400)]
Merge pull request #9839 from donaldsharp/test_ospf_summarization

Test ospf summarization

3 years agoMerge pull request #9656 from chiragshah6/mdev
Russ White [Tue, 19 Oct 2021 23:16:14 +0000 (19:16 -0400)]
Merge pull request #9656 from chiragshah6/mdev

zebra: add resolver flag for nexthop in json

3 years agoMerge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges
Russ White [Tue, 19 Oct 2021 23:15:40 +0000 (19:15 -0400)]
Merge pull request #9752 from opensourcerouting/ospf6d-nssa-ranges

ospf6d: add support for NSSA Type-7 address ranges

3 years agoMerge pull request #9818 from idryzhov/lib-if-fixes
Mark Stapp [Tue, 19 Oct 2021 20:46:58 +0000 (16:46 -0400)]
Merge pull request #9818 from idryzhov/lib-if-fixes

lib: allow to create interfaces in non-existing VRFs

3 years agodoc: Add doc for zebra hook calls
Donald Lee [Sun, 22 Aug 2021 17:40:36 +0000 (01:40 +0800)]
doc: Add doc for zebra hook calls

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agozebra: Add vty cmd zebra on-rib-process script SCRIPT
Donald Lee [Wed, 13 Oct 2021 15:08:31 +0000 (23:08 +0800)]
zebra: Add vty cmd zebra on-rib-process script SCRIPT

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agozebra: Add script initialization and destroy
Donald Lee [Mon, 18 Oct 2021 18:40:58 +0000 (02:40 +0800)]
zebra: Add script initialization and destroy

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agozebra: Add dplane hook point
Donald Lee [Wed, 18 Aug 2021 12:31:56 +0000 (20:31 +0800)]
zebra: Add dplane hook point

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agozebra: Add encoders/decoders for zebra
Donald Lee [Wed, 18 Aug 2021 12:38:07 +0000 (20:38 +0800)]
zebra: Add encoders/decoders for zebra

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agolib: Add frrscript names hash
Donald Lee [Mon, 18 Oct 2021 00:23:19 +0000 (08:23 +0800)]
lib: Add frrscript names hash

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agolib: Register encoders/decoders for dplane hook
Donald Lee [Wed, 18 Aug 2021 12:29:22 +0000 (20:29 +0800)]
lib: Register encoders/decoders for dplane hook

These are for encoding the dplane ctx object. The decoders are noops.

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agolib: Add encoder/decoder for nexthop/nexthop group
Donald Lee [Wed, 18 Aug 2021 12:25:40 +0000 (20:25 +0800)]
lib: Add encoder/decoder for nexthop/nexthop group

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agolib: Add encoders/decoders for ipaddr/ethaddr
Donald Lee [Wed, 18 Aug 2021 12:22:21 +0000 (20:22 +0800)]
lib: Add encoders/decoders for ipaddr/ethaddr

Signed-off-by: Donald Lee <dlqs@gmx.com>
3 years agobgpd: Add autocomplete for filter-list
Donatas Abraitis [Tue, 19 Oct 2021 15:02:36 +0000 (18:02 +0300)]
bgpd: Add autocomplete for filter-list

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotools: remove Linux kernel bits from checkpatch
David Lamparter [Tue, 12 Oct 2021 22:01:43 +0000 (00:01 +0200)]
tools: remove Linux kernel bits from checkpatch

These aren't appropriate for use in FRR.  Among other things, this
enables running checkpatch by calling it in a git working tree with
`tools/checkpatch.pl -g origin/master..`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotools: add iterators to checkpatch
David Lamparter [Tue, 12 Oct 2021 22:00:03 +0000 (00:00 +0200)]
tools: add iterators to checkpatch

For the purpose of allowing the space in `frr_each (`, copy the list of
iterators from .clang-format and wire it up appropriately.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobuild: add tests missed in .gitignore
David Lamparter [Wed, 29 Sep 2021 21:37:10 +0000 (23:37 +0200)]
build: add tests missed in .gitignore

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: drop list.h
David Lamparter [Sat, 27 Mar 2021 21:47:28 +0000 (22:47 +0100)]
nhrpd: drop list.h

`number_of_linked_lists_in_frr--;`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert zbuf queue to DLIST
David Lamparter [Sat, 27 Mar 2021 21:46:33 +0000 (22:46 +0100)]
nhrpd: convert zbuf queue to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert SA list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:41:44 +0000 (22:41 +0100)]
nhrpd: convert SA list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert reg list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:37:25 +0000 (22:37 +0100)]
nhrpd: convert reg list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert mcast list to DLIST
David Lamparter [Wed, 29 Sep 2021 21:16:17 +0000 (23:16 +0200)]
nhrpd: convert mcast list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert nhs list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:30:51 +0000 (22:30 +0100)]
nhrpd: convert nhs list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agonhrpd: convert notifier list to DLIST
David Lamparter [Sat, 27 Mar 2021 21:20:10 +0000 (22:20 +0100)]
nhrpd: convert notifier list to DLIST

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/developer: add _member and _anywhere
David Lamparter [Wed, 29 Sep 2021 20:39:59 +0000 (22:39 +0200)]
doc/developer: add _member and _anywhere

New members in the typesafe.h API club.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add unsorted typesafe_anywhere()
David Lamparter [Wed, 29 Sep 2021 17:59:27 +0000 (19:59 +0200)]
lib: add unsorted typesafe_anywhere()

*_anywhere(item) returns whether an item is on _any_ container.  Only
available for unsorted containers for now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: use sentinel for single-linked lists
David Lamparter [Wed, 29 Sep 2021 20:15:11 +0000 (22:15 +0200)]
lib: use sentinel for single-linked lists

Using a non-NULL sentinel allows distinguishing between "end of list"
and "item not on any list".  It's a compare either way, just the value
is different.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: typesafe *_member()
David Lamparter [Sat, 27 Mar 2021 21:05:07 +0000 (22:05 +0100)]
lib: typesafe *_member()

This provides a "is this item on this list" check, which may or may not
be faster than using *_find() for the same purpose.  (If the container
has no faster way of doing it, it falls back to using *_find().)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: null out deleted pointers in typesafe containers
David Lamparter [Wed, 29 Sep 2021 18:45:34 +0000 (20:45 +0200)]
lib: null out deleted pointers in typesafe containers

Some of the typesafe containers didn't null out their innards of items
after an item was deleted or popped off the container.  This is both a
bit unsafe as well as hinders the upcoming _member() from working
efficiently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotests: fix leak in test code
David Lamparter [Wed, 29 Sep 2021 20:13:01 +0000 (22:13 +0200)]
tests: fix leak in test code

Even if it doesn't matter for an unit test in general, it hides actual
leaks in the code being tested.  Fix so any leaks will be actual bugs.
(Currently there aren't any, yay.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Add autocomplete for as-path filters
Donatas Abraitis [Tue, 19 Oct 2021 12:31:39 +0000 (15:31 +0300)]
bgpd: Add autocomplete for as-path filters

```
exit1-debian-9# show bgp as-path-access-list
  <cr>
  AS_PATH_FILTER_NAME  AS path access list name
     acl1 acl2
  json                 JavaScript Object Notation
exit1-debian-9(config)# route-map testas permit 10
exit1-debian-9(config-route-map)# match as-path ?
  AS_PATH_FILTER_NAME  AS path access-list name
     acl1 acl2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agolib: allow to create interfaces in non-existing VRFs
Igor Ryzhov [Wed, 13 Oct 2021 12:06:38 +0000 (15:06 +0300)]
lib: allow to create interfaces in non-existing VRFs

It allows FRR to read the interface config even when the necessary VRFs
are not yet created and interfaces are in "wrong" VRFs. Currently, such
config is rejected.

For VRF-lite backend, we don't care at all about the VRF of the inactive
interface. When the interface is created in the OS and becomes active,
we always use its actual VRF instead of the configured one. So there's
no need to reject the config.

For netns backend, we may have multiple interfaces with the same name in
different VRFs. So we care about the VRF of inactive interfaces. And we
must allow to preconfigure the interface in a VRF even before it is
moved to the corresponding netns. From now on, we allow to create
multiple configs for the same interface name in different VRFs and
the necessary config is applied once the OS interface is moved to the
corresponding netns.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: move zebra-only netns stuff to zebra
Igor Ryzhov [Mon, 18 Oct 2021 20:34:02 +0000 (23:34 +0300)]
lib: move zebra-only netns stuff to zebra

When something is used only from zebra and part of its description is
"should be called from zebra only" then it belongs to zebra, not lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: keep element count in vector code
David Lamparter [Mon, 18 Oct 2021 13:29:17 +0000 (15:29 +0200)]
lib: keep element count in vector code

... to speed up vector_empty_slot() among other things.

Behavior should be 100% identical to previous.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agovtysh: defer CLI tree building
David Lamparter [Mon, 18 Oct 2021 09:51:09 +0000 (11:51 +0200)]
vtysh: defer CLI tree building

We don't need the CLI tree until we actually enter the node.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>