Commit Graph

35150 Commits

Author SHA1 Message Date
Donatas Abraitis
bb5a2a9375
Merge pull request #15489 from idryzhov/vty-mgmt-error
vty: change output of errors from mgmtd
2024-03-06 08:43:16 +02:00
Donatas Abraitis
7338aa601c
Merge pull request #15492 from donaldsharp/no_vrfs
tests: test invokes a script which does not exist
2024-03-06 08:42:37 +02:00
Donald Sharp
3a78d75cd5 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>
2024-03-05 15:55:07 -05:00
Donatas Abraitis
ffab0d7fbc
Merge pull request #15222 from chiragshah6/fdev2
bgpd:aggr summary-only remove suppressed from evpn
2024-03-05 22:36:30 +02:00
Russ White
ac34badf71
Merge pull request #15397 from idryzhov/zebra-oper
zebra: oper data additions
2024-03-05 11:41:35 -05:00
Igor Ryzhov
1853ccdb0f 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>
2024-03-05 17:56:21 +02:00
Donald Sharp
a9c16a0a89 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>
2024-03-05 10:37:48 -05:00
Chirag Shah
f345460b7e 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>
2024-03-05 07:03:39 -08:00
Chirag Shah
5cb7712b3e 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>
2024-03-05 07:03:39 -08:00
Russ White
cf4d838e69
Merge pull request #15479 from opensourcerouting/fix/spelling
doc: Fix one spelling `dissallowed` to `disallowed`
2024-03-05 08:48:56 -05:00
Russ White
0bc1c70f65
Merge pull request #15460 from Max-Mustermann33/route-metric-update
ospfd: Send update for route with new metric
2024-03-05 08:45:45 -05:00
Russ White
018fad7806
Merge pull request #15450 from opensourcerouting/fix/coverity
bgpd: Check if attributes exists for the path before checking mp_nexthop_len
2024-03-05 08:43:28 -05:00
Igor Ryzhov
8287fbe453 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>
2024-03-05 15:30:37 +02:00
Donatas Abraitis
fa5acd5a16
Merge pull request #15476 from donaldsharp/dplane_thread_issue_i_believe
zebra: fnc->obuf could be accessed without a lock
2024-03-05 14:53:41 +02:00
Martin Winter
a44918640f
Merge pull request #15369 from donaldsharp/fpm_stub_addition
Add ability to test dplane_fpm_nl.c file
2024-03-05 13:06:42 +01:00
Donatas Abraitis
e993ba1812 doc: Fix one spelling dissallowed to disallowed
Closes: https://github.com/FRRouting/frr/issues/15465

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-03-05 08:57:39 +02:00
Christian Hopps
21aa86319c
Merge pull request #15470 from idryzhov/fix-darr-vsprintf
lib: fix __darr_in_vsprintf
2024-03-04 22:45:02 -05:00
Christian Hopps
f47abbe1cb tests: add test for keychain send-accept times
Also uses oper state `active` node to test.

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-04 20:00:15 -05:00
Christian Hopps
4caffbda8e lib: add keychain northbound support
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-04 20:00:15 -05:00
Igor Ryzhov
cb6032d6b3 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>
2024-03-05 02:08:30 +02:00
Donald Sharp
e7a1fbbcf6 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>
2024-03-04 18:08:06 -05:00
Donald Sharp
0beabd76e5 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>
2024-03-04 11:06:35 -05:00
Donald Sharp
c12f88cf66 tests: Add a pytest marker for the fpm
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-04 11:06:35 -05:00
Donald Sharp
5ca133e070 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>
2024-03-04 11:06:35 -05:00
Donald Sharp
841d50e82f 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>
2024-03-04 11:06:35 -05:00
Donald Sharp
a0c4fe2ca6 doc: Add show fpm status [json] command to documentation
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-04 11:06:35 -05:00
Donald Sharp
0a9e8ef491 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>
2024-03-04 11:06:35 -05:00
Donald Sharp
fef93e6149 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>
2024-03-04 11:06:35 -05:00
Donald Sharp
852a74807f 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>
2024-03-04 11:03:46 -05:00
Donatas Abraitis
c256a9a40a
Merge pull request #15467 from donaldsharp/bgp_best_selection_cleanup
Bgp best selection cleanup
2024-03-04 13:35:35 +02:00
Igor Ryzhov
ee0c1cc1e4 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>
2024-03-04 02:24:26 +02:00
Christian Hopps
29dba445b4 lib: add automatic xpath-based completion
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-03 17:59:36 -05:00
Christian Hopps
3fa5a77def yang: modify standard model
We need to operate w/o cryptographic algorithm during key creation
due to how our legacy CLI works (each command issuing a single YANG
modification).

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-03 17:59:36 -05:00
Donatas Abraitis
9feb1aab76
Merge pull request #15448 from louis-6wind/bmp-labels
bgpd: export labels into BMP
2024-03-03 20:21:17 +02:00
Donald Sharp
0186c94ce6
Merge pull request #15458 from opensourcerouting/fix/bgpd_send_hold_timer_expired_notification_code
bgpd: Send "Send Hold Timer Expired" on such events notification
2024-03-02 21:21:08 -05:00
Donald Sharp
0a8dfbec45 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>
2024-03-02 21:05:46 -05:00
Donald Sharp
f9c86734e5 bgpd: Allow string creation to handle NULL case
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-03-02 21:05:46 -05:00
Donald Sharp
4d307c9914 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>
2024-03-02 21:05:46 -05:00
Donald Sharp
b56758dae8 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>
2024-03-02 21:05:46 -05:00
Igor Ryzhov
1d67a6e0bf
Merge pull request #15461 from vjardin/ifdef_warning
fix warning if ripngd disabled
2024-03-01 23:12:03 +02:00
Christian Hopps
0f6538263d yang: Add initial model and generated code.
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-01 13:12:23 -05:00
Vincent JARDIN
717b3350bb 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>
2024-03-01 17:36:15 +01:00
Mark Stapp
e3bc6e39e4
Merge pull request #15449 from sri-mohan1/srib-24-zebra
zebra: changes for code maintainability
2024-03-01 09:22:40 -05:00
Alexander Rose
561ad925e9 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>
2024-03-01 13:10:43 +01:00
Louis Scalbert
9208e16e25 topotests: apply black on bmp collector
Apply black on bmp collector

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-02-29 16:55:02 +01:00
Louis Scalbert
a5da98ae1a topotests: bgp_bmp, test presence of labels
Test the presence of labels in BMP

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-02-29 16:55:02 +01:00
Farid Mihoub
d9ce12cd3f 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>
2024-02-29 16:55:02 +01:00
Louis Scalbert
0c7beb31d4 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>
2024-02-29 16:55:02 +01:00
Louis Scalbert
55586065c8 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>
2024-02-29 16:55:02 +01:00
Louis Scalbert
8d3546f669 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>
2024-02-29 16:55:02 +01:00