]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
13 months agoripd: fix missing "exit" for "router rip"
Igor Ryzhov [Wed, 6 Mar 2024 19:42:53 +0000 (21:42 +0200)]
ripd: fix missing "exit" for "router rip"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agolib: fix order of interfaces in the config
Igor Ryzhov [Wed, 6 Mar 2024 19:41:35 +0000 (21:41 +0200)]
lib: fix order of interfaces in the config

Add missing cli_cmp callback. Without it, interfaces are not sorted and
printed in order they were created.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15487 from idryzhov/nb-apply-finish
Donatas Abraitis [Wed, 6 Mar 2024 06:44:09 +0000 (08:44 +0200)]
Merge pull request #15487 from idryzhov/nb-apply-finish

lib: fix apply_finish callback in northbound

13 months agoMerge pull request #15486 from donaldsharp/make_prefix
Donatas Abraitis [Wed, 6 Mar 2024 06:43:40 +0000 (08:43 +0200)]
Merge pull request #15486 from donaldsharp/make_prefix

bgpd: pi->attr is deref'ed in all paths leading up to test

13 months agoMerge pull request #15489 from idryzhov/vty-mgmt-error
Donatas Abraitis [Wed, 6 Mar 2024 06:43:16 +0000 (08:43 +0200)]
Merge pull request #15489 from idryzhov/vty-mgmt-error

vty: change output of errors from mgmtd

13 months agoMerge pull request #15492 from donaldsharp/no_vrfs
Donatas Abraitis [Wed, 6 Mar 2024 06:42:37 +0000 (08:42 +0200)]
Merge pull request #15492 from donaldsharp/no_vrfs

tests: test invokes a script which does not exist

13 months agotests: test invokes a script which does not exist 15492/head
Donald Sharp [Tue, 5 Mar 2024 20:55:07 +0000 (15:55 -0500)]
tests: test invokes a script which does not exist

Apparently test_bgp_peer_type_multipath_relax.py does
no really need to run a `setup_vrfs` script.  Looking
at the other configuration for this test there are
no vrf's in the frr configuration.  So let's remove it

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15222 from chiragshah6/fdev2
Donatas Abraitis [Tue, 5 Mar 2024 20:36:30 +0000 (22:36 +0200)]
Merge pull request #15222 from chiragshah6/fdev2

bgpd:aggr summary-only remove suppressed from evpn

13 months agoMerge pull request #15397 from idryzhov/zebra-oper
Russ White [Tue, 5 Mar 2024 16:41:35 +0000 (11:41 -0500)]
Merge pull request #15397 from idryzhov/zebra-oper

zebra: oper data additions

13 months agovty: change output of errors from mgmtd 15489/head
Igor Ryzhov [Fri, 1 Mar 2024 11:28:25 +0000 (13:28 +0200)]
vty: change output of errors from mgmtd

Make errors look the same way as in regular non-mgmtd vty. We don't need
to show information about some internal request names.

Before:
```
ERROR: SET_CONFIG request failed, Error: YANG error(s):
 Path: Data location "/frr-affinity-map:lib/affinity-maps/affinity-map[name='a']".
 Error: Unique data leaf(s) "value" not satisfied in "/frr-affinity-map:lib/affinity-maps/affinity-map[name='b']" and "/frr-affinity-map:lib/affinity-maps/affinity-map[name='a']".
```

