]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
4 months agoMerge pull request #17585 from donaldsharp/zclient_speedup
Jafar Al-Gharaibeh [Thu, 5 Dec 2024 03:59:33 +0000 (21:59 -0600)]
Merge pull request #17585 from donaldsharp/zclient_speedup

lib: Speed up reconnection attempts for zapi

4 months agoMerge pull request #17502 from opensourcerouting/msdp-shutdown
Jafar Al-Gharaibeh [Thu, 5 Dec 2024 03:57:18 +0000 (21:57 -0600)]
Merge pull request #17502 from opensourcerouting/msdp-shutdown

pimd: implement MSDP shutdown command

4 months agolib: Speed up reconnection attempts for zapi 17585/head
Donald Sharp [Wed, 4 Dec 2024 21:14:34 +0000 (16:14 -0500)]
lib: Speed up reconnection attempts for zapi

Currently the zapi reconnection is once every 10 seconds
for the first 3 times and then once every 60 seconds from then
on out.  We are seeing interesting behavior under loaded systems
where zebra is just slow to come up and daemons are spending a long
time waiting to connect.  Let's just make things a bit more aggressive.

Change the code to attempt to reconnect once every second for 30 seconds
and then change to once every 5 seconds from then on out.

This should help with non-integrated configuration on system startup.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17578 from donaldsharp/pim_autorp_prevent_crash
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 20:40:25 +0000 (14:40 -0600)]
Merge pull request #17578 from donaldsharp/pim_autorp_prevent_crash

pimd: Prevent crash of pim when auto-rp's socket is not initialized

4 months agopimd: Prevent crash of pim when auto-rp's socket is not initialized 17578/head
Donald Sharp [Wed, 4 Dec 2024 15:47:33 +0000 (10:47 -0500)]
pimd: Prevent crash of pim when auto-rp's socket is not initialized

If the socket associated with the auto-rp fails to initialize then
the memory for the auto-rp is just dropped on the floor.  Additionally
any type of attempt at using the feature will just cause pimd to crash,
when the pointer is derefed.  Since it is derefed all over the place
without checking.

Clearly if you cannot bind/use the socket let's allow continuation.

Fixes: #17540
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17569 from btrent98/igmp-proxy-bugfix
Donald Sharp [Wed, 4 Dec 2024 13:16:24 +0000 (08:16 -0500)]
Merge pull request #17569 from btrent98/igmp-proxy-bugfix

pimd: igmp proxy joins should not be written as part of config

4 months agoMerge pull request #17556 from opensourcerouting/fix/add_route_map_action_reason
Russ White [Wed, 4 Dec 2024 13:09:48 +0000 (08:09 -0500)]
Merge pull request #17556 from opensourcerouting/fix/add_route_map_action_reason

lib: Print the reason why the route-map and/or the index parsing is done

4 months agoMerge pull request #17571 from donaldsharp/fix_bsd_sockopt_problem
Donatas Abraitis [Wed, 4 Dec 2024 12:46:08 +0000 (14:46 +0200)]
Merge pull request #17571 from donaldsharp/fix_bsd_sockopt_problem

Fix bsd sockopt problem

4 months agolib: Print the reason why the route-map and/or the index parsing is done 17556/head
Donatas Abraitis [Wed, 4 Dec 2024 06:27:13 +0000 (08:27 +0200)]
lib: Print the reason why the route-map and/or the index parsing is done

This would give more details why at some point we return deny, no match, etc.

