]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
4 months agolib: Take ge/le into consideration when checking the prefix with the prefix-list
Donatas Abraitis [Tue, 10 Dec 2024 14:28:26 +0000 (16:28 +0200)]
lib: Take ge/le into consideration when checking the prefix with the prefix-list

Without the fix:

```
show ip prefix-list test_1 10.20.30.96/27 first-match
 <no result>

show ip prefix-list test_2 192.168.1.2/32 first-match
 <no result>
```

With the fix:

```
ip prefix-list test_1 seq 10 permit 10.20.30.64/26 le 27
!
end
donatas# show ip prefix-list test_1 10.20.30.96/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 1, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 2, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/28
donatas# show ip prefix-list test_1 10.20.30.126/26
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 3, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.126/30
donatas#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17461 from csiltala/multicast-boundary-acl
Donald Sharp [Mon, 9 Dec 2024 15:42:04 +0000 (10:42 -0500)]
Merge pull request #17461 from csiltala/multicast-boundary-acl

pimd: Extend multicast boundary/ACL functionality

4 months agoMerge pull request #17589 from anlancs/master_up
Donatas Abraitis [Sat, 7 Dec 2024 20:35:12 +0000 (22:35 +0200)]
Merge pull request #17589 from anlancs/master_up

zebra: use macro for one check

4 months agoMerge pull request #17538 from idryzhov/netns-doc
Donatas Abraitis [Sat, 7 Dec 2024 20:32:00 +0000 (22:32 +0200)]
Merge pull request #17538 from idryzhov/netns-doc

doc: remove no-op "netns NAMESPACE" command from the docs

4 months agozebra: add deprecation notice for no-op netns command
Igor Ryzhov [Sat, 7 Dec 2024 15:01:43 +0000 (17:01 +0200)]
zebra: add deprecation notice for no-op netns command

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
4 months agodoc: remove no-op "netns NAMESPACE" command from the docs
Igor Ryzhov [Sat, 30 Nov 2024 15:16:37 +0000 (17:16 +0200)]
doc: remove no-op "netns NAMESPACE" command from the docs

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
4 months agopimd: Convert boundary_oil_plist to struct prefix_list
Corey Siltala [Tue, 26 Nov 2024 14:35:42 +0000 (08:35 -0600)]
pimd: Convert boundary_oil_plist to struct prefix_list

Rather than storing the prefix-list name and looking it up every time we use it, store a pointer to the prefix-list itself.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agodoc: Expand ACL and multicast boundary documentation
Corey Siltala [Thu, 14 Nov 2024 19:08:52 +0000 (13:08 -0600)]
doc: Expand ACL and multicast boundary documentation

Add documentation for existing extended access-list functionality and
the new "ip multicast boundary" command leveraging that functionality.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agotests: Add basic multicast boundary test
Corey Siltala [Thu, 14 Nov 2024 19:08:28 +0000 (13:08 -0600)]
tests: Add basic multicast boundary test

Add simple test to show filtering of IGMP joins using new "ip multicast
boundary" filtering with access-lists, include test of existing prefix-
list based "ip multicast boundary oil" command.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agopimd,yang: Extend multicast boundary functionality
Corey Siltala [Mon, 25 Nov 2024 16:36:54 +0000 (10:36 -0600)]
pimd,yang: Extend multicast boundary functionality

Add new interface command ip multicast boundary ACCESSLIST4_NAME. This
allows filtering on both source and group using the extended access-list
syntax vs. group-only as with the existing "ip multicast boundary oil"
command, which uses prefix-lists. If both are configured, the prefix-
list is evaluated first. The default behavior for both prefix-lists and
access-lists remains "deny", so the prefix-list must have a terminating
"permit" statement in order to also evaluate against the access-list.

The following example denies groups in range 229.1.1.0/24 and groups in
range 232.1.1.0/24 with source 10.0.20.2:

!
ip prefix-list pim-oil-plist seq 10 deny 229.1.1.0/24
ip prefix-list pim-oil-plist seq 20 permit any
!
access-list pim-acl seq 10 deny ip host 10.0.20.2 232.1.1.0 0.0.0.255
access-list pim-acl seq 20 permit ip any any
!
interface r1-eth0
 ip address 10.0.20.1/24
 ip igmp
 ip pim
 ip multicast boundary oil pim-oil-plist
 ip multicast boundary pim-acl
!

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agopimd: Move ACL handling to pim_util.c
Corey Siltala [Mon, 25 Nov 2024 16:43:30 +0000 (10:43 -0600)]
pimd: Move ACL handling to pim_util.c

Move the extended access-list handling from pim_msdp_packet.c to
pim_util.c to allow use elsewhere in the daemon.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
4 months agoMerge pull request #17603 from opensourcerouting/fix/bgp_peer_with_peer-group
Jafar Al-Gharaibeh [Fri, 6 Dec 2024 14:55:56 +0000 (08:55 -0600)]
Merge pull request #17603 from opensourcerouting/fix/bgp_peer_with_peer-group

bgpd: Check if as_type is not specified when peer is a peer-group member

4 months agoMerge pull request #17545 from pguibert6WIND/peerup_loc_rib_wrong_format
Donatas Abraitis [Fri, 6 Dec 2024 12:47:48 +0000 (14:47 +0200)]
Merge pull request #17545 from pguibert6WIND/peerup_loc_rib_wrong_format

bgpd: fix peer up message for loc-rib not sent

4 months agoMerge pull request #17579 from donaldsharp/timer_connect_bgp_vrf_netns
Donatas Abraitis [Fri, 6 Dec 2024 12:26:33 +0000 (14:26 +0200)]
Merge pull request #17579 from donaldsharp/timer_connect_bgp_vrf_netns

Timer connect bgp vrf netns

4 months agobgpd: Check if as_type is not specified when peer is a peer-group member
Donatas Abraitis [Fri, 6 Dec 2024 06:25:09 +0000 (08:25 +0200)]
bgpd: Check if as_type is not specified when peer is a peer-group member

Fixes this sequences:

```
neighbor pg4 peer-group
neighbor 127.0.0.4 peer-group pg4
neighbor 127.0.0.4 remote-as 65004