After:
```
% Configuration failed.

YANG error(s):
 Path: Data location "/frr-affinity-map:lib/affinity-maps/affinity-map[name='b']".
 Error: Unique data leaf(s) "value" not satisfied in "/frr-affinity-map:lib/affinity-maps/affinity-map[name='a']" and "/frr-affinity-map:lib/affinity-maps/affinity-map[name='b']".
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agobgpd: pi->attr is deref'ed in all paths leading up to test 15486/head
Donald Sharp [Tue, 5 Mar 2024 15:37:48 +0000 (10:37 -0500)]
bgpd: pi->attr is deref'ed in all paths leading up to test

In make_prefix, the code checks to see if the pi->attr
is non-NULL.  Since (A) we cannot have a path_info without
an attribute and (B) all paths leading up to the test
in make_prefix already have pi->attr deref'ed and the
code is not crashing we know this is safe to remove.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agotests:add topotest for EVPN aggregate prefix route 15222/head
Chirag Shah [Tue, 5 Mar 2024 04:00:29 +0000 (20:00 -0800)]
tests:add topotest for EVPN aggregate prefix route

Toptotest covers to aggregate EVPN prefix routes.

Testing:

tests/topotests/bgp_evpn_vxlan_svd_topo1$ sudo -E python3 -m pytest -s -vv --cli-on-error
PASSED
test_bgp_evpn_vxlan_svd.py::test_pe_advertise_aggr_evpn_route
--------------------- live log call -------------------------------
2024-03-04 19:59:45,340 INFO: P1: checking if daemons are running
2024-03-04 19:59:45,444 INFO: PE1: checking if daemons are running
2024-03-04 19:59:45,578 INFO: PE2: checking if daemons are running
2024-03-04 19:59:45,680 INFO: host1: checking if daemons are running
2024-03-04 19:59:45,798 INFO: host2: checking if daemons are running
2024-03-04 19:59:45,896 INFO: topo: Checking BGP EVPN route contains non-aggregate prefixes
2024-03-04 19:59:45,992 INFO: topo: Configure BGP aggregate-address summary-only under ipv4-unicast
2024-03-04 19:59:46,120 INFO: topo: Checking BGP EVPN route contains aggregated prefix
PASSED

------- generated xml file: /tmp/topotests/topotests.xml -----
======= 10 passed, 1 skipped in 47.95s =====

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agobgpd:aggr summary-only remove suppressed from evpn
Chirag Shah [Wed, 24 Jan 2024 05:52:34 +0000 (21:52 -0800)]
bgpd:aggr summary-only remove suppressed from evpn

Ticket: #3534718 #3720960
Testing Done:

Config:
router bgp 65564 vrf sym_2
 bgp router-id 27.0.0.9
 !
 address-family ipv4 unicast
  redistribute static
 exit-address-family

vrf sym_2
 vni 8889
 ip route 63.2.1.0/24 blackhole
 ip route 63.2.1.2/32 blackhole
 ip route 63.2.1.3/32 blackhole
exit-vrf

tor-1:# vtysh -c "show bgp l2vpn evpn route" | grep -A3 63.2
*> [5]:[0]:[24]:[63.2.1.0] RD 27.0.0.9:19
                    27.0.0.9 (tor-1)
                                             0         32768 ?
                    ET:8 RT:28:8889 Rmac:44:38:39:ff:ff:29
--
*> [5]:[0]:[32]:[63.2.1.2] RD 27.0.0.9:19
                    27.0.0.9 (tor-1)
                                             0         32768 ?
                    ET:8 RT:28:8889 Rmac:44:38:39:ff:ff:29
*> [5]:[0]:[32]:[63.2.1.3] RD 27.0.0.9:19
                    27.0.0.9 (tor-1)
                                             0         32768 ?
                    ET:8 RT:28:8889 Rmac:44:38:39:ff:ff:29

tor-1(config)# router bgp 65564 vrf sym_2
tor-1(config-router)# address-family ipv4 unicast
tor-1(config-router-af)# aggregate-address 63.2.0.0/16 summary-only
tor-1(config-rou-f)# end

tor-1:# vtysh -c "show bgp l2vpn evpn route" | grep -A3 63.2.1
tor-1:# vtysh -c "show bgp l2vpn evpn route" | grep -A3 63.2
*> [5]:[0]:[16]:[63.2.0.0] RD 27.0.0.9:19
                    27.0.0.9 (tor-1)
                                             0         32768 ?
                    ET:8 RT:28:8889 Rmac:44:38:39:ff:ff:29

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agoMerge pull request #15479 from opensourcerouting/fix/spelling
Russ White [Tue, 5 Mar 2024 13:48:56 +0000 (08:48 -0500)]
Merge pull request #15479 from opensourcerouting/fix/spelling

doc: Fix one spelling `dissallowed` to `disallowed`

13 months agoMerge pull request #15460 from Max-Mustermann33/route-metric-update
Russ White [Tue, 5 Mar 2024 13:45:45 +0000 (08:45 -0500)]
Merge pull request #15460 from Max-Mustermann33/route-metric-update

ospfd: Send update for route with new metric

13 months agoMerge pull request #15450 from opensourcerouting/fix/coverity
Russ White [Tue, 5 Mar 2024 13:43:28 +0000 (08:43 -0500)]
Merge pull request #15450 from opensourcerouting/fix/coverity

bgpd: Check if attributes exists for the path before checking mp_nexthop_len

13 months agolib: fix apply_finish callback in northbound 15487/head
Igor Ryzhov [Tue, 5 Mar 2024 13:30:37 +0000 (15:30 +0200)]
lib: fix apply_finish callback in northbound

When a node is top-level, we shouldn't stop the whole processing, we
should just skip this single node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15476 from donaldsharp/dplane_thread_issue_i_believe
Donatas Abraitis [Tue, 5 Mar 2024 12:53:41 +0000 (14:53 +0200)]
Merge pull request #15476 from donaldsharp/dplane_thread_issue_i_believe

zebra: fnc->obuf could be accessed without a lock

13 months agoMerge pull request #15369 from donaldsharp/fpm_stub_addition
Martin Winter [Tue, 5 Mar 2024 12:06:42 +0000 (13:06 +0100)]
Merge pull request #15369 from donaldsharp/fpm_stub_addition

Add ability to test dplane_fpm_nl.c file

13 months agodoc: Fix one spelling `dissallowed` to `disallowed` 15479/head
Donatas Abraitis [Tue, 5 Mar 2024 06:57:39 +0000 (08:57 +0200)]
doc: Fix one spelling `dissallowed` to `disallowed`

Closes: https://github.com/FRRouting/frr/issues/15465
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15470 from idryzhov/fix-darr-vsprintf
Christian Hopps [Tue, 5 Mar 2024 03:45:02 +0000 (22:45 -0500)]
Merge pull request #15470 from idryzhov/fix-darr-vsprintf

lib: fix __darr_in_vsprintf

13 months agolib: fix infinite loop in __darr_in_vsprintf 15470/head
Igor Ryzhov [Mon, 4 Mar 2024 18:41:41 +0000 (20:41 +0200)]
lib: fix infinite loop in __darr_in_vsprintf

`darr_avail` returns the available capacity excluding the already
existing terminating NULL byte. Take this into account when using
`darr_avail`. Otherwise, if the error length is a power of 2, the
capacity is never enough and the function stucks in an infinite loop.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agozebra: fnc->obuf could be accessed without a lock 15476/head
Donald Sharp [Mon, 4 Mar 2024 23:07:42 +0000 (18:07 -0500)]
zebra: fnc->obuf could be accessed without a lock

Found by coverity.  Let's just lock the writeable
amount to see if it is possible.  It's ok because
we want to know if we have room *now*.  If another
pthread runs it will only remove data from fnc->obuf
and make more room.  So this is ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agodebian: Add a frr-test-tools debian package 15369/head
Donald Sharp [Wed, 21 Feb 2024 17:50:13 +0000 (12:50 -0500)]
debian: Add a frr-test-tools debian package

This package will hold test tools that are built and useful for
developers of FRR but not useful for everyday usage of FRR.  This
is separted out because these are useful enough to have in their
own package.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agotests: Add a pytest marker for the fpm
Donald Sharp [Sat, 17 Feb 2024 22:16:29 +0000 (17:16 -0500)]
tests: Add a pytest marker for the fpm

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agotests: Add a very simple test for the dplane_fpm_nl module
Donald Sharp [Wed, 14 Feb 2024 17:45:16 +0000 (12:45 -0500)]
tests: Add a very simple test for the dplane_fpm_nl module

Ensure that the fpm module connects to the specified listener
and then ensure that 10k routes from sharpd are installed
into the system and then are removed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agotests: Add ability to run a fpm listener
Donald Sharp [Wed, 14 Feb 2024 17:41:49 +0000 (12:41 -0500)]
tests: Add ability to run a fpm listener

Add the ability to run a fpm listener to the testing
system.  This is nothing more just allowing the test
system to bring it up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agodoc: Add `show fpm status [json]` command to documentation
Donald Sharp [Wed, 14 Feb 2024 17:17:56 +0000 (12:17 -0500)]
doc: Add `show fpm status [json]` command to documentation

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: Add `show fpm status [json]` command
Donald Sharp [Wed, 14 Feb 2024 17:15:57 +0000 (12:15 -0500)]
zebra: Add `show fpm status [json]` command

Add a command to get the status of the dplane_fpm_nl
module.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agozebra: Add fpm_listener
Donald Sharp [Wed, 14 Feb 2024 21:07:45 +0000 (16:07 -0500)]
zebra: Add fpm_listener

Add a tiny fpm_listener program to allow FRR to test the
fpm.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agodoc, tools: Remove ARRAY_SIZE check
Donald Sharp [Thu, 15 Feb 2024 15:19:36 +0000 (10:19 -0500)]
doc, tools: Remove ARRAY_SIZE check

checkpatch.pl wants you to use ARRAY_SIZE in a kernel
header file.  We don't have access to this kernel header
file for normal compilation.  I'm just going to remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15467 from donaldsharp/bgp_best_selection_cleanup
Donatas Abraitis [Mon, 4 Mar 2024 11:35:35 +0000 (13:35 +0200)]
Merge pull request #15467 from donaldsharp/bgp_best_selection_cleanup

Bgp best selection cleanup

13 months agolib: fix __darr_in_vsprintf
Igor Ryzhov [Mon, 5 Feb 2024 17:04:39 +0000 (19:04 +0200)]
lib: fix __darr_in_vsprintf

If the initial darr capacity is not enough for the output, the `ap` is
reused multiple times, which is wrong, because it may be altered by
`vsnprintf`. Make a copy of `ap` each time instead of reusing.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15448 from louis-6wind/bmp-labels
Donatas Abraitis [Sun, 3 Mar 2024 18:21:17 +0000 (20:21 +0200)]
Merge pull request #15448 from louis-6wind/bmp-labels

bgpd: export labels into BMP

13 months agoMerge pull request #15458 from opensourcerouting/fix/bgpd_send_hold_timer_expired_not...
Donald Sharp [Sun, 3 Mar 2024 02:21:08 +0000 (21:21 -0500)]
Merge pull request #15458 from opensourcerouting/fix/bgpd_send_hold_timer_expired_notification_code

bgpd: Send "Send Hold Timer Expired" on such events notification

13 months agobgpd: Simplify for loop 15467/head
Donald Sharp [Sun, 25 Feb 2024 13:07:21 +0000 (08:07 -0500)]
bgpd: Simplify for loop

This for loop has no chance of removing entries so there is no
need to do a bit of complicated code to handle the case where
an entry can be removed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Allow string creation to handle NULL case
Donald Sharp [Sun, 25 Feb 2024 13:04:15 +0000 (08:04 -0500)]
bgpd: Allow string creation to handle NULL case

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Both possible paths unset a flag, so reduce
Donald Sharp [Sun, 25 Feb 2024 12:59:25 +0000 (07:59 -0500)]
bgpd: Both possible paths unset a flag, so reduce

Both paths through the code unset a flag, so reduce the
duplication.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Testing for valid pointer is done by for loop
Donald Sharp [Sun, 25 Feb 2024 12:52:25 +0000 (07:52 -0500)]
bgpd: Testing for valid pointer is done by for loop

No need to test for valid pointer as that the for loop will
do so as well.  This reduces indentation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agoMerge pull request #15461 from vjardin/ifdef_warning
Igor Ryzhov [Fri, 1 Mar 2024 21:12:03 +0000 (23:12 +0200)]
Merge pull request #15461 from vjardin/ifdef_warning

fix warning if ripngd disabled

13 months agomgmtd: fix warning if ripngd disabled 15461/head
Vincent JARDIN [Fri, 1 Mar 2024 16:27:53 +0000 (17:27 +0100)]
mgmtd: fix warning if ripngd disabled

./configure [...] --disable-ripngd

could lead to:

mgmtd/mgmt_vty.c:614:5: warning: "HAVE_RIPNGD" is not defined, evaluates to 0 [-Wundef]
  614 | #if HAVE_RIPNGD
      |     ^~~~~~~~~~~

Signed-off-by: Vincent Jardin <vjardin@free.fr>
13 months agoMerge pull request #15449 from sri-mohan1/srib-24-zebra
Mark Stapp [Fri, 1 Mar 2024 14:22:40 +0000 (09:22 -0500)]
Merge pull request #15449 from sri-mohan1/srib-24-zebra

zebra: changes for code maintainability

13 months agoospfd: Send update for route with new metric 15460/head
Alexander Rose [Fri, 1 Mar 2024 12:02:02 +0000 (13:02 +0100)]
ospfd: Send update for route with new metric

When an AS-external-route is deleted on our system and later added again
with a new metric, then the ospfd would first send a LS-update to remove
the old route and later another LS-update to add the route with the new
metric again.
But when this metric-change happens with no time inbetween the ospfd
recognizes this as the same route and does not send any LS-update.
With the change made here, the ospfd will interpret this route as a
different route, when the metric has changed.

Signed-off-by: Alexander Rose <alexander.rose@secunet.com>
13 months agotopotests: apply black on bmp collector 15448/head
Louis Scalbert [Thu, 29 Feb 2024 15:53:32 +0000 (16:53 +0100)]
topotests: apply black on bmp collector

Apply black on bmp collector

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotopotests: bgp_bmp, test presence of labels
Louis Scalbert [Tue, 27 Feb 2024 18:05:36 +0000 (19:05 +0100)]
topotests: bgp_bmp, test presence of labels

Test the presence of labels in BMP

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agobgpd: add labeled vpn bmp monitoring support
Farid Mihoub [Thu, 1 Jun 2023 12:40:40 +0000 (14:40 +0200)]
bgpd: add labeled vpn bmp monitoring support

Support BMP monitoring for the BGP labeled VPN prefixes.

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotopotests: bgp_bmp, log bmp into tgen logdir
Louis Scalbert [Tue, 27 Feb 2024 17:29:09 +0000 (18:29 +0100)]
topotests: bgp_bmp, log bmp into tgen logdir

Log BMP into tgen logdir to facilitate the debug.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotopotests: bgp_bmp, add vpn tests
Louis Scalbert [Tue, 27 Feb 2024 14:42:16 +0000 (15:42 +0100)]
topotests: bgp_bmp, add vpn tests

Test vpn prefixes sending to BMP

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotopotests: bgp_bmp, use test ip range
Louis Scalbert [Tue, 27 Feb 2024 13:40:57 +0000 (14:40 +0100)]
topotests: bgp_bmp, use test ip range

Use standard test ip range in bgp_bmp topotest

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agobgpd: Send "Send Hold Timer Expired" on such events notification 15458/head
Donatas Abraitis [Thu, 29 Feb 2024 13:37:53 +0000 (15:37 +0200)]
bgpd: Send "Send Hold Timer Expired" on such events notification

This is required by the current (latest/-02 draft).

IANA has registered code 8 for "Send Hold Timer Expired" in the "BGP
Error (Notification) Codes" sub-registry under the "Border Gateway
Protocol (BGP) Parameters" registry.

https://datatracker.ietf.org/doc/html/draft-ietf-idr-bgp-sendholdtimer

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #14775 from adrianomarto/test_ospfd_single_switch2
Donatas Abraitis [Thu, 29 Feb 2024 08:36:54 +0000 (10:36 +0200)]
Merge pull request #14775 from adrianomarto/test_ospfd_single_switch2

tests: multiple OSPF routers connected to a single switch

14 months agoMerge pull request #14898 from chiragshah6/mdev
Donatas Abraitis [Thu, 29 Feb 2024 07:26:13 +0000 (09:26 +0200)]
Merge pull request #14898 from chiragshah6/mdev

tools: fix frr-reload for nbr deletion

14 months agoMerge pull request #15368 from louis-6wind/fix-6pe
Donatas Abraitis [Wed, 28 Feb 2024 09:34:43 +0000 (11:34 +0200)]
Merge pull request #15368 from louis-6wind/fix-6pe

bgpd: fix 6vpe nexthop

14 months agoMerge pull request #15446 from mjstapp/fix_config_typo
Donatas Abraitis [Wed, 28 Feb 2024 09:34:06 +0000 (11:34 +0200)]
Merge pull request #15446 from mjstapp/fix_config_typo

tools: fix typo in configure script

14 months agoMerge pull request #15447 from louis-6wind/bmp-safi
Donatas Abraitis [Wed, 28 Feb 2024 09:33:35 +0000 (11:33 +0200)]
Merge pull request #15447 from louis-6wind/bmp-safi

bmp: fix vty_out for monitor afi loc-rib

14 months agozebra: changes for code maintainability 15449/head
sri-mohan1 [Wed, 28 Feb 2024 04:45:06 +0000 (10:15 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agobgpd: Check if attributes exists for the path before checking mp_nexthop_len 15450/head
Donatas Abraitis [Wed, 28 Feb 2024 06:26:25 +0000 (08:26 +0200)]
bgpd: Check if attributes exists for the path before checking mp_nexthop_len

CID: 1583901

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobmp: fix vty_out for monitor afi loc-rib 15447/head
Farid Mihoub [Thu, 8 Jun 2023 13:37:10 +0000 (15:37 +0200)]
bmp: fix vty_out for monitor afi loc-rib

"show run" displays BMP monitor AFI in upper case.

> bmp targets bmp1
>  bmp monitor IPv4 unicast loc-rib

Display it in lower case.

> bmp targets bmp1
>  bmp monitor ipv4 unicast loc-rib

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotools: fix typo in configure script 15446/head
Mark Stapp [Tue, 27 Feb 2024 17:36:38 +0000 (12:36 -0500)]
tools: fix typo in configure script

Fix a small typo nit in the configure script.

Signed-off-by: Mark Stapp <mjs@cisco.com>
14 months agoMerge pull request #13721 from pguibert6WIND/route_target_wrong_display
Russ White [Tue, 27 Feb 2024 17:01:45 +0000 (12:01 -0500)]
Merge pull request #13721 from pguibert6WIND/route_target_wrong_display

bgpd: fix route-target display with as dotted format

14 months agoMerge pull request #15438 from opensourcerouting/fix/doc_release_reference_table
Russ White [Tue, 27 Feb 2024 17:01:29 +0000 (12:01 -0500)]
Merge pull request #15438 from opensourcerouting/fix/doc_release_reference_table

doc: Update dates in release reference table

14 months agoMerge pull request #15399 from louis-6wind/fix-macvlan-crash
Donatas Abraitis [Tue, 27 Feb 2024 16:31:28 +0000 (18:31 +0200)]
Merge pull request #15399 from louis-6wind/fix-macvlan-crash

zebra: fix crash when macvlan link-interface is in another netns

14 months agoMerge pull request #15431 from Orange-OpenSource/ospf-te
Donatas Abraitis [Tue, 27 Feb 2024 15:41:19 +0000 (17:41 +0200)]
Merge pull request #15431 from Orange-OpenSource/ospf-te

ospfd: Solved crash in OSPF TE parsing

14 months agoMerge pull request #14810 from dmytroshytyi-6WIND/srv6_bgp_sid_reachability
Russ White [Tue, 27 Feb 2024 15:32:14 +0000 (10:32 -0500)]
Merge pull request #14810 from dmytroshytyi-6WIND/srv6_bgp_sid_reachability

SRv6 BGP SID reachability

14 months agoMerge pull request #15273 from opensourcerouting/feature/paths_limit_capability
Russ White [Tue, 27 Feb 2024 15:24:05 +0000 (10:24 -0500)]
Merge pull request #15273 from opensourcerouting/feature/paths_limit_capability

bgpd: Implement Paths-Limit capability

14 months agobgpd: fix route-target display with as dotted format 13721/head
Philippe Guibert [Wed, 7 Jun 2023 15:26:52 +0000 (17:26 +0200)]
bgpd: fix route-target display with as dotted format

The following command results in a wrong route-target
display:
> # show running-config
> [..]
> route-map rmap permit 1
>  set extcommunity rt 1.45:55
> exit
> router bgp 1.45 as-notation plain
> neighbor 192.0.2.1 remote-as 65500
> address-family ipv4 unicast
> network 192.0.2.2/32 route-map rmap
>

Observed output:

> # show bgp ipv4 192.0.2.2/32
> [..]
>     Extended Community: RT:1.0.0.45:55
>

The decoding of the passed cli string assumes this is an
IP address, whereas it is an AS number in dotted format.
Consequently, the vty output will use the ip address encoding.

Count the number of dots in the extended community format.
If a single dot number is detected, the AS format is passed,
and used by the vty output.

After fix:

>
> # show bgp ipv4 192.0.2.2/32
> [..]
>    Extended Community: RT:65581:55
>

For remind, AS 65581 and AS 1.45 are a unique AS number.

> show bgp neighbor
> BGP neighbor is 192.0.2.1, remote AS 65500, local AS 65581, external link
> [..]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agodoc: Update dates in release reference table 15438/head
Donatas Abraitis [Tue, 27 Feb 2024 12:54:16 +0000 (14:54 +0200)]
doc: Update dates in release reference table

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15427 from idryzhov/fix-filter-nb-update
Donatas Abraitis [Tue, 27 Feb 2024 11:39:05 +0000 (13:39 +0200)]
Merge pull request #15427 from idryzhov/fix-filter-nb-update

lib: fix access/prefix-list entry update

14 months agoMerge pull request #15429 from sri-mohan1/srib-24-zebra
Donatas Abraitis [Tue, 27 Feb 2024 11:37:38 +0000 (13:37 +0200)]
Merge pull request #15429 from sri-mohan1/srib-24-zebra

zebra: changes for code maintainability

14 months agoospfd: Solved crash in OSPF TE parsing 15431/head
Olivier Dugeon [Mon, 26 Feb 2024 09:40:34 +0000 (10:40 +0100)]
ospfd: Solved crash in OSPF TE parsing

Iggy Frankovic discovered an ospfd crash when perfomring fuzzing of OSPF LSA
packets. The crash occurs in ospf_te_parse_te() function when attemping to
create corresponding egde from TE Link parameters. If there is no local
address, an edge is created but without any attributes. During parsing, the
function try to access to this attribute fields which has not been created
causing an ospfd crash.

The patch simply check if the te parser has found a valid local address. If not
found, we stop the parser which avoid the crash.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoMerge pull request #15387 from fdumontet6WIND/frr_aspath_excl_bp1
Donatas Abraitis [Tue, 27 Feb 2024 07:52:23 +0000 (09:52 +0200)]
Merge pull request #15387 from fdumontet6WIND/frr_aspath_excl_bp1

bgpd: fix no bgp as-path access-list issue

14 months agoMerge pull request #15339 from opensourcerouting/fix/add_deprecation
Russ White [Mon, 26 Feb 2024 19:59:17 +0000 (14:59 -0500)]
Merge pull request #15339 from opensourcerouting/fix/add_deprecation

ospfd: Add deprecation cycle for `router-info X [A.B.C.D]` command

14 months agoMerge pull request #15430 from idryzhov/fix-ly-log
Donald Sharp [Mon, 26 Feb 2024 15:26:13 +0000 (10:26 -0500)]
Merge pull request #15430 from idryzhov/fix-ly-log

lib: fix setting temporary log options for libyang

14 months agobgpd: fix no bgp as-path access-list issue 15387/head
Francois Dumontet [Fri, 16 Feb 2024 14:31:14 +0000 (15:31 +0100)]
bgpd: fix no bgp as-path access-list  issue

router bgp 65001
 no bgp ebgp-requires-policy
 neighbor 192.168.1.2 remote-as external
 neighbor 192.168.1.2 timers 3 10
 address-family ipv4 unicast
  neighbor 192.168.1.2 route-map r2 in
 exit-address-family
!
ip prefix-list p1 seq 5 permit 172.16.255.31/32
!
route-map r2 permit 10
 match ip address prefix-list p1
 set as-path exclude 65003
route-map r2 permit 20
 set as-path exclude all
!

we make the following commands

bgp as-path access-list FIRST permit ^65
bgp as-path access-list SECOND permit 2
 route-map r2 permit 6
  set as-path exclude as-path-access-list SECOND

and then

no bgp as-path access-list SECOND permit 2
clear bgp *

we have the following crash in bgp

               Stack trace of thread 536083:
                #0  0x00007f87f8aacfe1 raise (libpthread.so.0 + 0x12fe1)
                #1  0x00007f87f8cf6870 core_handler (libfrr.so.0 +
    0xf6870)
                #2  0x00007f87f8aad140 __restore_rt (libpthread.so.0 +
    0x13140)
                #3  0x00007f87f89a5122 __GI___regexec (libc.so.6 +
    0xdf122)
                #4  0x000055d7f198b4a7 aspath_filter_exclude_acl (bgpd +
    0x2054a7)
                #5  0x000055d7f1902187 route_set_aspath_exclude (bgpd +
    0x17c187)
                #6  0x00007f87f8ce54b0 route_map_apply_ext (libfrr.so.0
    + 0xe54b0)
                #7  0x000055d7f18da925 bgp_input_modifier (bgpd +
    0x154925)
                #8  0x000055d7f18e0647 bgp_update (bgpd + 0x15a647)
                #9  0x000055d7f18e4772 bgp_nlri_parse_ip (bgpd +
    0x15e772)
                #10 0x000055d7f18c38ae bgp_nlri_parse (bgpd + 0x13d8ae)
                #11 0x000055d7f18c6b7a bgp_update_receive (bgpd +
    0x140b7a)
                #12 0x000055d7f18c8ff3 bgp_process_packet (bgpd +
    0x142ff3)
                #13 0x00007f87f8d0dce0 thread_call (libfrr.so.0 +
    0x10dce0)
                #14 0x00007f87f8cacb28 frr_run (libfrr.so.0 + 0xacb28)
                #15 0x000055d7f18435da main (bgpd + 0xbd5da)
                #16 0x00007f87f88e9d0a __libc_start_main (libc.so.6 +
    0x23d0a)
                #17 0x000055d7f18415fa _start (bgpd + 0xbb5fa)

analysis

crash is due to the fact that there were always a pointer from
as-path exclude to deleted as-path access list.

fix
we add a backpointer mechanism to manage the dependency beetween
as-path access-list  and aspath exclude.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
14 months agotests: extend tests for aspath exclude
Francois Dumontet [Wed, 14 Feb 2024 16:13:40 +0000 (17:13 +0100)]
tests: extend tests for aspath exclude

adding a tests about:
"no bgp as-path access-list" command.

the folloxing "clear bgp *" command leads to the
crash exhibited above.

a sleep had been added to capture the crash befor the end of scenario.

50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5f05cbb9c0 (LWP 1371086))]
(gdb) bt
    context=0x7ffcf2c216c0) at lib/sigevent.c:248
    acl_list=0x55c976ec03c0) at bgpd/bgp_aspath.c:1688
    dummy=0x7ffcf2c22340, object=0x7ffcf2c21e70) at bgpd/bgp_routemap.c:2401
    match_object=0x7ffcf2c21e70, set_object=0x7ffcf2c21e70, pref=0x0)
    at lib/routemap.c:2687
    attr=0x7ffcf2c220b0, afi=AFI_IP, safi=SAFI_UNICAST, rmap_name=0x0, label=0x0,
    num_labels=0, dest=0x55c976ebeaf0) at bgpd/bgp_route.c:1807
    addpath_id=0, attr=0x7ffcf2c22450, afi=AFI_IP, safi=SAFI_UNICAST, type=10,
    sub_type=0, prd=0x0, label=0x0, num_labels=0, soft_reconfig=0, evpn=0x0)
    at bgpd/bgp_route.c:4424
    packet=0x7ffcf2c22410) at bgpd/bgp_route.c:6266
    packet=0x7ffcf2c22410, mp_withdraw=false) at bgpd/bgp_packet.c:341
    peer=0x55c976e89ed0, size=43) at bgpd/bgp_packet.c:2414
    at bgpd/bgp_packet.c:3899

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
14 months agolib: fix setting temporary log options for libyang 15430/head
Igor Ryzhov [Mon, 26 Feb 2024 09:30:57 +0000 (11:30 +0200)]
lib: fix setting temporary log options for libyang

By calling `ly_log_options` with `LY_LOSTORE`, the current code
effectively disables libyang logging and never enables it back. The call
is done to get the current logging options, but we don't really need
that. When looking for a schema node, we don't want neither to log nor
to store the error, so simply set the temporary options to 0.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agobgpd: fix 6vpe nexthop 15368/head
Louis Scalbert [Thu, 15 Feb 2024 12:28:02 +0000 (13:28 +0100)]
bgpd: fix 6vpe nexthop

6vPE enables the announcement of IPv6 VPN prefixes through an IPv4 BGP
session. In this scenario, the next hop addresses for these prefixes are
represented in an IPv4-mapped IPv6 format, noted as ::ffff:[IPv4]. This
format indicates to the peer that it should route these IPv6 addresses
using information from the IPv4 nexthop. For example:

> Path Attribute - MP_REACH_NLRI
> [...]
>     Address family identifier (AFI): IPv6 (2)
>     Subsequent address family identifier (SAFI): Labeled VPN Unicast (128)
>     Next hop:  RD=0:0 IPv6=::ffff:192.0.2.5 RD=0:0 Link-local=fe80::501d:42ff:feef:b021
>     Number of Subnetwork points of attachment (SNPA): 0

This rule is set out in RFC4798:

> The IPv4 address of the egress 6PE router MUST be encoded as an
> IPv4-mapped IPv6 address in the BGP Next Hop field.

However, in some situations, bgpd sends a standard nexthop IPv6 address
instead of an IPv4-mapped IPv6 address because the outgoing interface for
the BGP session has a valid IPv6 address. This is problematic because
the peer router may not be able to route the nexthop IPv6 address (ie.
if the outgoing interface has not IPv6).

Fix the issue by always sending a IPv4-mapped IPv6 address as nexthop
when the BGP session is on IPv4 and address family IPv6.

Link: https://datatracker.ietf.org/doc/html/rfc4798#section-2
Fixes: 92d6f76 ("lib,zebra,bgpd: Fix for nexthop as IPv4 mapped IPv6 address")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotopotests: add an ebgp 6vpe test
Philippe Guibert [Mon, 13 Mar 2023 09:47:16 +0000 (10:47 +0100)]
topotests: add an ebgp 6vpe test

This test uses the connected ipv4 mapped ipv6 prefix
to resolve the received BGP routes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: François Dumontet <francois.dumontet@6wind.com>
14 months agozebra: changes for code maintainability 15429/head
sri-mohan1 [Mon, 26 Feb 2024 08:51:12 +0000 (14:21 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #15426 from idryzhov/bgp-rmap-yang
Donatas Abraitis [Mon, 26 Feb 2024 07:44:20 +0000 (09:44 +0200)]
Merge pull request #15426 from idryzhov/bgp-rmap-yang

bgpd, yang: fix missing mandatory/default statements on some leafs

14 months agolib: fix prefix-list entry update 15427/head
Igor Ryzhov [Sun, 25 Feb 2024 23:00:17 +0000 (01:00 +0200)]
lib: fix prefix-list entry update

When a prefix-list entry is updated, current NB code calls the
replacement code multiple times, once per each updated field. It means
that when multiple fields of an entry are changed in a single commit,
the replacement is done with an interim state of a prefix-list instead
of a final one. To fix the issue, we should call the replacement code
once, after all fields of an entry are updated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: fix access-list entry update
Igor Ryzhov [Sun, 25 Feb 2024 21:12:14 +0000 (23:12 +0200)]
lib: fix access-list entry update

When an access-list entry is updated, current NB code calls notification
hooks for each updated field. It means that when multiple fields of an
entry are changed in a single commit, the hooks are run with an interim
state of an access-list instead of a final one. To fix the issue, we
should call the hooks once, after all fields of an entry are updated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agobgpd, yang: fix missing mandatory/default statements on some leafs 15426/head
Igor Ryzhov [Sun, 25 Feb 2024 19:50:41 +0000 (21:50 +0200)]
bgpd, yang: fix missing mandatory/default statements on some leafs

The code expects these leafs to always exist. If they are not set, the
daemon would crash. CLI always sets them, but we should properly mark
them as mandatory/default to prevent them from being missed when using
the API.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15423 from idryzhov/fix-nb-choice
Christian Hopps [Sun, 25 Feb 2024 21:54:16 +0000 (16:54 -0500)]
Merge pull request #15423 from idryzhov/fix-nb-choice

lib: fix processing of choices in northbound

14 months agotests: add test for required choice/np-container callbacks 15423/head
Christian Hopps [Sun, 25 Feb 2024 04:24:05 +0000 (23:24 -0500)]
tests: add test for required choice/np-container callbacks

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: add test for northbound ordering fix
Christian Hopps [Sun, 25 Feb 2024 02:39:30 +0000 (21:39 -0500)]
tests: add test for northbound ordering fix

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: fix nb callbacks for containers inside choice case
Igor Ryzhov [Fri, 23 Feb 2024 22:06:41 +0000 (00:06 +0200)]
lib: fix nb callbacks for containers inside choice case

Containers inside a choice's case must be treated as presence containers
as they can be explicitly created and deleted. They must have `create`
and `destroy` callbacks, otherwise the internal data they represent may
never be deleted.

The issue can be reproduced with the following steps:
- create an access-list with destination-network params
  ```
  # access-list test seq 1 permit ip any 10.10.10.0 0.0.0.255
  ```
- delete the `destination-network` container
  ```
  # mgmt delete-config /frr-filter:lib/access-list[name='test'][type='ipv4']/entry[sequence='1']/destination-network
  # mgmt commit apply
  MGMTD: No changes found to be committed!
  ```

As the `destination-network` container is non-presence, and all its
leafs are mandatory, mgmtd doesn't see any changes to be commited and
simply updates its YANG data tree without passing any updates to backend
daemons.

This commit fixes the issue by requiring `create` and `destroy`
callbacks for containers inside choice's cases.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: fix order of northbound operations
Igor Ryzhov [Fri, 23 Feb 2024 19:14:26 +0000 (21:14 +0200)]
lib: fix order of northbound operations

When ordering operations, destroys must always come before other
operations, to correctly cover the change of a "case" in a "choice".

The problem can be reproduced with the following commands:
```
access-list test seq 1 permit 10.0.0.0/8
access-list test seq 1 permit host 10.0.0.1
access-list test seq 1 permit 10.0.0.0/8
```

Before this commit, the order of changes would be the following:
- `access-list test seq 1 permit 10.0.0.0/8`
  - `modify` for `ipv4-prefix`
- `access-list test seq 1 permit host 10.0.0.1`
  - `destroy` for `ipv4-prefix`
  - `modify` for `host`
- `access-list test seq 1 permit 10.0.0.0/8`
  - `modify` for `ipv4-prefix`
  - `destroy` for `host`

As `destroy` for `host` is called last, it rewrites the fields that were
filled by `modify` callback of `ipv4-prefix`. This commit fixes this
problem by always calling `destroy` callbacks first.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15421 from idryzhov/fix-fe-client-notify
Christian Hopps [Fri, 23 Feb 2024 21:29:25 +0000 (16:29 -0500)]
Merge pull request #15421 from idryzhov/fix-fe-client-notify

lib: fix processing of notifications on mgmt fe client

14 months agolib: fix processing of notifications on mgmt fe client 15421/head
Igor Ryzhov [Fri, 23 Feb 2024 16:53:46 +0000 (18:53 +0200)]
lib: fix processing of notifications on mgmt fe client

Notifications are sent by mgmtd for each session of a client, so they
should be processed once per each session.

Also, add session_id parameter to an async_notification callback as all
other callbacks have this parameter.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15405 from LabNConsulting/chopps/fix-fe-client
Donald Sharp [Fri, 23 Feb 2024 14:47:46 +0000 (09:47 -0500)]
Merge pull request #15405 from LabNConsulting/chopps/fix-fe-client

tests: use more standard name for python3

14 months agoMerge pull request #15410 from louis-6wind/optim-nhflags
Donatas Abraitis [Fri, 23 Feb 2024 08:18:15 +0000 (10:18 +0200)]
Merge pull request #15410 from louis-6wind/optim-nhflags

bgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags

14 months agoMerge pull request #15406 from donaldsharp/evpn_mh_fix
Donatas Abraitis [Fri, 23 Feb 2024 08:04:50 +0000 (10:04 +0200)]
Merge pull request #15406 from donaldsharp/evpn_mh_fix

tests: bgp_evpn_mh timing issue fix

14 months agoMerge pull request #15384 from louis-6wind/isis-show-all-algos
Donatas Abraitis [Fri, 23 Feb 2024 07:51:13 +0000 (09:51 +0200)]
Merge pull request #15384 from louis-6wind/isis-show-all-algos

isisd: display all the algorithms at the same time

14 months agoMerge pull request #15383 from donaldsharp/cpp_evpn_data
Donatas Abraitis [Fri, 23 Feb 2024 07:49:15 +0000 (09:49 +0200)]
Merge pull request #15383 from donaldsharp/cpp_evpn_data

zebra: Remove deprecated items

14 months agoMerge pull request #15409 from sri-mohan1/srib-24-zebra-dpdk-dp
Donald Sharp [Thu, 22 Feb 2024 18:47:30 +0000 (13:47 -0500)]
Merge pull request #15409 from sri-mohan1/srib-24-zebra-dpdk-dp

zebra: changes for code maintainability

14 months agobgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags 15410/head
Louis Scalbert [Fri, 29 Apr 2022 17:41:57 +0000 (19:41 +0200)]
bgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags

Move mp_nexthop_prefer_global boolean attribute to nh_flags. It does
not currently save memory because of the packing.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agozebra: changes for code maintainability 15409/head
sri-mohan1 [Thu, 22 Feb 2024 05:03:47 +0000 (10:33 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agotests: bgp_evpn_mh timing issue fix 15406/head
Donald Sharp [Wed, 21 Feb 2024 23:12:00 +0000 (18:12 -0500)]
tests: bgp_evpn_mh timing issue fix

This test is failing locally for me 100% of the time
since zebra was converted to mgmtd usage.  The failed
command is:

torm11# show evpn mac vni 1000 mac 00:00:00:00:00:11 json
{
  "00:00:00:00:00:11":{
    "type":"auto",
    "uptime":"00:02:01",
    "localSequence":0,
    "remoteSequence":0,
    "detectionCount":0,
    "isDuplicate":false,
    "syncNeighCount":0,
    "neighbors":{
      "active":[
      ],
      "inactive":[
        "45.0.0.11"
      ]
    }
  }
}

The test is expecting an esi as a key in the output.  Re-arranging
the startup of the tor's before the hosts fixes the issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: fix crash if macvlan link in another netns 15399/head
Louis Scalbert [Tue, 20 Feb 2024 16:49:01 +0000 (17:49 +0100)]
zebra: fix crash if macvlan link in another netns

A macvlan interface can have its underlying link-interface in another
namespace (aka. netns). However, by default, zebra does not know the
interface from the other namespaces. It results in a crash the pointer
to the link interface is NULL.

> 6  0x0000559d77a329d3 in zebra_vxlan_macvlan_up (ifp=0x559d798b8e00) at /root/frr/zebra/zebra_vxlan.c:4676
> 4676 link_zif = link_ifp->info;
> (gdb) list
> 4671 struct interface *link_ifp, *link_if;
> 4672
> 4673 zif = ifp->info;
> 4674 assert(zif);
> 4675 link_ifp = zif->link;
> 4676 link_zif = link_ifp->info;
> 4677 assert(link_zif);
> 4678
> (gdb) p zif->link
> $2 = (struct interface *) 0x0
> (gdb) p zif->link_ifindex
> $3 = 15

Fix the crash by returning when the macvlan link-interface is in another
namespace. No need to go further because any vxlan under the macvlan
interface would not be accessible by zebra.

Link: https://github.com/FRRouting/frr/issues/15370
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>