]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
7 months agotests: fix prefix length in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 11:54:36 +0000 (13:54 +0200)]
tests: fix prefix length in nhrp_redundancy

The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP
client 1 nhc1 (aka. r5) are not reachable via NHRP.

The issue was not seen in the FRR official CI because the tests were
skipped because iptables were missing in CI machines.

It solves the 16690 issue.

Fixes: https://github.com/FRRouting/frr/issues/16690
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agoMerge pull request #16689 from donaldsharp/blackhole_and_afi
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 02:13:03 +0000 (22:13 -0400)]
Merge pull request #16689 from donaldsharp/blackhole_and_afi

Blackhole and afi

8 months agoMerge pull request #16692 from donaldsharp/zebra_avoid_ng_null
Jafar Al-Gharaibeh [Fri, 30 Aug 2024 02:11:03 +0000 (22:11 -0400)]
Merge pull request #16692 from donaldsharp/zebra_avoid_ng_null

zebra: Convince SA that the ng will always be valid

8 months agozebra: Convince SA that the ng will always be valid 16692/head
Donald Sharp [Thu, 29 Aug 2024 22:10:30 +0000 (18:10 -0400)]
zebra: Convince SA that the ng will always be valid

There is a code path that could theoretically get you
to a point where the ng->nexthop is a NULL value.
Let's just make sure the SA system believes that
cannot happen anymore.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16687 from Jafaral/isis-test-fix
Donald Sharp [Thu, 29 Aug 2024 19:10:54 +0000 (15:10 -0400)]
Merge pull request #16687 from Jafaral/isis-test-fix

tests: increase the timeout for packet padding check

8 months agozebra: Allow blackhole singleton nexthops to be v6 16689/head
Donald Sharp [Thu, 29 Aug 2024 19:06:31 +0000 (15:06 -0400)]
zebra: Allow blackhole singleton nexthops to be v6

A blackhole nexthop, according to the linux kernel,
can be v4 or v6.  A v4 blackhole nexthop cannot be
used on a v6 route, but a v6 blackhole nexthop can
be used with a v4 route.  Convert all blackhole
singleton nexthops to v6 and just use that.
Possibly reducing the number of active nexthops by 1.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Display afi of the nexthop hash entry
Donald Sharp [Thu, 29 Aug 2024 18:49:36 +0000 (14:49 -0400)]
zebra: Display afi of the nexthop hash entry

Let's display the afi of the nexthop hash entry.  Right
now it is impossible to tell the difference between v4 or
v6 nexthops, especially since it is important for the kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: increase the timeout for packet padding check 16687/head
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 16:40:50 +0000 (11:40 -0500)]
tests: increase the timeout for packet padding check

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16664 from mjstapp/igor_debug_simplify
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 15:51:53 +0000 (11:51 -0400)]
Merge pull request #16664 from mjstapp/igor_debug_simplify

*: simplify frrlib debug

8 months agoMerge pull request #16685 from opensourcerouting/fix/document_reverts
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 15:39:27 +0000 (11:39 -0400)]
Merge pull request #16685 from opensourcerouting/fix/document_reverts

doc: Document the git revert flow

8 months agoMerge pull request #16680 from donaldsharp/route_scale_minor_changes
Mark Stapp [Thu, 29 Aug 2024 12:17:34 +0000 (08:17 -0400)]
Merge pull request #16680 from donaldsharp/route_scale_minor_changes

tests: Fix route-scale at higher ecmp

8 months agodoc: Document the git revert flow 16685/head
Donatas Abraitis [Thu, 29 Aug 2024 06:04:28 +0000 (09:04 +0300)]
doc: Document the git revert flow

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16683 from donaldsharp/test_ospf_netns_vrf_failure
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 05:12:40 +0000 (01:12 -0400)]
Merge pull request #16683 from donaldsharp/test_ospf_netns_vrf_failure

tests: ospf_netns_vrf should give more time for coming up

8 months agoMerge pull request #16682 from donaldsharp/bgp_suppress_test
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 05:12:17 +0000 (01:12 -0400)]
Merge pull request #16682 from donaldsharp/bgp_suppress_test

tests: Ensure bgp suppress fib has a chance to transmit data to peer

8 months agoMerge pull request #16681 from donaldsharp/zebra_re_after_rn
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 03:43:40 +0000 (23:43 -0400)]
Merge pull request #16681 from donaldsharp/zebra_re_after_rn

zebra: Move prefix lookup to outside re loop

8 months agoMerge pull request #16673 from donaldsharp/default_original_sin
Jafar Al-Gharaibeh [Wed, 28 Aug 2024 19:30:12 +0000 (15:30 -0400)]
Merge pull request #16673 from donaldsharp/default_original_sin

tests: Fix bgp_default_originate_topo1_3

8 months agoMerge pull request #16672 from raja-rajasekar/vty_out_mem_spike_srujana
Mark Stapp [Wed, 28 Aug 2024 19:29:23 +0000 (15:29 -0400)]
Merge pull request #16672 from raja-rajasekar/vty_out_mem_spike_srujana

lib: Memory spike reduction for sh cmds at scale

8 months agotests: Fix route-scale at higher ecmp 16680/head
Donald Sharp [Tue, 27 Aug 2024 14:29:13 +0000 (10:29 -0400)]
tests: Fix route-scale at higher ecmp

Recent commits moved the default retries to 60, but
the higher ecmp counts were over-riding to 40.  Let's
make it 80.

Noticed this when I went looking at failures on 386 platforms
in our ci.  Route scale is timing out when deleting routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: ospf_netns_vrf should give more time for coming up 16683/head
Donald Sharp [Wed, 28 Aug 2024 19:10:04 +0000 (15:10 -0400)]
tests: ospf_netns_vrf should give more time for coming up

Test fails:

            test_func = partial(
                topotest.router_json_cmp,
                router,
                "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
                expected,
            )
            _, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
            assertmsg = '"{}" JSON output mismatches'.format(rname)
>           assert diff is None, assertmsg
E           AssertionError: "r1" JSON output mismatches
E           assert Generated JSON diff error report:
E
E             > $->r1-ospf-cust1->areas->0.0.0.0->nbrFullAdjacentCounter: output has element with value '1' but in expected it has value '2'

/home/sharpd/frr2/tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py:239: AssertionError