neighbor pg5 peer-group
neighbor 127.0.0.5 peer-group pg5
neighbor 127.0.0.5 remote-as internal
```

Fixes: 0dfe256 ("bgpd: Implement neighbor X remote-as auto")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17600 from donaldsharp/bfd_shared_network
Jafar Al-Gharaibeh [Fri, 6 Dec 2024 04:13:39 +0000 (22:13 -0600)]
Merge pull request #17600 from donaldsharp/bfd_shared_network

Bfd shared network

4 months agotests: Fix invalid escape seq seen in bgp_nexthop_ipv6
Donald Sharp [Wed, 4 Dec 2024 17:25:11 +0000 (12:25 -0500)]
tests: Fix invalid escape seq seen in bgp_nexthop_ipv6

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: Convert to using `neighbor X timers connect 1` for exabgp using tests
Donald Sharp [Wed, 4 Dec 2024 17:22:59 +0000 (12:22 -0500)]
tests: Convert to using `neighbor X timers connect 1` for exabgp using tests

For those tests using exabgp convert them all to use `neighbor X timers
connect 1`.  I have noticed that occassionally when looking at the
support files for tests run that peers are in a wait period for
reconnecting which is longer than the test is waiting to converge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agoMerge pull request #17570 from btrent98/igmp-proxy-memfix
Donald Sharp [Thu, 5 Dec 2024 15:23:30 +0000 (10:23 -0500)]
Merge pull request #17570 from btrent98/igmp-proxy-memfix

pimd: free igmp proxy joins on interface deletion

4 months agobgpd: When bgp notices a change to shared_network inform bfd of it
Donald Sharp [Thu, 5 Dec 2024 15:16:03 +0000 (10:16 -0500)]
bgpd: When bgp notices a change to shared_network inform bfd of it

When bgp is started up and reads the config in *before* it has
received interface addresses from zebra, shared_network can
be set to false in this case.  Later on once bgp attempts to
reconnect it will refigure out the shared_network again( because
it has received the data from zebra now ).  In this case
tell bfd about it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agobgpd: shared_network is a bool, convert it to such
Donald Sharp [Thu, 5 Dec 2024 15:15:18 +0000 (10:15 -0500)]
bgpd: shared_network is a bool, convert it to such

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotests: bfd_profiles_topo1 is taking a long time to reconnect
Donald Sharp [Thu, 5 Dec 2024 15:13:51 +0000 (10:13 -0500)]
tests: bfd_profiles_topo1 is taking a long time to reconnect

Make it faster

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
4 months agotopotests: bmp, test that loc-rib peer up message is sent
Philippe Guibert [Tue, 3 Dec 2024 14:48:26 +0000 (15:48 +0100)]
topotests: bmp, test that loc-rib peer up message is sent

Add a test at startup to ensure that peer up message for loc-rib is
correctly set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agobgpd: fix peer up message for loc-rib not sent
Philippe Guibert [Mon, 2 Dec 2024 10:07:34 +0000 (11:07 +0100)]
bgpd: fix peer up message for loc-rib not sent

At startup, there is no peer up message for loc-rib instance peer.
Instead, a global peer up message with address 0.0.0.0 is sent.

Such message is wrong, violates the RFC and should be dropped by
a strict collector. Actually, the peer type message sent is wrong,
and should be set to LOC-RIB peer type.

Fix this by changing the peer type of peer up message to either
loc-rib or global instance peer type.

Fixes: 035304c25a38 ("bgpd: bmp loc-rib peer up/down for vrfs")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agozebra: use macro for one check
anlan_cs [Thu, 5 Dec 2024 03:56:34 +0000 (11:56 +0800)]
zebra: use macro for one check

Signed-off-by: anlan_cs <anlan_cs@126.com>
4 months agoMerge pull request #17582 from pguibert6WIND/no_neighbor_asdot_fix
Donatas Abraitis [Thu, 5 Dec 2024 07:32:54 +0000 (09:32 +0200)]
Merge pull request #17582 from pguibert6WIND/no_neighbor_asdot_fix

bgpd: fix unconfigure asdot neighbor

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
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 agobgpd: fix unconfigure asdot neighbor
Philippe Guibert [Wed, 4 Dec 2024 20:25:33 +0000 (21:25 +0100)]
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: 8079a4138d61 ("lib, bgp: add initial support for asdot format")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agopimd: free igmp proxy joins on interface deletion
Barry A. Trent [Tue, 3 Dec 2024 22:43:47 +0000 (14:43 -0800)]
pimd: free igmp proxy joins on interface deletion

Signed-off-by: Barry A. Trent <barry.trent@atcorp.com>
4 months agopimd: Prevent crash of pim when auto-rp's socket is not initialized
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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