Before this we have sometimes (I don't know why), e.g.:

```
Route-map: null, prefix: 192.168.2.0/24, result: deny
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17558 from donaldsharp/bfd_fix
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 02:06:28 +0000 (20:06 -0600)]
Merge pull request #17558 from donaldsharp/bfd_fix

lib: Fix session re-establishment

4 months agolib,vtysh: Use backoff setsockopt option for freebsd 17571/head
Donald Sharp [Tue, 3 Dec 2024 23:49:59 +0000 (18:49 -0500)]
lib,vtysh: Use backoff setsockopt option for freebsd

Commit: 9112fb367b1ae0168b4e7a81f41c2ca621979199

Introduced the idea of setting the socket buffer
send/receive sizes.  BSD's in general have the fun
issue of not allowing nearly as large as a size as
linux.  Since the above commit was developed on linux
and not run on bsd it was never tested.  Modify the
codebase to use the backoff setsockopt that we have
in the code base and use the returned values to allow
us to notice what was set and respond appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agolib: Allow setsockopt functions to return size set
Donald Sharp [Tue, 3 Dec 2024 23:38:59 +0000 (18:38 -0500)]
lib: Allow setsockopt functions to return size set

When finding a send/receive buffer size that is usable
let's report how big we were able to set it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agopimd: igmp proxy joins should not be written as part of config 17569/head
Barry A. Trent [Tue, 3 Dec 2024 19:17:33 +0000 (11:17 -0800)]
pimd: igmp proxy joins should not be written as part of config

Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
4 months agoMerge pull request #17518 from csiltala/fix-pimd-acl-memleak
Donatas Abraitis [Tue, 3 Dec 2024 21:35:34 +0000 (23:35 +0200)]
Merge pull request #17518 from csiltala/fix-pimd-acl-memleak

pimd: Fix access-list memory leak in pimd

4 months agoMerge pull request #17313 from mjstapp/zserv_open_unpriv
Jafar Al-Gharaibeh [Tue, 3 Dec 2024 20:26:09 +0000 (14:26 -0600)]
Merge pull request #17313 from mjstapp/zserv_open_unpriv

zebra: separate zebra ZAPI server open and accept

4 months agolib: Fix session re-establishment 17558/head
Donald Sharp [Tue, 3 Dec 2024 17:08:12 +0000 (12:08 -0500)]
lib: Fix session re-establishment

Currently if you have this sequence of events:

a) BGP starts
b) BGP reads cli that has bfd configuration
c) BGP attempts to install bfd configuration but fails because
zebra is not connected to yet
d) BGP connects to zebra
e) BGP receives resend bfd code from bfdd
f) BGP was not sending down the unsent data to bfd, never causing
the bfd session to be established.

So effectively bfd was attempting to install but failed
and then when it was asked to replay everything it decided
that the bfd information for a particular peer was actually
installed and does not need to be resent.  Modify the code
such that the bfd code now tracks failed installation and
allows the resend of data to bfdd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17542 from opensourcerouting/fix/peer-group_remote_as_regression
Russ White [Tue, 3 Dec 2024 15:05:44 +0000 (10:05 -0500)]
Merge pull request #17542 from opensourcerouting/fix/peer-group_remote_as_regression

bgpd: Fix remote-as with peer-group

4 months agoMerge pull request #17528 from opensourcerouting/fix/peer_notify_copy_error
Russ White [Tue, 3 Dec 2024 15:04:09 +0000 (10:04 -0500)]
Merge pull request #17528 from opensourcerouting/fix/peer_notify_copy_error

bgpd: Use peer group's member for BGP notify instead of the peer-group

4 months agozebra: separate zebra ZAPI server open and accept 17313/head
Mark Stapp [Wed, 30 Oct 2024 15:02:17 +0000 (11:02 -0400)]
zebra: separate zebra ZAPI server open and accept

Separate zebra's ZAPI server socket handling into two phases:
an early phase that opens the socket, and a later phase that
starts listening for client connections.

Signed-off-by: Mark Stapp <mjs@cisco.com>
4 months agoMerge pull request #17547 from donaldsharp/some_cleanups
Mark Stapp [Tue, 3 Dec 2024 13:57:28 +0000 (08:57 -0500)]
Merge pull request #17547 from donaldsharp/some_cleanups

Some cleanups

4 months agoMerge pull request #17306 from pguibert6WIND/bmp_test_factorise_plus_fix
Russ White [Tue, 3 Dec 2024 13:42:24 +0000 (08:42 -0500)]
Merge pull request #17306 from pguibert6WIND/bmp_test_factorise_plus_fix

BMP test rework

4 months agotopotests: save bgp_bmp json temp files to bmp log folder instead of /tmp 17306/head
Philippe Guibert [Mon, 2 Dec 2024 16:07:14 +0000 (17:07 +0100)]
topotests: save bgp_bmp json temp files to bmp log folder instead of /tmp

Some temporary files are hardwritten in /tmp folder. Use the bmp log
folder instead. Replace the bmp log file argument with bmp log folder.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotests: save bmp pcap in logdir instead of /tmp
Louis Scalbert [Thu, 21 Nov 2024 10:29:53 +0000 (11:29 +0100)]
tests: save bmp pcap in logdir instead of /tmp

DEBUG_PCAP can be set True to manually enable pcap debugging when
running bmp tests.

Save bmp pcap in logdir (ie. /tmp/topotests/bgp_bmp.bgp_bmp_X/ instead
of /tmp.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotests: fix bmp test parallelization
Louis Scalbert [Wed, 20 Nov 2024 10:24:13 +0000 (11:24 +0100)]
tests: fix bmp test parallelization

Multiple BMP tests can run in parallel but, when one instance ends,
it kills the BMP server process of all BMP tests.

Save the PID of a BMP server and only kill it at the end.

Link: https://github.com/FRRouting/frr/issues/17465
Fixes: 875511c466 ("topotests: add basic bmp collector")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
4 months agotests: add py extension to bmpserver
Louis Scalbert [Wed, 20 Nov 2024 10:23:51 +0000 (11:23 +0100)]
tests: add py extension to bmpserver

to help identify the file type. And apply black.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
4 months agotopotests: bgp_bmp, use unified configuration
Philippe Guibert [Mon, 18 Nov 2024 20:38:45 +0000 (21:38 +0100)]
topotests: bgp_bmp, use unified configuration

Use unified configuration procedure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotests: bgp_route_server_client should not use /tmp 17547/head
Donald Sharp [Mon, 2 Dec 2024 15:59:07 +0000 (10:59 -0500)]
tests: bgp_route_server_client should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: bgp_snmp_mplsl3vpn should not use /tmp directory
Donald Sharp [Mon, 2 Dec 2024 15:57:41 +0000 (10:57 -0500)]
tests: bgp_snmp_mplsl3vpn should not use /tmp directory

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: ospf_metric_propagation do not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:55:09 +0000 (10:55 -0500)]
tests: ospf_metric_propagation do not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotopotests: fix bmp_collector handling of empty as-path
Philippe Guibert [Mon, 28 Oct 2024 17:20:13 +0000 (18:20 +0100)]
topotests: fix bmp_collector handling of empty as-path

When configuring the bgp_bmp test with an additional
peer that sends empty AS-PATH, the bmp collector is stopping:

> [2024-10-28 17:41:51] Finished dissecting data from ('192.0.2.1', 33922)
> [2024-10-28 17:41:52] Data received from ('192.0.2.1', 33922): length 195
> [2024-10-28 17:41:52] Got message type: <class 'bmp.BMPRouteMonitoring'>
> [2024-10-28 17:41:52] unpack_from requires a buffer of at least 2 bytes for unpacking 2 bytes at offset 0 (actual buffer size is 0)
> [2024-10-28 17:41:52] TCP session closed with ('192.0.2.1', 33922)
> [2024-10-28 17:41:52] Server shutting down on 192.0.2.10:1789

The parser attempts to read an empty AS-path and considers the length
value as a length in bytes, whereas RFC mentions this value as
definining the number of AS-PAths. Fix this in the parser.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotopotests: bmp, create shared library for bmp
Philippe Guibert [Fri, 25 Oct 2024 20:06:11 +0000 (22:06 +0200)]
topotests: bmp, create shared library for bmp

The bgp_bmp and bgp_bmp_vrf tests use similar routines
to test the bmp, but are duplicates. Gather the bgp_bmp
and the bgp_bmp_vrf tests in a single bgp_bmp folder.

- Create a bgpbmp.py library under the bgp_bmp test folder
- The bgp_bmp and bgp_bmp_vrf test are renamed to bgp_bmp_1
and bgp_bmp_2 test.
- Maintain separate folder for config and output results. Adapt
the bgp_bmp library accordingly.
- The json output for bgp_bmp_2 test has no referenc to hostame.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agotests: ospf_multi_instance should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:52:40 +0000 (10:52 -0500)]
tests: ospf_multi_instance should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: ospf_multi_vrf_bgp_route_leak should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:52:01 +0000 (10:52 -0500)]
tests: ospf_multi_vrf_bgp_route_leak should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: ospf_netns_vrf should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:51:13 +0000 (10:51 -0500)]
tests: ospf_netns_vrf should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: ospf_p2mp should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:49:58 +0000 (10:49 -0500)]
tests: ospf_p2mp should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: ospf_prefix_suppression should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:48:20 +0000 (10:48 -0500)]
tests: ospf_prefix_suppression should not use /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: pim_autorp should not use /tmp
Donald Sharp [Mon, 2 Dec 2024 15:46:50 +0000 (10:46 -0500)]
tests: pim_autorp should not use /tmp

Cleanup usage of log file into /tmp.  Remove usage of
debugs that will slow down test and remove password.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: pim_basic should not use /tmp for outputing of files
Donald Sharp [Mon, 2 Dec 2024 15:44:46 +0000 (10:44 -0500)]
tests: pim_basic should not use /tmp for outputing of files

Use the appropriate log directory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: simple_snmp_test should not use /tmp for logging
Donald Sharp [Mon, 2 Dec 2024 15:41:25 +0000 (10:41 -0500)]
tests: simple_snmp_test should not use /tmp for logging

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: pim_cand_rp_bsr uses /tmp directory and it should not
Donald Sharp [Mon, 2 Dec 2024 15:40:42 +0000 (10:40 -0500)]
tests: pim_cand_rp_bsr uses /tmp directory and it should not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: zebra_rib should not use /tmp for log files
Donald Sharp [Mon, 2 Dec 2024 15:39:13 +0000 (10:39 -0500)]
tests: zebra_rib should not use /tmp for log files

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: bgp_nexthop_ipv6 remove unused reference to /tmp
Donald Sharp [Mon, 2 Dec 2024 15:38:23 +0000 (10:38 -0500)]
tests: bgp_nexthop_ipv6 remove unused reference to /tmp

This code should not be outputting anything to the /tmp directory,
remove commented out code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: bgp_lu_topo[1|2] should not use log files in /tmp
Donald Sharp [Mon, 2 Dec 2024 15:36:15 +0000 (10:36 -0500)]
tests: bgp_lu_topo[1|2] should not use log files in /tmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agobgpd: bgp_clist.c does not need jhash.h
Donald Sharp [Mon, 2 Dec 2024 15:33:57 +0000 (10:33 -0500)]
bgpd: bgp_clist.c does not need jhash.h

It's not used in bgp_clist.c so let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: Check if remote-as is not flushed once peer-group applied 17542/head
Donatas Abraitis [Sun, 1 Dec 2024 12:49:40 +0000 (14:49 +0200)]
tests: Check if remote-as is not flushed once peer-group applied

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agobgpd: Initialize as_type for peer-group as AS_UNSPECIFIED
Donatas Abraitis [Sun, 1 Dec 2024 12:32:08 +0000 (14:32 +0200)]
bgpd: Initialize as_type for peer-group as AS_UNSPECIFIED

Previously AS_UNSPECIFIED was treated as 0, but with now it's 1 after renumbering
peer_asn_type enum.

Fixes: 0dfe25697f5299326046fcfb66f2c6beca7c423c ("bgpd: Implement neighbor X remote-as auto")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17525 from famfo/podman-tests
Donatas Abraitis [Fri, 29 Nov 2024 08:02:12 +0000 (10:02 +0200)]
Merge pull request #17525 from famfo/podman-tests

topotests: Allow runing under both docker and podman

5 months agoMerge pull request #16700 from louis-6wind/fix-nhrp-output
Donatas Abraitis [Thu, 28 Nov 2024 15:16:24 +0000 (17:16 +0200)]
Merge pull request #16700 from louis-6wind/fix-nhrp-output

nhrpd: fix show ip nhrp output

5 months agoMerge pull request #17491 from pguibert6WIND/bgp_evpn_rt5_routemap
Donatas Abraitis [Thu, 28 Nov 2024 14:59:57 +0000 (16:59 +0200)]
Merge pull request #17491 from pguibert6WIND/bgp_evpn_rt5_routemap

Bgp evpn rt5 routemap

5 months agotopotests: Allow runing under both docker and podman 17525/head
famfo [Tue, 26 Nov 2024 18:42:03 +0000 (19:42 +0100)]
topotests: Allow runing under both docker and podman

Signed-off-by: famfo <famfo@famfo.xyz>
5 months agoMerge pull request #17520 from mikemallin/dev/ubuntu-docker-custom-uid
Donatas Abraitis [Thu, 28 Nov 2024 13:58:09 +0000 (15:58 +0200)]
Merge pull request #17520 from mikemallin/dev/ubuntu-docker-custom-uid

Docker: Add the ability to override the FRR UID during docker creation

5 months agoMerge pull request #15542 from pguibert6WIND/bgp_srv6_real_sid
Donatas Abraitis [Thu, 28 Nov 2024 13:21:10 +0000 (15:21 +0200)]
Merge pull request #15542 from pguibert6WIND/bgp_srv6_real_sid

bgpd: fix use real SID in BGP nexthop tracking

5 months agobgpd: fix use real SID in BGP nexthop tracking 15542/head
Philippe Guibert [Mon, 11 Mar 2024 10:51:55 +0000 (11:51 +0100)]
bgpd: fix use real SID in BGP nexthop tracking

When receiving an SRv6 BGP update, the nexthop tracking is used
to find out the reachability of the BGP update.

> # show bgp ipv6 vpn fd00:200::/64
> Paths: (1 available, best #1)
> [..]
>     4:4::4:4 from 4:4::4:4 (4.4.4.4)
>       Origin incomplete, metric 0, localpref 100, valid, internal, best (First path received)
>       Extended Community: RT:52:100
>       Remote label: 16
>       Remote SID: 2001:db8:f4::
>       Last update: Mon Mar 11 11:50:04 2024

The IPv6 address used is the "Remote SID". Actually, this value is
incomplete. Remote SID stands for the attribute value received in BGP,
while the label value determines a complement of SRv6 SID value. The
transposition technique authorises that in BGP, and in the above case,
the incoming BGP update has used the transposition length.

When there is a transposition in the SID attribute available, use the
real SID address. The nexthop tracking will use that forged address.

> # show bgp nexthop
> Current BGP nexthop cache:
>  4:4::4:4 valid [IGP metric 30], #paths 0, peer 4:4::4:4
>   gate fe80::dced:1ff:fed6:878c, if ntfp3
>   Last update: Mon Mar 11 11:50:02 2024
>  2001:db8:f4:1:: valid [IGP metric 0], #paths 2
>   gate fe80::dced:1ff:fed6:878c, if ntfp3

Fixes: 26c747ed6c0b ("bgpd: extend make_prefix to form srv6-based prefix")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 months agotopotests: bgp_evpn_rt5, add test for advertise route-map service 17491/head
Philippe Guibert [Fri, 22 Nov 2024 14:57:25 +0000 (15:57 +0100)]
topotests: bgp_evpn_rt5, add test for advertise route-map service

Use the advertise route-map command, and check that it
filters out correctly the undesirable prefixes. Reversely,
check that undoing that route-map recovers all prefixes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 months agotopotests: bgp_evpn_rt5, rework test
Philippe Guibert [Fri, 22 Nov 2024 12:28:10 +0000 (13:28 +0100)]
topotests: bgp_evpn_rt5, rework test

Rework the test file by adding test methods.
Add a convergence test that checks for the incoming BGP prefixes.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 months agoMerge pull request #17527 from guoguojia2021/guozhongfeng_alibaba
Donatas Abraitis [Wed, 27 Nov 2024 06:27:08 +0000 (08:27 +0200)]
Merge pull request #17527 from guoguojia2021/guozhongfeng_alibaba

doc:Fix bgp doc warning

5 months agobgpd: Use peer group's member for BGP notify instead of the peer-group 17528/head
Donatas Abraitis [Wed, 27 Nov 2024 06:07:35 +0000 (08:07 +0200)]
bgpd: Use peer group's member for BGP notify instead of the peer-group

Fixes: eacf923b00c019e9a877c9716e5d6506594d532e ("bgpd: Fix pattern of usage in bgp_notify_config_change")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agodoc:Fix bgp doc warning 17527/head
guozhongfeng.gzf [Wed, 27 Nov 2024 02:05:03 +0000 (10:05 +0800)]
doc:Fix bgp doc warning

Signed-off-by: guozhongfeng.gzf <guozhongfeng.gzf@alibaba-inc.com>
5 months agoMerge pull request #17519 from chiragshah6/evpn_dev4
Mark Stapp [Tue, 26 Nov 2024 21:39:47 +0000 (16:39 -0500)]
Merge pull request #17519 from chiragshah6/evpn_dev4

zebra: EVPN fix code style in vlan vni map debugs

5 months agoMerge pull request #17385 from donaldsharp/more_found_connection_conversion_issues
Donatas Abraitis [Tue, 26 Nov 2024 20:45:10 +0000 (22:45 +0200)]
Merge pull request #17385 from donaldsharp/more_found_connection_conversion_issues

More found connection conversion issues

5 months agoMerge pull request #16878 from donaldsharp/increased_test_cover
Jafar Al-Gharaibeh [Tue, 26 Nov 2024 19:40:39 +0000 (13:40 -0600)]
Merge pull request #16878 from donaldsharp/increased_test_cover

Add some test cases, and some ability to see what is going on in zebra

5 months agoMerge pull request #17510 from pguibert6WIND/show_bgp_flowspec_extra_space
Russ White [Tue, 26 Nov 2024 18:11:22 +0000 (13:11 -0500)]
Merge pull request #17510 from pguibert6WIND/show_bgp_flowspec_extra_space

bgpd: fix use single whitespace when displaying flowspec entries

5 months agoDocker: Add the ability to override FRR UID 17520/head
Mike RE Mallin [Tue, 26 Nov 2024 17:13:21 +0000 (12:13 -0500)]
Docker: Add the ability to override FRR UID

Signed-off-by: Mike RE Mallin <mmallin@cisco.com>
Signed-off-by: Mike RE Mallin <mremallin@gmail.com>
5 months agozebra: EVPN fix code style in vlan vni map debugs 17519/head
Chirag Shah [Tue, 26 Nov 2024 16:56:08 +0000 (08:56 -0800)]
zebra: EVPN fix code style in vlan vni map debugs

Fix up couple of style issues missed in
PR 17483

Signed-off-by: Chirag Shah <chirag@nvidia.com>
5 months agobgpd: peer_active is connection oriented, make it so 17385/head
Donald Sharp [Wed, 6 Nov 2024 20:30:32 +0000 (15:30 -0500)]
bgpd: peer_active is connection oriented, make it so

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: bgp_getsockname should use connection
Donald Sharp [Wed, 6 Nov 2024 19:31:19 +0000 (14:31 -0500)]
bgpd: bgp_getsockname should use connection

Let's use the connection associated with the peer
instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Modify bgp_connect_in_progress_update_connection to use connection
Donald Sharp [Wed, 6 Nov 2024 19:25:20 +0000 (14:25 -0500)]
bgpd: Modify bgp_connect_in_progress_update_connection to use connection

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Modify bgp_udpatesockname to pass in a connection
Donald Sharp [Wed, 6 Nov 2024 16:55:43 +0000 (11:55 -0500)]
bgpd: Modify bgp_udpatesockname to pass in a connection

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Fix pattern of usage in bgp_notify_config_change
Donald Sharp [Wed, 6 Nov 2024 13:24:28 +0000 (08:24 -0500)]
bgpd: Fix pattern of usage in bgp_notify_config_change

if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->connection->status))
        peer_notify_config_change(peer->connection);
else
        bgp_session_reset_safe(peer, &nnode);

Let's add a bool return to peer_notify_config_change of whether or
not it should call the peer session reset.  This simplifies
the code a bunch.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: Add `peer_notify_config_change()` function
Donald Sharp [Wed, 6 Nov 2024 13:15:06 +0000 (08:15 -0500)]
bgpd: Add `peer_notify_config_change()` function

We have about a bajillion tests of if we can
notify the peer and then we send a config change
notification.  Let's just make a function that
does this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agobgpd: peer_notify_unconfig should be connection based
Donald Sharp [Tue, 5 Nov 2024 20:47:08 +0000 (15:47 -0500)]
bgpd: peer_notify_unconfig should be connection based

Convert this function to being connection based.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agoMerge pull request #17483 from chiragshah6/evpn_dev4
Russ White [Tue, 26 Nov 2024 16:48:01 +0000 (11:48 -0500)]
Merge pull request #17483 from chiragshah6/evpn_dev4

zebra: fix EVPN check vxlan oper up in vlan mapping

5 months agopimd: Fix access-list memory leak in pimd 17518/head
Corey Siltala [Tue, 26 Nov 2024 16:04:14 +0000 (10:04 -0600)]
pimd: Fix access-list memory leak in pimd

Reset access-lists in pimd on terminate

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
5 months agoMerge pull request #17501 from opensourcerouting/fix/gr_peer-groups
Russ White [Tue, 26 Nov 2024 15:35:19 +0000 (10:35 -0500)]
Merge pull request #17501 from opensourcerouting/fix/gr_peer-groups

bgpd: Fix Graceful-Restart for peer-groups

5 months agoMerge pull request #14367 from donaldsharp/ospfapi_test_failure
Russ White [Tue, 26 Nov 2024 15:13:59 +0000 (10:13 -0500)]
Merge pull request #14367 from donaldsharp/ospfapi_test_failure

two test cleanups

5 months agoMerge pull request #17219 from zhou-run/202406201119
Russ White [Tue, 26 Nov 2024 15:10:33 +0000 (10:10 -0500)]
Merge pull request #17219 from zhou-run/202406201119

isisd: When the ISIS types of the routers do not match on a P2P link, the neighbor status remains UP

5 months agoMerge pull request #16987 from opensourcerouting/bfd-echo-sock
Russ White [Tue, 26 Nov 2024 13:51:07 +0000 (08:51 -0500)]
Merge pull request #16987 from opensourcerouting/bfd-echo-sock

bfdd: disable echo socket when not using it

5 months agoMerge pull request #17504 from mjstapp/fix_fpm_cancel_race
Donald Sharp [Tue, 26 Nov 2024 13:32:54 +0000 (08:32 -0500)]
Merge pull request #17504 from mjstapp/fix_fpm_cancel_race

zebra: avoid a race during FPM dplane plugin shutdown

5 months agoMerge pull request #17506 from pguibert6WIND/int_versus_string
Donatas Abraitis [Tue, 26 Nov 2024 13:28:51 +0000 (15:28 +0200)]
Merge pull request #17506 from pguibert6WIND/int_versus_string

bgpd: fix version attribute is an int, not a string

5 months agoMerge pull request #17509 from opensourcerouting/fix/run_topotests_from_quay.io
Donald Sharp [Tue, 26 Nov 2024 13:28:23 +0000 (08:28 -0500)]
Merge pull request #17509 from opensourcerouting/fix/run_topotests_from_quay.io

Fix docker image for topotests

5 months agobgpd: fix use single whitespace when displaying flowspec entries 17510/head
Philippe Guibert [Tue, 26 Nov 2024 13:19:34 +0000 (14:19 +0100)]
bgpd: fix use single whitespace when displaying flowspec entries

There is an extra space in the 'Displayed' line of show bgp command,
that should not be present.
Fix this by being consistent with the output of the other address
families.

Fixes: ("a1baf9e84f71") bgpd: Use single whitespace when displaying show bgp summary
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 months agobgpd: fix version attribute is an int, not a string 17506/head
Philippe Guibert [Mon, 25 Nov 2024 21:47:21 +0000 (22:47 +0100)]
bgpd: fix version attribute is an int, not a string

The json display of the version attribute is originally an
integer. It has changed, most probably mistakenly.

> {
>   "vrfId": 7,
>   "vrfName": "vrf1",
>   "tableVersion": 3,
>   "routerId": "192.0.2.1",
>   "defaultLocPrf": 100,
>   "localAS": 65500,
>   "routes": {
>     "172.31.0.1/32": {
>       "prefix": "172.31.0.1/32",
>       "version": "1", <--- int or string ??

Let us fix it, by using the integer display instead.

Fixes: f9f2d188e398 ("bgpd: fix 'json detail' output structure")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 months agotests: Deprecate TOPOTEST_PULL 17509/head
Donatas Abraitis [Tue, 26 Nov 2024 09:42:49 +0000 (11:42 +0200)]
tests: Deprecate TOPOTEST_PULL

We do not maintain docker.com/frrouting anymore and not building custom
images for topotests.

Use local images for topotests instead.

Just use:

```
mak topotests-build
make topotests
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agotests: Set vm.mmap_rnd_bits for topotests docker foobar
Donatas Abraitis [Tue, 26 Nov 2024 09:34:12 +0000 (11:34 +0200)]
tests: Set vm.mmap_rnd_bits for topotests docker foobar

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agotests: Fix docker build for topotests
Donatas Abraitis [Tue, 26 Nov 2024 09:26:55 +0000 (11:26 +0200)]
tests: Fix docker build for topotests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agodoc: document shutdown command 17502/head
Rafael Zalamena [Mon, 25 Nov 2024 15:03:59 +0000 (12:03 -0300)]
doc: document shutdown command

Let users know about the MSDP shutdown command.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 months agotopotests: test MSDP shutdown command
Rafael Zalamena [Mon, 25 Nov 2024 14:32:46 +0000 (11:32 -0300)]
topotests: test MSDP shutdown command

New test step to check that MSDP shutdown command is working.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 months agopimd: implement MSDP shutdown command
Rafael Zalamena [Tue, 10 May 2022 11:23:33 +0000 (08:23 -0300)]
pimd: implement MSDP shutdown command

Allow MSDP protocol to be disabled.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 months agozebra: avoid a race during FPM dplane plugin shutdown 17504/head
Mark Stapp [Mon, 25 Nov 2024 20:37:39 +0000 (15:37 -0500)]
zebra: avoid a race during FPM dplane plugin shutdown

During zebra shutdown, the main pthread and the FPM pthread can
deadlock if the FPM pthread is in fpm_reconnect(). Each pthread
tries to use event_cancel_async() to cancel tasks that may be
scheduled for the other pthread - this leads to a deadlock as
neither thread can progress.

This adds an atomic boolean that's managed as each pthread
enters and leaves the cleanup code in question, preventing the
two threads from running into the deadlock.

Signed-off-by: Mark Stapp <mjs@cisco.com>
5 months agotests: fix max med on startup 14367/head
Donald Sharp [Thu, 7 Sep 2023 12:06:28 +0000 (08:06 -0400)]
tests: fix max med on startup

The test is failing because on r2 we are looking for a metric of 777
on startup, but the start of looking for this happens to be after
the 5 second delay that is setup in the config.

On r1:

2023/09/06 17:05:14.999407 BGP: [G822R-SBMNH] config-from-file# router bgp 65001
2023/09/06 17:05:15.003060 BGP: [G822R-SBMNH] config-from-file#   bgp max-med on-startup 5 777
2023/09/06 17:05:15.003342 BGP: [G822R-SBMNH] config-from-file#   no bgp ebgp-requires-policy
2023/09/06 17:05:15.003453 BGP: [G822R-SBMNH] config-from-file#   neighbor 192.168.255.2 remote-as 65001
2023/09/06 17:05:15.004029 BGP: [G822R-SBMNH] config-from-file#   neighbor 192.168.255.2 timers 3 10
2023/09/06 17:05:15.004242 BGP: [G822R-SBMNH] config-from-file#   address-family ipv4 unicast
2023/09/06 17:05:15.004329 BGP: [G822R-SBMNH] config-from-file#     redistribute connected
2023/09/06 17:05:15.005023 BGP: [G822R-SBMNH] config-from-file#   exit-address-family
2023/09/06 17:05:15.005140 BGP: [G822R-SBMNH] config-from-file#   !
2023/09/06 17:05:15.005162 BGP: [G822R-SBMNH] config-from-file# !
2023/09/06 17:05:17.538112 BGP: [M7Q4P-46WDR] vty[25]@> enable
2023/09/06 17:05:17.546700 BGP: [M7Q4P-46WDR] vty[25]@# clear log cmdline-targets
2023/09/06 17:05:17.570635 BGP: [M7Q4P-46WDR] vty[25]@(config)# log commands
2023/09/06 17:05:17.572518 BGP: [M7Q4P-46WDR] vty[25]@(config)# log timestamp precision 6
2023/09/06 17:05:24.982647 BGP: [YNGC8-65JDM] Begin maxmed onstartup mode - timer 5 seconds
2023/09/06 17:05:26.033134 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.255.2 in vrf default
2023/09/06 17:05:29.982960 BGP: [N1747-51Y51] Max med on startup ended - timer expired.

on r2:

2023/09/06 17:05:23.976029 BGP: [G822R-SBMNH] config-from-file# !
2023/09/06 17:05:26.084086 BGP: [M59KS-A3ZXZ] bgp_update_receive: rcvd End-of-RIB for IPv4 Unicast from 192.168.255.1 in vrf default
2023/09/06 17:05:27.280103 BGP: [M7Q4P-46WDR] vty[25]@> enable
2023/09/06 17:05:27.290204 BGP: [M7Q4P-46WDR] vty[25]@# clear log cmdline-targets
2023/09/06 17:05:27.328798 BGP: [M7Q4P-46WDR] vty[25]@(config)# log commands
2023/09/06 17:05:27.335032 BGP: [M7Q4P-46WDR] vty[25]@(config)# log timestamp precision 6
2023/09/06 17:05:31.558216 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:31.562482 BGP: [M7Q4P-46WDR] vty[5]@# do show logging
2023/09/06 17:05:32.942204 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:32.946745 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 json
2023/09/06 17:05:34.173879 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:34.178448 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:36.459365 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:36.472019 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:38.557840 BGP: [M7Q4P-46WDR] vty[5]@> enable
2023/09/06 17:05:38.558948 BGP: [M7Q4P-46WDR] vty[5]@# show ip bgp neighbor 192.168.255.1 routes json
2023/09/06 17:05:40.198563 BGP: [M7Q4P-46WDR] vty[5]@> enable

Notice that the 5 second delay for the max med expires at 29 seconds but the show routes
on r2 does not even begin until 34 seconds, long after the max med has expired and the
test has moved on.

Let's relax the max-med timer to 30 seconds and modify the test to wait a bit longer for
both finding it and expiring timer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agotests: Fix ospfapi client to clear ospf process
Donald Sharp [Thu, 7 Sep 2023 11:57:26 +0000 (07:57 -0400)]
tests: Fix ospfapi client to clear ospf process

Test is failing locally:
2023-09-06 18:39:56,865 DEBUG: r1: vtysh result:
        Hello, this is FRRouting (version 9.1-dev).
        Copyright 1996-2005 Kunihiro Ishiguro, et al.

        r1# conf t
        r1(config)# router ospf
        r1(config-router)# ospf router-id 1.1.1.1
        For this router-id change to take effect, use "clear ip ospf process" command
        r1(config-router)#
2023-09-06 18:39:56,865 DEBUG: root: GOT LINE: 'SUCCESS: 1.0.0.0'
2023-09-06 18:39:56,866 DEBUG: root: GOT LINE: '2023-09-06 18:39:55,982 INFO: TESTER: root: Waiting for 1.1.1.1'
2023-09-06 18:39:56,867 DEBUG: root: GOT LINE: '2023-09-06 18:39:55,982 DEBUG: TESTER: root: expected '1.1.1.1' != '1.0.0.0''
2023-09-06 18:39:56,867 DEBUG: root: GOT LINE: 'waiting on notify'

Sure looks like the router-id is not allowed to be changed because
neighbors have already been formed.  If we are changing the router-id
then let's clear the process to allow it to correctly change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agolib: Remove route_node_match_ipv[4|6] not being used 16878/head
Donald Sharp [Wed, 25 Sep 2024 12:02:42 +0000 (08:02 -0400)]
lib: Remove route_node_match_ipv[4|6] not being used

These functions are not being used.  Let's just remove
them from our code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agoripd: Use route_node_match instead of route_node_match_ipv4
Donald Sharp [Tue, 24 Sep 2024 17:59:48 +0000 (13:59 -0400)]
ripd: Use route_node_match instead of route_node_match_ipv4

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agotests: Add some test cases for snmp
Donald Sharp [Tue, 24 Sep 2024 14:46:11 +0000 (10:46 -0400)]
tests: Add some test cases for snmp

Noticed that we were not really attempting to even test
large swaths of our snmp infrastructure.  Let's load
up some very simple configs for those daemons that
FRR supports and ensure that SNMP is working to
some extent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agozebra: Remove some unused functions on linux build
Donald Sharp [Fri, 20 Sep 2024 01:39:50 +0000 (21:39 -0400)]
zebra: Remove some unused functions on linux build

The functions:
if_get_flags
if_flags_update
if_flags_mangle

are never invoked from a linux netlink build.  Put a #ifdef
around those functions so that they are not included on the
linux build as that they are not needed there.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agotests: Add some test cases for missed coverage
Donald Sharp [Fri, 20 Sep 2024 01:06:40 +0000 (21:06 -0400)]
tests: Add some test cases for missed coverage

I noticed that there was some missed code coverage in zebra.
multicast [enable|disable]
and
show interface description vrf all

Add a bit to get it covered.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agozebra: Add ability to know if some config is set
Donald Sharp [Thu, 19 Sep 2024 19:36:50 +0000 (15:36 -0400)]
zebra: Add ability to know if some config is set

For interface config:
shutdown
mpls
multicast

These states were never being shown in output, let's show it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
5 months agotools: fix style check babletrace file 17483/head
Chirag Shah [Mon, 25 Nov 2024 16:58:25 +0000 (08:58 -0800)]
tools: fix style check babletrace file

python3 -m black tools/frr_babeltrace.py

Signed-off-by: Chirag Shah <chirag@nvidia.com>
5 months agotools: add helper function to print family
Chirag Shah [Wed, 20 Nov 2024 02:11:10 +0000 (18:11 -0800)]
tools: add helper function to print family

Ticket: #4127810
Testing:
2024-11-20T01:52:10.073 frr_zebra:netlink_neigh_update_msg_encode
{'mac': '00:00:00:00:00:00', 'ip': '27.0.0.4', 'nhg': 0, 'flags': 2,
'state': 192, 'family': 'bridge', 'type': 0, 'op': 23}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
5 months agozebra: add debug in remote vtep install ifp not up
Chirag Shah [Wed, 20 Nov 2024 17:15:24 +0000 (09:15 -0800)]
zebra: add debug in remote vtep install ifp not up

Ticket: #4139506

Signed-off-by: Chirag Shah <chirag@nvidia.com>