Support bundle has this data:
r1# show ip ospf vrf all neighbor
% 2024/08/28 14:55:54.763

VRF Name: r1-ospf-cust1

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.255.3        1 Full/DR         10.547s           39.456s 10.0.3.1        r1-eth1:10.0.3.2                     0     0     0
10.0.255.2        1 Full/Backup     0.543s            38.378s 10.0.3.3        r1-eth1:10.0.3.2                     1     0     0

So immediately after the test fails this test, the neighbor comes up.
Let's give the test a bit more time for failure to not happen

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: Ensure bgp suppress fib has a chance to transmit data to peer 16682/head
Donald Sharp [Wed, 28 Aug 2024 19:05:40 +0000 (15:05 -0400)]
tests: Ensure bgp suppress fib has a chance to transmit data to peer

Giving only 5 seconds to pass bgp data to peers on a heavily
loaded system is a recipe for not having fun.  Add more time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16679 from donaldsharp/nhrp_test_documentation
Mark Stapp [Wed, 28 Aug 2024 18:11:18 +0000 (14:11 -0400)]
Merge pull request #16679 from donaldsharp/nhrp_test_documentation

doc: Update topotest doc to include iptables is needed

8 months agoMerge pull request #16300 from donaldsharp/local_connected
Mark Stapp [Wed, 28 Aug 2024 18:10:14 +0000 (14:10 -0400)]
Merge pull request #16300 from donaldsharp/local_connected

Local connected

8 months agozebra: Move prefix lookup to outside re loop 16681/head
Donald Sharp [Wed, 28 Aug 2024 17:18:00 +0000 (13:18 -0400)]
zebra: Move prefix lookup to outside re loop

Move the prefix lookup/comparison to outside the re loop
and into the rn loop, since that is where the code should
actually be.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16676 from opensourcerouting/fix/lua_nexthop_handling_in_lua
Donald Sharp [Wed, 28 Aug 2024 16:45:39 +0000 (12:45 -0400)]
Merge pull request #16676 from opensourcerouting/fix/lua_nexthop_handling_in_lua

Lua stack dumping

8 months agoMerge pull request #16677 from donaldsharp/mgmt_map
Jafar Al-Gharaibeh [Wed, 28 Aug 2024 16:38:11 +0000 (12:38 -0400)]
Merge pull request #16677 from donaldsharp/mgmt_map

mgmtd: Ensure map is NULL

8 months agodoc: Update topotest doc to include iptables is needed 16679/head
Donald Sharp [Wed, 28 Aug 2024 16:05:41 +0000 (12:05 -0400)]
doc: Update topotest doc to include iptables is needed

The nhrp tests skip tests that do not have iptables installed.
As such we have ended up with a situation where the nrhp test
is now failing locally for me because I have iptables installed
and if the CI system had iptables installed it would have detected
the problem as well.

Let's document that iptables is needed to do testing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotests: Fix bgp_default_originate_topo1_3 16673/head
Donald Sharp [Tue, 27 Aug 2024 21:08:38 +0000 (17:08 -0400)]
tests: Fix bgp_default_originate_topo1_3

This test was killing bgp on r1 and r2
and then immediately testing that the
default route transitioned.  Unfortunately
the test was written that under load the
system might be in a bad state.  Let's
modify the code to check for a bgp version
change and then that the bgp state has
come back up

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agomgmtd: Ensure map is NULL 16677/head
Donald Sharp [Wed, 28 Aug 2024 14:09:52 +0000 (10:09 -0400)]
mgmtd: Ensure map is NULL

Build is complaining:
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c: In function ‘mgmt_register_client_xpath’:
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:274:27: warning: ‘maps’ may be used uninitialized [-Wmaybe-uninitialized]
build 27-Aug-2024 05:46:38   274 |         map = darr_append(*maps);
build 27-Aug-2024 05:46:38       |                           ^
build 27-Aug-2024 05:46:38 mgmtd/mgmt_be_adapter.c:250:36: note: ‘maps’ was declared here
build 27-Aug-2024 05:46:38   250 |         struct mgmt_be_xpath_map **maps, *map;
build 27-Aug-2024 05:46:38       |                                    ^~~~

Let's make the compiler happy, even though there is no problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agolib: Add a helper function to dump Lua stack 16676/head
Donatas Abraitis [Wed, 28 Aug 2024 14:08:45 +0000 (17:08 +0300)]
lib: Add a helper function to dump Lua stack

Very handy for debugging.

In Lua script just use "log.trace(table)":

```
function on_rib_process_dplane_results(ctx)
log.trace(ctx.rinfo.zd_ng)
end
```

You will get something like:

