Commit Graph

37403 Commits

Author SHA1 Message Date
Rafael Zalamena
a38ed18a4e pimd: implement MSDP peer SA limiting
Implement a command to enable/disable per peer MSDP SA limiting.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-05 10:38:52 -03:00
Rafael Zalamena
c8ded86e9e yang,pimd: support shutdown and SA limit
Add MSDP shutdown and SA limiting configuration to YANG model.

(no implementation, just boiler plate code)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2024-12-05 10:35:10 -03:00
Donatas Abraitis
34485ee536
Merge pull request #17582 from pguibert6WIND/no_neighbor_asdot_fix
bgpd: fix unconfigure asdot neighbor
2024-12-05 09:32:54 +02:00
Jafar Al-Gharaibeh
e814b000c3
Merge pull request #17585 from donaldsharp/zclient_speedup
lib: Speed up reconnection attempts for zapi
2024-12-04 21:59:33 -06:00
Jafar Al-Gharaibeh
59b0a6e339
Merge pull request #17502 from opensourcerouting/msdp-shutdown
pimd: implement MSDP shutdown command
2024-12-04 21:57:18 -06:00
Donald Sharp
fe180581bd 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>
2024-12-04 16:14:34 -05:00
Jafar Al-Gharaibeh
7c8cef4891
Merge pull request #17578 from donaldsharp/pim_autorp_prevent_crash
pimd: Prevent crash of pim when auto-rp's socket is not initialized
2024-12-04 14:40:25 -06:00
Philippe Guibert
12a9ca4de6 bgpd: fix unconfigure asdot neighbor
The below command is not successfull on an existing as dot peer

> no neighbor 10.0.0.2 remote-as 1.1
> % Create the peer-group or interface first

Handle the case where the remote-as argument can be an ASNUM.

Fixes: 8079a4138d ("lib, bgp: add initial support for asdot format")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-04 21:29:34 +01:00
Donald Sharp
37b88191fb 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>
2024-12-04 10:49:49 -05:00
Donald Sharp
6bf4283421
Merge pull request #17569 from btrent98/igmp-proxy-bugfix
pimd: igmp proxy joins should not be written as part of config
2024-12-04 08:16:24 -05:00
Russ White
f1ab0a0c2f
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
2024-12-04 08:09:48 -05:00
Donatas Abraitis
75e9b1b090
Merge pull request #17571 from donaldsharp/fix_bsd_sockopt_problem
Fix bsd sockopt problem
2024-12-04 14:46:08 +02:00
Donatas Abraitis
5b976f00f6 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>
2024-12-04 08:27:13 +02:00
Jafar Al-Gharaibeh
9797f20a1e
Merge pull request #17558 from donaldsharp/bfd_fix
lib: Fix session re-establishment
2024-12-03 20:06:28 -06:00
Donald Sharp
959dbe27cd lib,vtysh: Use backoff setsockopt option for freebsd
Commit: 9112fb367b

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>
2024-12-03 18:49:59 -05:00
Donald Sharp
d5615fd6f8 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>
2024-12-03 18:38:59 -05:00
Barry A. Trent
d4b8a98019 pimd: igmp proxy joins should not be written as part of config
Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
2024-12-03 13:44:08 -08:00
Donatas Abraitis
267dc19825
Merge pull request #17518 from csiltala/fix-pimd-acl-memleak
pimd: Fix access-list memory leak in pimd
2024-12-03 23:35:34 +02:00
Jafar Al-Gharaibeh
71f9899bc4
Merge pull request #17313 from mjstapp/zserv_open_unpriv
zebra: separate zebra ZAPI server open and accept
2024-12-03 14:26:09 -06:00
Donald Sharp
2c6fcbdf84 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>
2024-12-03 12:08:12 -05:00
Russ White
e9c9db0122
Merge pull request #17542 from opensourcerouting/fix/peer-group_remote_as_regression
bgpd: Fix remote-as with peer-group
2024-12-03 10:05:44 -05:00
Russ White
ed4a758f85
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
2024-12-03 10:04:09 -05:00
Mark Stapp
506097a1b9 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>
2024-12-03 09:44:46 -05:00
Mark Stapp
426dc2b7e2
Merge pull request #17547 from donaldsharp/some_cleanups
Some cleanups
2024-12-03 08:57:28 -05:00
Russ White
6e1eeed507
Merge pull request #17306 from pguibert6WIND/bmp_test_factorise_plus_fix
BMP test rework
2024-12-03 08:42:24 -05:00
Philippe Guibert
d1301f1c2a 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>
2024-12-02 18:44:53 +01:00
Louis Scalbert
f2eb14d381 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>
2024-12-02 18:44:53 +01:00
Louis Scalbert
b12e04fdf1 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>
2024-12-02 18:44:53 +01:00
Louis Scalbert
bbf8ee1769 tests: add py extension to bmpserver
to help identify the file type. And apply black.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-12-02 18:44:53 +01:00
Philippe Guibert
1ea8ba5902 topotests: bgp_bmp, use unified configuration
Use unified configuration procedure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-02 18:44:50 +01:00
Donald Sharp
0d7d795c00 tests: bgp_route_server_client should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:59:07 -05:00
Donald Sharp
b109b0cd82 tests: bgp_snmp_mplsl3vpn should not use /tmp directory
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:57:41 -05:00
Donald Sharp
6112030f27 tests: ospf_metric_propagation do not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:55:09 -05:00
Philippe Guibert
2dc693e808 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>
2024-12-02 16:54:04 +01:00
Philippe Guibert
0af653eaf7 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>
2024-12-02 16:54:04 +01:00
Donald Sharp
caf9cddcf6 tests: ospf_multi_instance should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:52:40 -05:00
Donald Sharp
04b29f61b5 tests: ospf_multi_vrf_bgp_route_leak should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:52:01 -05:00
Donald Sharp
e3ee41c7f2 tests: ospf_netns_vrf should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:51:13 -05:00
Donald Sharp
3b9db86e13 tests: ospf_p2mp should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:49:58 -05:00
Donald Sharp
aeeb7fe68b tests: ospf_prefix_suppression should not use /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:48:20 -05:00
Donald Sharp
649eb5cdc3 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>
2024-12-02 10:46:50 -05:00
Donald Sharp
d5687faa0c tests: pim_basic should not use /tmp for outputing of files
Use the appropriate log directory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:44:46 -05:00
Donald Sharp
d580bcd6e7 tests: simple_snmp_test should not use /tmp for logging
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:41:25 -05:00
Donald Sharp
12b032abb8 tests: pim_cand_rp_bsr uses /tmp directory and it should not
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:40:42 -05:00
Donald Sharp
67d697ad26 tests: zebra_rib should not use /tmp for log files
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:39:13 -05:00
Donald Sharp
6e552125e9 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>
2024-12-02 10:38:23 -05:00
Donald Sharp
66ea35cbb5 tests: bgp_lu_topo[1|2] should not use log files in /tmp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-12-02 10:36:15 -05:00
Donald Sharp
ccede71b46 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>
2024-12-02 10:33:57 -05:00
Donatas Abraitis
6f1ad10d90 tests: Check if remote-as is not flushed once peer-group applied
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-01 14:50:48 +02:00
Donatas Abraitis
e57fb3282a 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: 0dfe25697f ("bgpd: Implement neighbor X remote-as auto")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-01 14:32:08 +02:00