Commit Graph

38268 Commits

Author SHA1 Message Date
Y Bharath
6aaffc7c37 tests: Fixed input dict at create_router_bgp
Missing comma between the key-value pairs

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-02-25 21:35:47 +05:30
Russ White
77b52da131
Merge pull request #18256 from Shbinging/fix_no_ip_split-horizon_poisoned-reverse
ripd: fix no ip rip split-horizon poisoned-reverse command
2025-02-25 10:45:55 -05:00
Russ White
8d48f1450e
Merge pull request #18119 from louis-6wind/bgp-hidden
bgpd: fix default instance when leaving the hidden state.
2025-02-25 09:59:11 -05:00
Mark Stapp
739020c71c
Merge pull request #18243 from dksharp5/remove_everything
Drop unused code
2025-02-25 09:43:00 -05:00
Gabriel Goller
80e96712e4 zebra: add ZEBRA_IF_DUMMY flag for dummy interfaces
Introduce ZEBRA_IF_DUMMY interface flag to identify Linux dummy interfaces [0].
These interfaces behave similarly to loopback interfaces and can be
specially handled by daemons.

[0]: https://github.com/torvalds/linux/blob/master/drivers/net/dummy.c

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2025-02-25 10:13:34 +01:00
Shbinging
22bec0df47 ripd: fix no ip rip split-horizon poisoned-reverse command
`no ip rip split-horizon poisoned-reverse` will undo poisoned-reverse and set default behavior which is split-horizon.
By contrast, `no ip rip split-horizon` will undo interface's split-horizon behavior.

Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2025-02-25 16:07:49 +08:00
Acee Lindem
06af50eace ospf6d: Fix use after free of router in OSPFv3 ABR route calculation.
This PR fixes FRR issue https://github.com/FRRouting/frr/issues/18040. The
OSPFv3 route is locked during the ABR calculation since there are
scenarios under which it is freed. The OSPFv3 ABR computation is
sub-optimal and this PR doesn't attempt to rework it.

Signed-off-by: Acee Lindem <acee@lindem.com>
2025-02-24 21:54:10 +00:00
Donna Sharp
e0387cd17f zebra: use provider function to receive data directly
Signed-off-by: Donna Sharp <dksharp5@gmail.com>
2025-02-24 14:51:12 -05:00
Donna Sharp
e7d61aa797 ospfd: remove unused function ins ospfd/ospf_lsa.c
Signed-off-by: Donna Sharp <dksharp5@gmail.com>
2025-02-24 14:40:22 -05:00
Jafar Al-Gharaibeh
f35de3f8cb
Merge pull request #18216 from gromit1811/bugfix_pim_vrf_register
pimd: Fix PIM VRF support (send register/register stop in VRF)
2025-02-24 12:56:08 -06:00
Donald Sharp
777aae08cf
Merge pull request #18226 from nabahr/pim-vrf-bind
pim: Fix vrf binding of autorp and mroute socket
2025-02-24 13:53:39 -05:00
Donald Sharp
231110aefd
Merge pull request #18225 from nabahr/autorp-joins
pim: Fix autorp group joins
2025-02-24 13:53:21 -05:00
Christian Hopps
311bd23ccb
Merge pull request #18236 from donaldsharp/zebra_multipath_num_operational_data
zebra: Add operational retrieval of Multipath Number
2025-02-24 12:33:34 -05:00
Louis Scalbert
077a2b0dfc tests: check as number in show run
Creates the default VRF instance after the other VRF instances. The
default VRF instance is created in hidden state. Check that AS number
in show run is correctly written.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:44 +01:00
Louis Scalbert
70e07678bf bgpd: fix leaving hidden state
Upon configuration of a VRF instance that references an absent default
VRF with "import vrf default", the default instance is created in hidden
state. However, the default instance is not properly un-hidden when
configured.

Restore the behavior prior to commit below.