```
Aug 28 17:04:36 donatas-laptop zebra[3782199]: [GCZ7N-MM9D9] {
                                                 1: {
                                                   type: 2
                                                   weight: 1
                                                   flags: 5
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   gate: {
                                                     value: 5.87967e+08
                                                     string: "192.168.11.35"
                                                   }
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 0
                                                   backup_num: 0
                                                 }
                                                 2: {
                                                   type: 3
                                                   weight: 1
                                                   flags: 3
                                                   backup_idx: 0
                                                   vrf_id: 0
                                                   nh_encap_type: 0
                                                   nh_label_type: 0
                                                   srte_color: 0
                                                   ifindex: 4
                                                   backup_num: 0
                                                 }
                                               }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agolib: Start from 1, not 0 when creating Lua tables for nexthops
Donatas Abraitis [Wed, 28 Aug 2024 12:31:47 +0000 (15:31 +0300)]
lib: Start from 1, not 0 when creating Lua tables for nexthops

Lua technically enumerates arrays from 1, not 0.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agolib: Memory spike reduction for sh cmds at scale 16672/head
Srujana [Tue, 30 Jul 2024 20:39:33 +0000 (20:39 +0000)]
lib: Memory spike reduction for sh cmds at scale

The output buffer vty->obuf is a linked list where
each element is of 4KB.
Currently, when a huge sh command  like <show ip route json>
is executed on a large scale, all the vty_outs are
processed and the entire data is accumulated.
After the entire vty execution, vtysh_flush proceeses
and puts this data in the socket (131KB at a time).

Problem here is the memory spike for such heavy duty
show commands.

The fix here is to chunkify the output on VTY shell by
flushing it intermediately for every 128 KB of output
accumulated and free the memory allocated for the buffer data.

This way, we achieve ~25-30% reduction in the memory spike.

Fixes: #16498
Note: This is a continuation of MR #16498

Signed-off-by: Srujana <skanchisamud@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
8 months agoMerge pull request #16655 from louis-6wind/fix-bmp-bpi-extra
Donatas Abraitis [Tue, 27 Aug 2024 19:14:13 +0000 (22:14 +0300)]
Merge pull request #16655 from louis-6wind/fix-bmp-bpi-extra

bgpd: fix labels static-analyser

8 months agoMerge pull request #16651 from opensourcerouting/fix/blackhole_community_bgpd
Donald Sharp [Tue, 27 Aug 2024 19:11:00 +0000 (15:11 -0400)]
Merge pull request #16651 from opensourcerouting/fix/blackhole_community_bgpd

bgpd: Respect BLACKHOLE community for internal BGP peering also

8 months agoMerge pull request #16665 from louis-6wind/fix-flexalgo-crash-no-te
Jafar Al-Gharaibeh [Tue, 27 Aug 2024 17:52:50 +0000 (13:52 -0400)]
Merge pull request #16665 from louis-6wind/fix-flexalgo-crash-no-te

isisd: fix crash at flex-algo without mpls-te

8 months agoMerge pull request #16652 from opensourcerouting/fix/prefix_sid_handling
Russ White [Tue, 27 Aug 2024 14:57:44 +0000 (10:57 -0400)]
Merge pull request #16652 from opensourcerouting/fix/prefix_sid_handling

bgpd: Filter Prefix-SID, Encap, PMSI Tunnel

8 months agoMerge pull request #16610 from Jafaral/no-py
Russ White [Tue, 27 Aug 2024 14:38:09 +0000 (10:38 -0400)]
Merge pull request #16610 from Jafaral/no-py

tools, ospfclient: add a config option to skip installing python scripts

8 months agoisisd: fix crash at flex-algo without mpls-te 16665/head
Louis Scalbert [Tue, 27 Aug 2024 13:45:38 +0000 (15:45 +0200)]
isisd: fix crash at flex-algo without mpls-te

Fix crash when flex-algo is configured and mpls-te is disabled.

> interface eth0
>  ip router isis 1
> !
> router isis 1
>  flex-algo 129
>   dataplane sr-mpls
>   advertise-definition

> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140486233631168, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fc5802e9476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fc58076021f in core_handler (signo=11, siginfo=0x7ffd38d42470, context=0x7ffd38d42340) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> #7  0x000055c527fb29da in isis_instance_flex_algo_create (args=0x7ffd38d43120) at isisd/isis_nb_config.c:2875
> #8  0x00007fc58072655b in nb_callback_create (context=0x55c52ab1d2f0, nb_node=0x55c529f72950, event=NB_EV_APPLY, dnode=0x55c52ab06230, resource=0x55c52ab189f8, errmsg=0x7ffd38d43750 "",
>     errmsg_len=8192) at lib/northbound.c:1262
> #9  0x00007fc580727625 in nb_callback_configuration (context=0x55c52ab1d2f0, event=NB_EV_APPLY, change=0x55c52ab189c0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1662
> #10 0x00007fc580727c39 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55c52ab1d2f0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1794
> #11 0x00007fc580725f77 in nb_candidate_commit_apply (transaction=0x55c52ab1d2f0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1131
> #12 0x00007fc5807260d1 in nb_candidate_commit (context=..., candidate=0x55c529f0a730, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1164
> #13 0x00007fc58072d220 in nb_cli_classic_commit (vty=0x55c52a0fc6b0) at lib/northbound_cli.c:51
> #14 0x00007fc58072d839 in nb_cli_apply_changes_internal (vty=0x55c52a0fc6b0,
>     xpath_base=0x7ffd38d477f0 "/frr-isisd:isis/instance[area-tag='1'][vrf='default']/flex-algos/flex-algo[flex-algo='129']", clear_pending=false) at lib/northbound_cli.c:178
> #15 0x00007fc58072dbcf in nb_cli_apply_changes (vty=0x55c52a0fc6b0, xpath_base_fmt=0x55c528014de0 "./flex-algos/flex-algo[flex-algo='%ld']") at lib/northbound_cli.c:234
> #16 0x000055c527fd3403 in flex_algo_magic (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0, algorithm=129, algorithm_str=0x55c52ab120d0 "129")
>     at isisd/isis_cli.c:3752
> #17 0x000055c527fc97cb in flex_algo (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0) at ./isisd/isis_cli_clippy.c:6445
> #18 0x00007fc5806b9abc in cmd_execute_command_real (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, up_level=0) at lib/command.c:984
> #19 0x00007fc5806b9c35 in cmd_execute_command (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, vtysh=0) at lib/command.c:1043
> #20 0x00007fc5806ba1e5 in cmd_execute (vty=0x55c52a0fc6b0, cmd=0x55c52aae6bd0 "flex-algo 129\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #21 0x00007fc580782ae1 in vty_command (vty=0x55c52a0fc6b0, buf=0x55c52aae6bd0 "flex-algo 129\n") at lib/vty.c:615
> #22 0x00007fc580784a05 in vty_execute (vty=0x55c52a0fc6b0) at lib/vty.c:1378
> #23 0x00007fc580787131 in vtysh_read (thread=0x7ffd38d4ab10) at lib/vty.c:2373
> #24 0x00007fc58077b605 in event_call (thread=0x7ffd38d4ab10) at lib/event.c:2011
> #25 0x00007fc5806f8976 in frr_run (master=0x55c529df9b30) at lib/libfrr.c:1212
> #26 0x000055c527f301bc in main (argc=5, argv=0x7ffd38d4ad58, envp=0x7ffd38d4ad88) at isisd/isis_main.c:350
> (gdb) f 6
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> 176                     list_delete_all_node(ext->aslas);
> (gdb) p ext
> $1 = (struct isis_ext_subtlvs *) 0x0

Fixes: ae27101e6f ("isisd: fix building asla at first flex-algo config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agolib: common debug status output 16664/head
Igor Ryzhov [Tue, 26 Mar 2024 18:25:21 +0000 (20:25 +0200)]
lib: common debug status output

Implement common code for debug status output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agolib: common debug config output
Igor Ryzhov [Tue, 26 Mar 2024 17:24:45 +0000 (19:24 +0200)]
lib: common debug config output

Implement common code for debug config output and remove daemon-specific
code that is duplicated everywhere.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agolib: rework debug init
Igor Ryzhov [Tue, 26 Mar 2024 14:54:54 +0000 (16:54 +0200)]
lib: rework debug init

The debug library allows to register a `debug_set_all` callback which
should enable all debugs in a daemon. This callback is implemented
exactly the same in each daemon. Instead of duplicating the code, rework
the lib to allow registration of each debug type, and implement the
common code only once in the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agoMerge pull request #16103 from mjstapp/fix_5549_nhg_type
Russ White [Tue, 27 Aug 2024 13:46:53 +0000 (09:46 -0400)]
Merge pull request #16103 from mjstapp/fix_5549_nhg_type

zebra: be consistent about v6 nexthops for v4 routes

8 months agoMerge pull request #16656 from donaldsharp/minor_fix_for_pim_dr_nondr
Mark Stapp [Tue, 27 Aug 2024 12:17:46 +0000 (08:17 -0400)]
Merge pull request #16656 from donaldsharp/minor_fix_for_pim_dr_nondr

tests: Allow convergence before adding multicast routes

8 months agotests: Add some tests to show new behavior works as expected 16300/head
Donald Sharp [Thu, 15 Aug 2024 20:02:55 +0000 (16:02 -0400)]
tests: Add some tests to show new behavior works as expected

a) A noprefix address by itself should not create a connected route.
   This was pre-existing.
b) A noprefix address with a corresponding route should result in a
   connected route.  This is how NetworkManager appears to work.
   This is new behavior, so a new test.
c) A route is added to the system from someone else.
   This is new behavior, so a new test.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Prevent accidental re memory leak in odd case
Donald Sharp [Wed, 26 Jun 2024 17:21:38 +0000 (13:21 -0400)]
zebra: Prevent accidental re memory leak in odd case

There exists a path in rib_add_multipath where if a decision
is made to not use the passed in re, we just drop the memory
instead of freeing it.  Let's free it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Handle kernel routes appropriately
Donald Sharp [Fri, 7 Jun 2024 17:50:07 +0000 (13:50 -0400)]
zebra: Handle kernel routes appropriately

Current code intentionally ignores kernel routes.  Modify
zebra to allow these routes to be read in on linux.  Also
modify zebra to look to see if a route should be treated
as a connected and mark it as such.

Additionally this should properly handle some of the issues
being seen with NOPREFIXROUTE.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Expose rib_update_handle_vrf_all
Donald Sharp [Fri, 7 Jun 2024 16:56:35 +0000 (12:56 -0400)]
zebra: Expose rib_update_handle_vrf_all

This function will be used on interface down
events to allow for kernel routes to be cleaned
up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Make p and src_p const for rib_delete
Donald Sharp [Fri, 7 Jun 2024 16:30:59 +0000 (12:30 -0400)]
zebra: Make p and src_p const for rib_delete

The prefix'es p and src_p are not const.  Let's make
them so.  Useful to signal that we will not change this
data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: Respect BLACKHOLE community for internal BGP peering also 16651/head
Donatas Abraitis [Tue, 27 Aug 2024 07:08:54 +0000 (10:08 +0300)]
bgpd: Respect BLACKHOLE community for internal BGP peering also

rfc7999 does not define to use this technique ONLY for EBGP sessions.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16657 from Jafaral/ospfv3_test_fix
Donald Sharp [Tue, 27 Aug 2024 00:29:38 +0000 (20:29 -0400)]
Merge pull request #16657 from Jafaral/ospfv3_test_fix

tests: Fix frequent ospfv3 basic functionality test failure

8 months agotests: Fix frequent ospfv3 basic functionality test failure 16657/head
Jafar Al-Gharaibeh [Mon, 26 Aug 2024 20:06:35 +0000 (15:06 -0500)]
tests: Fix frequent ospfv3 basic functionality test failure

The dead timer is set to 4 seconds, while the hello interval is set to 6535.
This test will only pass of the platform is fast enough for ospfv3 to
converge in 4 seconds. These timers were already tested multiple time earlier.
This test should just make sure that the boundary value 65535 is configurable,

Other changes in this commit:
  - add sequence numbers to the dead intervals tests to make it easier to
    track test faliures.
  - swap the config order in one test to match order with all other tests.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agotests: Allow convergence before adding multicast routes 16656/head
Donald Sharp [Wed, 21 Aug 2024 19:44:12 +0000 (15:44 -0400)]
tests: Allow convergence before adding multicast routes

Current code adds a new vlan interface, sets up ospf and
pim on it and immediately starts shoving data down the pipes.
This of course has the fun thing where the IGP and pim do not
always come up in a nice neat manner and the test is looking
for state from a nice neat come up, even though pim is `working`
correctly it is not correct for what the test wants.

Modify the code to ensure that ospf is up and has propagated
the route where it is needed as well as that pim neighbors have
properly come up, then initiate the multicast streams and igmp
reports.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: fix labels static-analyser 16655/head
Louis Scalbert [Mon, 26 Aug 2024 08:23:12 +0000 (10:23 +0200)]
bgpd: fix labels static-analyser

Fix static-analyser warnings with BGP labels:

> $ scan-build make -j12
> bgpd/bgp_updgrp_packet.c:819:10: warning: Access to field 'extra' results in a dereference of a null pointer (loaded from variable 'path') [core.NullDereference]
>                                                 ? &path->extra->labels->label[0]
>                                                    ^~~~~~~~~

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agobgpd: Set encap attribute if received and parsed 16652/head
Donatas Abraitis [Sun, 25 Aug 2024 16:15:10 +0000 (19:15 +0300)]
bgpd: Set encap attribute if received and parsed

It's not used much in the code, but we should have it set when everything is fine.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering Encap attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:11:01 +0000 (19:11 +0300)]
bgpd: Allow filtering Encap attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering PMSI Tunnel attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:05:53 +0000 (19:05 +0300)]
bgpd: Allow filtering PMSI Tunnel attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agobgpd: Allow filtering Prefix-SID attribute
Donatas Abraitis [Sun, 25 Aug 2024 16:03:05 +0000 (19:03 +0300)]
bgpd: Allow filtering Prefix-SID attribute

Filtering this attribute via `path-attribute discard/treat-as-widthraw`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16649 from opensourcerouting/fix/free_memory_on_return
Donald Sharp [Sat, 24 Aug 2024 19:30:45 +0000 (15:30 -0400)]
Merge pull request #16649 from opensourcerouting/fix/free_memory_on_return

bgpd: Free epvn_overlay memory on error

8 months agobgpd: Free epvn_overlay memory on error 16649/head
Donatas Abraitis [Sat, 24 Aug 2024 08:58:48 +0000 (11:58 +0300)]
bgpd: Free epvn_overlay memory on error

When parsing EVPN NLRIs, and an error occurred, do no forget to free the memory.

Fixes: 4ace11d010 ("bgpd: Move evpn_overlay to a pointer")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoMerge pull request #16646 from csilt/pim-ifp-crash
Donatas Abraitis [Sat, 24 Aug 2024 08:12:23 +0000 (11:12 +0300)]
Merge pull request #16646 from csilt/pim-ifp-crash

pimd: Fix crash in pimd

8 months agoMerge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json
Donatas Abraitis [Sat, 24 Aug 2024 06:32:49 +0000 (09:32 +0300)]
Merge pull request #16631 from pguibert6WIND/imported_from_l3nhg_json

bgpd: add json support for BGP L3NHG values

8 months agopimd: Fix crash in pimd 16646/head
Corey Siltala [Fri, 23 Aug 2024 18:04:26 +0000 (18:04 +0000)]
pimd: Fix crash in pimd

ifp->info is not always set in PIM. So add a guard here to stop
it from crashing when addresses are added to a non-PIM enabled interface
and PIM zebra debugging is enabled.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
8 months agoMerge pull request #16609 from donaldsharp/singleton_no_weight
Mark Stapp [Fri, 23 Aug 2024 20:19:29 +0000 (16:19 -0400)]
Merge pull request #16609 from donaldsharp/singleton_no_weight

Reduce the number of Singleton objects when using weight for NHG's

8 months agoMerge pull request #16640 from louis-6wind/fix-nhrp-local
Donatas Abraitis [Fri, 23 Aug 2024 19:57:09 +0000 (22:57 +0300)]
Merge pull request #16640 from louis-6wind/fix-nhrp-local

nhrpd: fix sending /32 shortcut

8 months agoMerge pull request #16633 from Jafaral/fix-version-build
Donald Sharp [Fri, 23 Aug 2024 18:45:33 +0000 (14:45 -0400)]
Merge pull request #16633 from Jafaral/fix-version-build

config: fix missing case when reporting version 'configured with'

8 months agonhrpd: fix sending /32 shortcut 16640/head
Louis Scalbert [Fri, 23 Aug 2024 14:05:45 +0000 (16:05 +0200)]
nhrpd: fix sending /32 shortcut

The remote spoke always sends a 32 prefix length to a shortcut request.
In the example, the remote spoke as the IP address 192.168.2.1/24.

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.1/32           10.255.255.2

Do not deal with local routes in nhrpd. Now:

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2

Fixes: d4aa24ba7d ("*: Introduce Local Host Routes to FRR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agobgpd: add json support for BGP L3NHG values 16631/head
Philippe Guibert [Thu, 22 Aug 2024 14:53:55 +0000 (16:53 +0200)]
bgpd: add json support for BGP L3NHG values

Some json attributes are missing for L3NHG values.

> PE1# show bgp vrf all detail
> [..]
> Instance vrf-purple:
> BGP table version is 1, local router ID is 27.3.0.85, vrf id 7
> Default local pref 100, local AS 65000
> BGP routing table entry for fe80::4620:ff:feff:ff01/128, version 1
> Paths: (1 available, best #1, vrf vrf-purple)
>   Not advertised to any peer
>   Imported from 10.30.30.30:5:[2]:[0]:[48]:[44:20:00:ff:ff:01]:[128]:[fe80::4620:ff:feff:ff01], VNI 4000  Local
>     ::ffff:a1e:1e1e (metric 20) from 10.30.30.30 (10.30.30.30) announce-nh-self
>       Origin IGP, localpref 100, valid, internal, best (First path received)
>       Extended Community: RT:65000:4000 ET:8
>       Last update: Thu Aug 22 18:23:38 2024
>
> Displayed 1 routes and 1 total paths

> PE1# show bgp vrf all json detail
> {
> "vrf-purple":{
>  "vrfId": 7,
>  "vrfName": "vrf-purple",
>  "tableVersion": 1,
>  "routerId": "27.3.0.85",
>  "defaultLocPrf": 100,
>  "localAS": 65000,
>  "routes": { "fe80::4620:ff:feff:ff01/128": [{"importedFrom":"10.30.30.30:5","l3nhg":false,"l3nhgActive":false, "vni": "4000",
> "aspath":{"string":"Local","segments":[],"length":0},"announceNexthopSelf":true,"origin":"IGP","locPrf":100,
> "valid":true,"version":1,"bestpath":{"overall":true,"selectionReason":"First path received"},
> "extendedCommunity":{"string":"RT:65000:4000 ET:8"},"lastUpdate":{"epoch":1724343817,
> "string":"Thu Aug 22 18:23:37 2024\n"},
> "nexthops":[{"ip":"::ffff:a1e:1e1e","hostname":"PE2","afi":"ipv6",
> "scope":"global","metric":20,"accessible":true,"used":true}],
> "peer":{"peerId":"10.30.30.30","routerId":"10.30.30.30","hostname":"PE2","type":"internal"}}]
>  }  }
> }

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
8 months agoMerge pull request #15561 from kraj/master
Jafar Al-Gharaibeh [Fri, 23 Aug 2024 04:34:00 +0000 (00:34 -0400)]
Merge pull request #15561 from kraj/master

Mimic GNU basename() API for non-glibc library e.g. musl

8 months agoMerge pull request #16632 from donaldsharp/SA_warnings_from_upstream
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 22:25:11 +0000 (18:25 -0400)]
Merge pull request #16632 from donaldsharp/SA_warnings_from_upstream

Sa warnings from upstream

8 months agoMerge pull request #16615 from Jafaral/revert-v4-v6-bgp
Donald Sharp [Thu, 22 Aug 2024 21:57:38 +0000 (17:57 -0400)]
Merge pull request #16615 from Jafaral/revert-v4-v6-bgp

Revert ipv4-mapped ipv6 and 6vpe nexthop in BGP

8 months agozebra: Mimic GNU basename() API for non-glibc library e.g. musl 15561/head
Khem Raj [Fri, 15 Mar 2024 21:34:06 +0000 (14:34 -0700)]
zebra: Mimic GNU basename() API for non-glibc library e.g. musl

musl only provides POSIX version of basename and it has also removed
providing it via string.h header [1] which now results in compile errors
with newer compilers e.g. clang-18

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
8 months agoconfig: fix missing case when reporting version 'configured with' 16633/head
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 19:26:01 +0000 (14:26 -0500)]
config: fix missing case when reporting version 'configured with'

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16630 from donaldsharp/babel_metric
Mark Stapp [Thu, 22 Aug 2024 19:20:32 +0000 (15:20 -0400)]
Merge pull request #16630 from donaldsharp/babel_metric

Babel metric

8 months agotools, ospfclient: add a config option to skip installing python scripts 16610/head
Jafar Al-Gharaibeh [Tue, 20 Aug 2024 20:02:54 +0000 (15:02 -0500)]
tools, ospfclient: add a config option to skip installing python scripts

The new config option --disable-python-runtime allows make install to proceed
without installing any of the python scripts. When installing from deb/rpm
packages those are bundled as frr-pythontools, which is independent from the
frr binaries and can already be skipped. I.e, this PR gives the option to skip
those scripts when building/installing from sources too.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agolib: Ensure SA that root cannot be NULL 16632/head
Donald Sharp [Thu, 22 Aug 2024 17:53:47 +0000 (13:53 -0400)]
lib: Ensure SA that root cannot be NULL

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobgpd: global_gr_mode does not need to be set twice
Donald Sharp [Thu, 22 Aug 2024 17:32:20 +0000 (13:32 -0400)]
bgpd: global_gr_mode does not need to be set twice

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Create Singleton nhg's without weights 16609/head
Donald Sharp [Tue, 20 Aug 2024 14:53:34 +0000 (10:53 -0400)]
zebra: Create Singleton nhg's without weights

Currently FRR when it has two nexthop groups:
A
  nexthop 1 weight 5
  nexthop 2 weight 6
  nexthop 3 weight 7
B
  nexthop 1 weight 3
  nexthop 2 weight 4
  nexthop 3 weight 5

We end up with 5 singleton nexthops and two groups:

ID: 181818168 (sharp)
     RefCnt: 1
     Uptime: 00:04:52
     VRF: default
     Valid, Installed
     Depends: (69) (70) (71)
           via 192.168.119.1, enp13s0 (vrf default), weight 182
           via 192.168.119.2, enp13s0 (vrf default), weight 218
           via 192.168.119.3, enp13s0 (vrf default), weight 255
ID: 181818169 (sharp)
     RefCnt: 1
     Uptime: 00:02:08
     VRF: default
     Valid, Installed
     Depends: (71) (127) (128)
           via 192.168.119.1, enp13s0 (vrf default), weight 127
           via 192.168.119.2, enp13s0 (vrf default), weight 170
           via 192.168.119.3, enp13s0 (vrf default), weight 255

id 69 via 192.168.119.1 dev enp13s0 scope link proto 194
id 70 via 192.168.119.2 dev enp13s0 scope link proto 194
id 71 via 192.168.119.3 dev enp13s0 scope link proto 194
id 127 via 192.168.119.1 dev enp13s0 scope link proto 194
id 128 via 192.168.119.2 dev enp13s0 scope link proto 194
id 181818168 group 69,182/70,218/71,255 proto 194
id 181818169 group 71,255/127,127/128,170 proto 194

This is not a desirable state to be in.  If you have a
link flapping in the network and weights are changing
rapidly you end up with a large number of singleton
nexthops that are being used by the nexthop groups.
This fills up asic space and clutters the table.
Additionally singleton nexthops cannot have any weight
and the fact that you attempt to create a singleton
nexthop with different weights means nothing to the
linux kernel( or any asic dplane ).  Let's modify
the code to always create the singleton nexthops
without a weight and then just creating the
NHG's that use the singletons with the appropriate
weight.

ID: 181818168 (sharp)
     RefCnt: 1
     Uptime: 00:00:32
     VRF: default
     Valid, Installed
     Depends: (22) (24) (28)
           via 192.168.119.1, enp13s0 (vrf default), weight 182
           via 192.168.119.2, enp13s0 (vrf default), weight 218
           via 192.168.119.3, enp13s0 (vrf default), weight 255
ID: 181818169 (sharp)
     RefCnt: 1
     Uptime: 00:00:14
     VRF: default
     Valid, Installed
     Depends: (22) (24) (28)
           via 192.168.119.1, enp13s0 (vrf default), weight 153
           via 192.168.119.2, enp13s0 (vrf default), weight 204
           via 192.168.119.3, enp13s0 (vrf default), weight 255

id 22 via 192.168.119.1 dev enp13s0 scope link proto 194
id 24 via 192.168.119.2 dev enp13s0 scope link proto 194
id 28 via 192.168.119.3 dev enp13s0 scope link proto 194
id 181818168 group 22,182/24,218/28,255 proto 194
id 181818169 group 22,153/24,204/28,255 proto 194

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agolib, zebra: Modify nexthop_cmp to allow you to use weight or not
Donald Sharp [Tue, 20 Aug 2024 12:28:17 +0000 (08:28 -0400)]
lib, zebra: Modify nexthop_cmp to allow you to use weight or not

Currently nexthop weight is a discriminator on whether or not
a nexthop matches.  There is a need to no use the weight as
part of this comparison function so let's add a boolean to
allow us to say use this or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoRevert "Merge pull request #15368 from louis-6wind/fix-6pe" 16615/head
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:40:18 +0000 (13:40 -0500)]
Revert "Merge pull request #15368 from louis-6wind/fix-6pe"

This reverts commit df98e8836897135b34080909bb6c4d91218a8e59, reversing
changes made to b6521192354df3f614b244323876e43dd0b58e56.

8 months agoMerge pull request #16450 from nabahr/static_joins
Donald Sharp [Thu, 22 Aug 2024 15:32:56 +0000 (11:32 -0400)]
Merge pull request #16450 from nabahr/static_joins

PIM: Implement static IGMP joins without an IGMP report

8 months agoMerge pull request #16613 from donaldsharp/weight_issues
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 15:19:54 +0000 (11:19 -0400)]
Merge pull request #16613 from donaldsharp/weight_issues

Weight issues

8 months agoMerge pull request #16620 from LabNConsulting/new-munet-0-14-10
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 15:14:18 +0000 (11:14 -0400)]
Merge pull request #16620 from LabNConsulting/new-munet-0-14-10

tests: update munet to 0.14.10

8 months agobabeld: Do not remove route when replacing 16630/head
Donald Sharp [Thu, 22 Aug 2024 14:24:42 +0000 (10:24 -0400)]
babeld: Do not remove route when replacing

When sending down a babel route do not remove then
add it back.  Just send down the change.  This
change will not cause packets to be dropped now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agobabeld: Send the route's metric down to zebra.
Donald Sharp [Thu, 22 Aug 2024 14:22:58 +0000 (10:22 -0400)]
babeld: Send the route's metric down to zebra.

Babel was thinking it was talking to the kernel for
route installation instead of zebra.  Pass down the
metric instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agoMerge pull request #16621 from LabNConsulting/fix-grpc-client
Donatas Abraitis [Thu, 22 Aug 2024 07:41:34 +0000 (09:41 +0200)]
Merge pull request #16621 from LabNConsulting/fix-grpc-client

tests: dont print sys.path when running grpc-query.py

8 months agoMerge pull request #16546 from dmytroshytyi-6WIND/fix_bgp_open_notification_snmp
Donatas Abraitis [Thu, 22 Aug 2024 05:18:23 +0000 (07:18 +0200)]
Merge pull request #16546 from dmytroshytyi-6WIND/fix_bgp_open_notification_snmp

bgpd: fix, do not access peer->notify.data when it is null

8 months agoMerge pull request #16619 from qlyoung/fix-rtd-build-sphinx-environment-injection
Jafar Al-Gharaibeh [Thu, 22 Aug 2024 04:05:24 +0000 (00:05 -0400)]
Merge pull request #16619 from qlyoung/fix-rtd-build-sphinx-environment-injection

doc: update sphinx configs for RTD changes

8 months agotests: dont print sys.path when running grpc-query.py 16621/head
Christian Hopps [Thu, 22 Aug 2024 02:03:48 +0000 (22:03 -0400)]
tests: dont print sys.path when running grpc-query.py

Don't print the sys.path when running grpc-query.py. Doing so
was causing tests to fail.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 months agotests: update munet to 0.14.10 16620/head
Christian Hopps [Thu, 22 Aug 2024 01:05:48 +0000 (21:05 -0400)]
tests: update munet to 0.14.10

Changes:

- mutini: handle possible missed zombie cleanup leading to test hangs
- mutini: also we avoid logging in the signal handler which was causing
  an exception.

Signed-off-by: Christian Hopps <chopps@labn.net>
8 months agodoc: update sphinx configs for RTD changes 16619/head
Quentin Young [Wed, 21 Aug 2024 23:38:09 +0000 (19:38 -0400)]
doc: update sphinx configs for RTD changes

Read The Docs made some changes that require us to add some
configuration in our build config files.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
8 months agoMerge pull request #16608 from louis-6wind/fix-no-rpki
Donatas Abraitis [Wed, 21 Aug 2024 20:12:05 +0000 (22:12 +0200)]
Merge pull request #16608 from louis-6wind/fix-no-rpki

bgpd: fix crash at no rpki

8 months agoRevert "Merge pull request #15614 from louis-6wind/fix-6pe-address"
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:37:43 +0000 (13:37 -0500)]
Revert "Merge pull request #15614 from louis-6wind/fix-6pe-address"

This reverts commit b3600d82dca4f23db4f42c46b25d3db48e1a4312, reversing
changes made to 51119823d02847f6095725e520264c85af94b37f.

8 months agoRevert "Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6"
Jafar Al-Gharaibeh [Wed, 21 Aug 2024 18:26:50 +0000 (13:26 -0500)]
Revert "Merge pull request #16439 from louis-6wind/fix-ipv4-mapped-ipv6"

This reverts commit cc0fdd3b1d1b3554896fc03eec16379b7bae2b40, reversing
changes made to 4e208087fd854e3e1528519745447f69691b04ad.

8 months agozebra, tests: Connected and Local routes should have a weight of 1 16613/head
Donald Sharp [Thu, 22 Feb 2024 20:53:45 +0000 (15:53 -0500)]
zebra, tests: Connected and Local routes should have a weight of 1

All routes received by zebra from upper level protocols have a weight
of 1.  Let's just make everything extremely consistent in our code.
Lot's of tests needed to be fixed up to make this work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agozebra: Ensure we cannot send invalid range to kernel
Donald Sharp [Thu, 22 Feb 2024 21:20:37 +0000 (16:20 -0500)]
zebra: Ensure we cannot send invalid range to kernel

The linux kernel adds 1 upon receipt of a weight, if you
send a 255 it gets unhappy.  Let's Limit range to 254 as
that kernel does not like sending of 255.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
8 months agotopotest: test_bgp_snmp_bgpv4v2_notification 16546/head
Dmytro Shytyi [Thu, 8 Aug 2024 13:42:40 +0000 (15:42 +0200)]
topotest: test_bgp_snmp_bgpv4v2_notification

This test checks the bgp crash on rt2 when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password 8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: test if rt2 bgp is crashed.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
8 months agobgpd: fix, do not access peer->notify.data when it is null
Dmytro Shytyi [Thu, 8 Aug 2024 13:53:11 +0000 (15:53 +0200)]
bgpd: fix, do not access peer->notify.data when it is null

bgp crash on rt2 spotted when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password
8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: rt2 bgp is crashed.

config rt2-bgp:
---------------

!
debug bgp updates
!
router bgp 65002
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.4 remote-as external
 neighbor 192.168.12.4 timers 1 3
 neighbor 192.168.12.4 timers connect 1
 neighbor 2001:db8::12:4 remote-as external
 neighbor 2001:db8::12:4 timers 1 3
 neighbor 2001:db8::12:4 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.4 activate
  neighbor 192.168.12.4 addpath-tx-all-paths

 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:4 activate
 exit-address-family
!
agentx
!

config rt2-snmpd:
agentAddress 127.0.0.1,[::1]

group public_group v1 public
group public_group v2c public
access public_group "" any noauth prefix all all none

rocommunity public default

view all included .1

iquerySecName frr
rouser frr

master agentx

agentXSocket /etc/frr/agentx
agentXPerms 777 755 root frr

config rt2-zebra:
-----------------

!
interface r2-eth0
 ip address 192.168.12.2/24
 ipv6 address 2001:db8::12:2/64
!

config rr-bgpd:
---------------

!
debug bgp updates
!
router bgp 65004
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.1 remote-as external
 neighbor 192.168.12.1 timers 1 3
 neighbor 192.168.12.1 timers connect 1
 neighbor 192.168.12.2 remote-as external
 neighbor 192.168.12.2 timers 1 3
 neighbor 192.168.12.2 timers connect 1
 neighbor 192.168.12.3 remote-as external
 neighbor 192.168.12.3 timers 1 3
 neighbor 192.168.12.3 timers connect 1
 neighbor 2001:db8::12:1 remote-as external
 neighbor 2001:db8::12:1 timers 1 3
 neighbor 2001:db8::12:1 timers connect 1
 neighbor 2001:db8::12:2 remote-as external
 neighbor 2001:db8::12:2 timers 1 3
 neighbor 2001:db8::12:2 timers connect 1
 neighbor 2001:db8::12:3 remote-as external
 neighbor 2001:db8::12:3 timers 1 3
 neighbor 2001:db8::12:3 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.1 activate
  neighbor 192.168.12.1 addpath-tx-all-paths
  neighbor 192.168.12.1 route-server-client
  neighbor 192.168.12.2 activate
  neighbor 192.168.12.2 addpath-tx-all-paths
  neighbor 192.168.12.2 route-server-client
  neighbor 192.168.12.3 activate
  neighbor 192.168.12.3 addpath-tx-all-paths
  neighbor 192.168.12.3 route-server-client
 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:1 activate
  neighbor 2001:db8::12:1 route-server-client
  neighbor 2001:db8::12:2 activate
  neighbor 2001:db8::12:2 route-server-client
  neighbor 2001:db8::12:3 activate
  neighbor 2001:db8::12:3 route-server-client
 exit-address-family
!
agentx
!

config rr-zebra:
----------------
!
interface rr-eth0
 ip address 192.168.12.4/24
 ipv6 address 2001:db8::12:4/64
!

Fixes: 2d8fff6b81bb ("bgpd: Implement BGP4V2-MIB(bgp4V2PeerErrorsTable)")
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
8 months agobgpd: fix crash at no rpki 16608/head
Louis Scalbert [Tue, 20 Aug 2024 08:33:30 +0000 (10:33 +0200)]
bgpd: fix crash at no rpki

When 'no rpki' is requested and the rtrlib RPKI object was freed, bgpd
is crashing.

RPKI is configured in VRF red.

> ip l set red down
> ip l del red
> printf 'conf\n vrf red\n no rpki' | vtysh

> Core was generated by `/usr/bin/bgpd -A 127.0.0.1 -M snmp -M rpki -M bmp'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> 44 ./nptl/pthread_kill.c: No such file or directory.
> [Current thread is 1 (Thread 0x7fb401f419c0 (LWP 190226))]
> (gdb) bt
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140411103615424, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fb4021ad476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fb4025ce22b in core_handler (signo=11, siginfo=0x7fff831b2d70, context=0x7fff831b2c40) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  rtr_mgr_remove_group (config=0x55fe8789f750, preference=11) at /build/make-pkg/output/source/DIST_RTRLIB/rtrlib/rtrlib/rtr_mgr.c:607
> #7  0x00007fb40145f518 in rpki_delete_all_cache_nodes (rpki_vrf=0x55fe8789f4f0) at bgpd/bgp_rpki.c:442
> #8  0x00007fb401463098 in no_rpki_magic (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at bgpd/bgp_rpki.c:1732
> #9  0x00007fb40145c09a in no_rpki (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at ./bgpd/bgp_rpki_clippy.c:37
> #10 0x00007fb402527abc in cmd_execute_command_real (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, up_level=0) at lib/command.c:984
> #11 0x00007fb402527c35 in cmd_execute_command (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, vtysh=0) at lib/command.c:1043
> #12 0x00007fb4025281e5 in cmd_execute (vty=0x55fe877f5130, cmd=0x55fe877fb8c0 "no rpki\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #13 0x00007fb4025f0aed in vty_command (vty=0x55fe877f5130, buf=0x55fe877fb8c0 "no rpki\n") at lib/vty.c:615
> #14 0x00007fb4025f2a11 in vty_execute (vty=0x55fe877f5130) at lib/vty.c:1378
> #15 0x00007fb4025f513d in vtysh_read (thread=0x7fff831b5fa0) at lib/vty.c:2373
> #16 0x00007fb4025e9611 in event_call (thread=0x7fff831b5fa0) at lib/event.c:2011
> #17 0x00007fb402566976 in frr_run (master=0x55fe871a14a0) at lib/libfrr.c:1212
> #18 0x000055fe857829fa in main (argc=9, argv=0x7fff831b6218) at bgpd/bgp_main.c:549

Fixes: 8156765abe ("bgpd: Add `no rpki` command")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agopathd: rework debugs
Igor Ryzhov [Tue, 26 Mar 2024 14:38:45 +0000 (16:38 +0200)]
pathd: rework debugs

Pathd uses a single debug struct with additional option flags to
configure different types of debug messages. This is not how debug
library is supposed to be used. The idea of option flags is to allow
more granular control of a single type, not to represent multiple types.

This commit adds a separate debug struct for each type which greatly
simplifies the code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
8 months agoMerge pull request #16597 from kprovost/master
Jafar Al-Gharaibeh [Mon, 19 Aug 2024 17:02:36 +0000 (13:02 -0400)]
Merge pull request #16597 from kprovost/master

zebra: fix loading kernel routes without netlink

8 months agoMerge pull request #16605 from donaldsharp/spelling_in_master_2
Mark Stapp [Mon, 19 Aug 2024 13:20:36 +0000 (09:20 -0400)]
Merge pull request #16605 from donaldsharp/spelling_in_master_2

Spelling in master 2