Fixes: 9f7177af13 ("bgpd: fix duplicate BGP instance created with unified config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:43 +01:00
Louis Scalbert
118afe4690 tests: add bgp_l3vpn_hidden topotest
Test that leaving the hidden BGP instance state is working.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 17:52:43 +01:00
Alexander Skorichenko
1515a59202 bgpd: update AS value of a hidden bgp instance
'import vrf VRF' could define a hidden bgp instance with
the default AS_UNSPECIFIED (i.e. = 1) value.
When a
	router bgp AS vrf VRF
gets configured later on, replace this AS_UNSPECIFIED setting
with a requested value.

Fixes: 9680831518 ("bgpd: fix as_pretty mem leaks when un-hiding")
Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
339206341f Revert "bgpd: fix bgp vrf instance creation from implicit"
This reverts commit 2ff08af78e.

The fix is obviously wrong.

Link: 2ff08af78e
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
71a3756f2d bgpd: fix process_queue when un-hiding
bgp_process_queue_init() is not called in bgp_create() when leaving the
BGP instance hidden state because of the following goto:

>	if (hidden) {
>		bgp = bgp_old;
>		goto peer_init;
>	}

Upon reconfiguration of the default instance, the prefixes are never set
into a meta queue by mq_add_handler(). They are never processed for
zebra RIB installation and announcements of update/withdraw.

Do not delete the BGP process_queue when hiding.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Louis Scalbert
d2ff7e8a21 bgpd: fix default instance name when un-hiding
When unconfiguring a default BGP instance with VPN SAFI configurations,
the default BGP structure remains but enters a hidden state. Upon
reconfiguration, the instance name incorrectly appears as "VIEW ?"
instead of "VRF default". And the name_pretty pointer

The name_pretty pointer is replaced by another one with the incorrect
name. This also leads to a memory leak as the previous pointer is not
properly freed.

Do not rewrite the instance name.

Fixes: 4d0e7a49cf ("bgpd: VRF-Lite fix default bgp delete")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2025-02-24 15:17:05 +01:00
Christian Hopps
915dcd220d lib: northbound: support pre-built oper state in libyang tree
This also fixes a bug with specific (position specified) queries on keyless
lists. If the `get_next` callback is using the parent entry it will probably
crash as the code is passing the list_entry as both parent and child in the
specific lookup case.

There may currently be no code that uses the parent entry if the child entry is
non-NULL, though.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-24 04:09:17 +00:00
Donald Sharp
03ebdc3c4a zebra: Add operational retrieval of Multipath Number
The multipath number specified is not available through
the yang data and is not retrievable.  Make it so.
At this point in time do not allow this to be set from
yang.  Perhaps in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-23 11:14:47 -05:00
Donald Sharp
da0f552f5d staticd: Fix crash because registering unknown vrf
With recent commit:

c1adc8f1d6 staticd has started to crash
aproximately 1/10 of the tine in the static_vrf topotest

(gdb) bt
0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
1  __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
2  __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
3  0x00007fb1a6442476 in __GI_raise (sig=6) at ../sysdeps/posix/raise.c:26
4  0x00007fb1a6950823 in core_handler (signo=6, siginfo=0x7ffd6d832ff0, context=0x7ffd6d832ec0) at lib/sigevent.c:268
5  <signal handler called>
6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:44
7  __pthread_kill_internal (signo=6, threadid=140400982256064) at ./nptl/pthread_kill.c:78
8  __GI___pthread_kill (threadid=140400982256064, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
9  0x00007fb1a6442476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
10 0x00007fb1a64287f3 in __GI_abort () at ./stdlib/abort.c:79
11 0x00007fb1a699a422 in _zlog_assert_failed (xref=0x55f7dfd3dac0 <_xref.117>,
   extra=0x55f7dfd30c30 "BUG: NH %pFX registered but not in hashtable") at lib/zlog.c:789
12 0x000055f7dfd1201f in static_zebra_nht_register (nh=0x55f7fd2ecd80, reg=true) at staticd/static_zebra.c:333
13 0x000055f7dfd29c9d in static_install_nexthop (nh=0x55f7fd2ecd80) at staticd/static_routes.c:299
14 0x000055f7dfd2a126 in static_fixup_vrf (vrf=0x55f7fd2333a0, stable=0x55f7fd271030, afi=AFI_IP, safi=SAFI_UNICAST)
   at staticd/static_routes.c:441
15 0x000055f7dfd2a2be in static_fixup_vrf_ids (vrf=0x55f7fd2333a0) at staticd/static_routes.c:494
16 0x000055f7dfd15b53 in static_vrf_enable (vrf=0x55f7fd2333a0) at staticd/static_vrf.c:124
17 0x00007fb1a696ffa5 in vrf_enable (vrf=0x55f7fd2333a0) at lib/vrf.c:325
18 0x00007fb1a6991c87 in zclient_vrf_add (cmd=33, zclient=0x55f7fd29f740, length=76, vrf_id=8) at lib/zclient.c:2701
19 0x00007fb1a6996cba in zclient_read (thread=0x7ffd6d834230) at lib/zclient.c:4764
20 0x00007fb1a696bd9b in event_call (thread=0x7ffd6d834230) at lib/event.c:2019
21 0x00007fb1a68e1a3a in frr_run (master=0x55f7fd102e10) at lib/libfrr.c:1246
22 0x000055f7dfd1081e in main (argc=7, argv=0x7ffd6d834478, envp=0x7ffd6d8344b8) at staticd/static_main.c:193

Tracking this down, the crash is because the nh believes that is already
registered but lookup fails, causing this assert.  Looking at the code
static_fixup_vrf is changing the vrf_id.  I put a zlog_debug right
before the change of the nh vrf_id and noticed that the vrf id was
UNKNOWN.  So, the code is attempting to register into zebra the nexthop
with a vrf unknown( which will be ignored ).

Modify the code in the registration process to notice that the nh is
still UNKNOWN and as such nothing should be done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-22 18:13:15 -05:00
Jafar Al-Gharaibeh
3f290c97e8
Merge pull request #18231 from LabNConsulting/chopps/fix-case-choice-queries
Fix oper-state queries that involve choice/case nodes
2025-02-22 14:06:37 -06:00
Christian Hopps
73df7da40a tests: add unit-test for choice/case node queries
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-22 16:25:31 +00:00
Christian Hopps
b9ff10b086 lib: nb: fix oper-state queries that involve choice/case nodes
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-22 16:25:31 +00:00
Jafar Al-Gharaibeh
67985ba8ec
Merge pull request #18210 from donaldsharp/fix_bestpath_evpn_issue
bgpd: remove dmed check not required in bestpath selection
2025-02-21 17:11:13 -06:00
Jafar Al-Gharaibeh
7719645c69
Merge pull request #18224 from LabNConsulting/chopps/fe-client-docstrings
tests: add docstrings to frontend mgmtd client
2025-02-21 17:07:26 -06:00
Jafar Al-Gharaibeh
aa4bd0839f
Merge pull request #18223 from LabNConsulting/chopps/doc-mgmt-update
doc: update mgmtd list of converted
2025-02-21 17:07:02 -06:00
Nathan Bahr
d840560b74 pim: Fix autorp group joins
Group joining got broken when moving the autorp socket to open/close
as needed. This fixes it so autorp group joining is properly handled
as part of opening the socket.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 21:38:32 +00:00
Nathan Bahr
7e181a771c pim: Fix vrf binding of autorp and mroute socket
Bind the autorp socket to the vrf device.
Also fixed mroute socket to use vrf_bind instead of directly
setting the socket option.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-02-21 19:32:40 +00:00
Christian Hopps
84ab204ebe tests: add docstrings to frontend mgmtd client
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-21 18:47:15 +00:00
Christian Hopps
30f8de4417 doc: update mgmtd list of converted
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-02-21 18:44:51 +00:00
Donald Sharp
eb6f49ff1d
Merge pull request #18218 from y-bharath14/srib-yang-v3
yang: Corrected Pyang errors or warnings
2025-02-21 11:18:03 -05:00
Y Bharath
a05799bd8b yang: Corrected Pyang errors or warnings
Corrected Pyang errors or warnings at frr-route-types.yang file

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-02-21 15:03:31 +05:30
Donatas Abraitis
7e34722472
Merge pull request #18213 from donaldsharp/add_membership
*: Remove unneeded IPV6_JOIN|LEAVE_GROUP
2025-02-21 11:10:57 +02:00
Martin Buck
5a01011e0d pimd: Fix PIM VRF support (send register/register stop in VRF)
In 9461953914 and
8ebcc02328, transmission of PIM register and
register stop messages was changed to use a separate socket. However, that
socket is not bound to a possible VRF, so the messages were sent in the
default VRF instead. Call vrf_bind() once after socket creation and when the
VRF is ready to ensure transmission in the correct VRF. vrf_bind() handles
the non-VRF case (i.e. VRF_DEFAULT) automatically, so it may be called
unconditionally.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2025-02-21 09:00:55 +01:00
Donald Sharp
f7fd861fda *: Remove unneeded IPV6_JOIN|LEAVE_GROUP
Headers include this stuff now.  No need for it
in our code base.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-20 16:16:35 -05:00
Donald Sharp
83ad94694b bgpd: remove dmed check not required in bestpath selection
As part of the upstream master commit (f3575f61c7 bgpd: Sort the
bgp_path_inf) the snippet of the code for dmed check condition
left out, which leads to an issue of selecting incorrect bestpath.

As an example:

During the bestpath selection local route looses to another path due
to dmed condition being hit.

The snippet of the logs:

2025/02/20 03:06:20.131441 BGP: [JW7VP-K1YVV]
[2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path
27.0.0.7 flags Valid  with path Static announcement flags Selected Valid Attr Changed Unsorted
2025/02/20 03:06:20.131445 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.7 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local
2025/02/20 03:06:20.131452 BGP: [JW7VP-K1YVV] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): Comparing path 27.0.0.8 flags Valid  with path Static announcement flags Selected Valid Attr Changed Unsorted
2025/02/20 03:06:20.131456 BGP: [SYTDR-QV6X9] [2]:[0]:[48]:[00:92:00:00:00:10]: path 27.0.0.8 loses to path Static announcement as ES 03:44:38:39:ff:ff:02:00:00:01 is same and local
2025/02/20 03:06:20.131458 BGP: [WEWEC-8SE72] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): path Static announcement is the bestpath from AS 0   <<<< static is best
2025/02/20 03:06:20.131463 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.7 dmed
2025/02/20 03:06:20.131467 BGP: [Z3A78-GM3G5] bgp_best_selection: [2]:[0]:[48]:[00:92:00:00:00:10](VRF default) pi 27.0.0.8 dmed
2025/02/20 03:06:20.131471 BGP: [N6CTF-2RSKS] [2]:[0]:[48]:[00:92:00:00:00:10](VRF default): After path selection, newbest is path 27.0.0.7 oldbest was Static announce

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-20 14:28:15 -05:00
Mark Stapp
bf8e4a3b83
Merge pull request #17666 from routingrocks/pim_fhr_rp
pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED sta…
2025-02-20 13:41:10 -05:00
Jafar Al-Gharaibeh
fc6b0413fa
Merge pull request #14227 from routingrocks/pim_data_fix
pimd: Fix for data packet loss when FHR is LHR and RP
2025-02-20 10:56:05 -06:00
Donatas Abraitis
dad880201b
Merge pull request #18194 from donaldsharp/more_orf_funniness
bgpd: Fix another crash in orf
2025-02-19 22:34:43 +02:00
Donatas Abraitis
1508bbdb59
Merge pull request #18197 from donaldsharp/ospf_passive_test_removal
tests: Remove warning about passive command
2025-02-19 22:33:10 +02:00
Jafar Al-Gharaibeh
ce64c34f12
Merge pull request #17914 from opensourcerouting/pim-nb-filter
pimd: filter neighbors by address
2025-02-19 13:39:12 -06:00
Donald Sharp
d0a0e7061c tests: Remove warning about passive command
Several tests have warnings about the passive
command and how to use it.  Let's address this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-19 08:04:54 -05:00
Rafael Zalamena
c92061b8db doc: add allowed-neighbors command
Let users know about new command to filter PIM sessions based on peer
address.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-19 09:56:09 -03:00
Rafael Zalamena
47daa3e53f topotests: test PIM neighbor filtering
Add new topology for testing neighbor filtering and more features in
the future.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-19 09:56:08 -03:00
David Lamparter
b84493132c pimd: allow restricting neighbors per interface
Just filter incoming packets against a specified prefix-list.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-19 09:49:06 -03:00
Donald Sharp
66434fc2ee
Merge pull request #18108 from opensourcerouting/fix/zebra_no_vni_validation
zebra: Do not flush an existing vni configuration trying to remove wrong vni
2025-02-19 07:22:03 -05:00
Donald Sharp
23fc4ce666
Merge pull request #18111 from opensourcerouting/gmp-leave
pimd,pim6d: support IGMPv2/MLDv1 immediate leave
2025-02-19 07:21:00 -05:00