Commit Graph

38268 Commits

Author SHA1 Message Date
Christian Hopps
c88b48929c lib: fix new (incorrect) CLANG SA warnings
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
7f80885099 tests: add datastore notification test
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
255026c2ce mgmtd: add notify selectors to filter datastore notifications
- Additionally push the selectors down to the backends

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
709b2ae23f lib: notify on datastore (oper-state) changes
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
80c6f98ea7 lib: if: track oper-state inline
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
e64966876c lib: vrf: track oper-state inline
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Christian Hopps
8a52b69ca4 lib: northbound: add basic oper-state update functions
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-13 23:40:52 -05:00
Chirag Shah
3ef97f0e2f tools: fix frr-reload for nbr deletion of no form cmds
When a bgp neighbor removed from associated to peer-group,
the neighbor is fully deleted, subsequent deletion of any
configuration related to the neighbor leads to failure
in frr-reload.
Handle any 'no neighbor ...' part of lines_to_del list

Testing:
Below first line would delete the neighbor swp1.10,
the existing code before the change handles to remove
config starts with 'neighbor swp1.10 ...' but not
'no neighbor swp1.10 ...'.

(Pdb) (lines_to_del)
 (('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2'),
 (('router bgp 100',), 'neighbor swp1.10 advertisement-interval 1'),
 (('router bgp 100',), 'neighbor swp1.10 timers 3 9'),
 (('router bgp 100',), 'neighbor swp1.10 timers connect 1'),
 (('router bgp 100',), 'no neighbor swp1.10 capability dynamic'),

Before fix:

(Pdb) (lines_to_del)
[(('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2'),
 (('router bgp 100',), 'no neighbor swp1.10 capability dynamic')]

frr-reload log:
2025-01-13 05:13:11,172  INFO: Executed "router bgp 100  no neighbor swp1.10 interface peer-group dpeergrp_2 exit"
2025-01-13 05:13:11,227 ERROR: Failed to execute router bgp 100  neighbor swp1.10 capability dynamic exit
2025-01-13 05:13:11,228 ERROR: "router bgp 100 --  neighbor swp1.10 capability dynamic -- exit" we failed to remove this command

After fix:

(Pdb)(lines_to_del)
 [(('router bgp 100',), 'neighbor swp1.10 interface peer-group dpeergrp_2')]

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2025-01-13 11:53:18 -08:00
Jafar Al-Gharaibeh
bbebaa5d6b
Merge pull request #17843 from LabNConsulting/chopps/new-docker-and-doc
Add Ubuntu 24.04 docker image and developer build doc
2025-01-13 13:16:49 -06:00
Mark Stapp
4086b9c492
Merge pull request #17839 from raja-rajasekar/rajasekarr/optimize_nh_compare
zebra: Optimize invoking nhg compare func
2025-01-13 13:47:12 -05:00
Donald Sharp
0af26e1728
Merge pull request #17844 from LabNConsulting/chopps/munet-0-15-3
tests: update munet to 0.15.3
2025-01-13 12:07:33 -05:00
Jafar Al-Gharaibeh
a78161de7f doc: building html/pdf user and developer documentation
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:24:12 -06:00
Jafar Al-Gharaibeh
fd4a76cb2f doc: fix LaTex warning when building pdf docs
LaTex doesn't like the Unicon character `≥` which should be represented
by the special sequnce `$\leq$`. Since this is buried all in Sphinx, and
we also have a scrip that look for the character, the easiest fix is to
just use `>=` instead which works without warnings, and without asking to
ignore every warning about the use of every instance of the special char.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:24:12 -06:00
Jafar Al-Gharaibeh
cda66453c1 pimd: explicitly ensure the RP src is BSR
With the recent suppoort of multiple sources of RPs, we can assume non static RPs
are BSR RPs. Just make the check explicit for BSR.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Jafar Al-Gharaibeh
c30a3ad890 pimd: fix BSR RPs timing out
On the BSR node itself, RPs shouldn't timeout, becase we know
the node is the BSR, and it is active!

fixes:#17587

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-13 10:18:24 -06:00
Donatas Abraitis
a39aa3eb37 lib: Adopt Lua stuff for Lua 5.4
lua_pcall() returns LUA_ERRGCMM in 5.3 which is already deprecated.

The constant LUA_ERRGCMM was removed.
Errors in finalizers are never propagated; instead, they generate a warning.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-13 16:34:15 +02:00
Donatas Abraitis
708f2ca620 configure: Adopt for Lua 5.4
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-13 16:34:14 +02:00
Rafael Zalamena
dda4f00f65 topotests: improve test reliability
Decrease the protocol timers, wait for peers to connect (and test it)
then finally wait a bit more for SAs to be propagated.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-01-13 09:26:17 -03:00
Donatas Abraitis
b330e6d3eb m4: Update ax_lua to support Lua 5.4
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-13 14:13:36 +02:00
Giovanni Tataranni
a09e949e48 tools: use f-string in frr-reload.py
Adopt f-string for printing log message, so that appropriate formatting can be
applied.

Signed-off-by: Giovanni Tataranni <g.tataranni@gmail.com>
2025-01-13 11:08:51 +01:00
Christian Hopps
3366056bce tests: update munet to 0.15.4
- add readline and waitline functions for use with popen objects
- other non-topotest (munet native) run changes
  - vm/qemu support booting cloud images (rocky, ubuntu, debian)
  - native topology init commands

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-12 16:15:02 +00:00
Christian Hopps
1cfccbf103 docker: add ubuntu24-ci docker image support
Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-12 02:48:29 +00:00
Christian Hopps
901d059614 doc: add building for ubuntu 24.04, and refactor
- All 3 ubutu 2x (20.04, 22.04 and 24.04) have the same instructions
so put them in one include file.

Signed-off-by: Christian Hopps <chopps@labn.net>
2025-01-12 02:27:10 +00:00
Enke Chen
d015e1d7d3 bgpd: remove unused safi in bgp_aggregate structure
Remove the unused safi field in bgp_aggregate structure.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-11 14:14:10 -08:00
Enke Chen
daf749e934 bgpd: fix churn of aggregate routes from duplicate config
Currently when an aggregate-address is configured, the existing
entry is always removed regardless whether any change is involved.
This would create unnecessary churn of the aggregate route when
the same config is applied for the aggregate address.

The fix is to check for duplicate aggregate-address config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-11 14:01:36 -08:00
Jafar Al-Gharaibeh
8b4b88d4d6 tests: remove unnecessary wildcard fields from pim acl test
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-10 17:32:30 -06:00
Rajasekar Raja
e77954e5d9 zebra: Optimize invoking nhg compare func
In some cases, the old_re nhe and the newnhe is same and there is no
point in comparing them both since they are the same. Skip comparing in
such cases.

Ex:
2025/01/09 23:49:27.489020 ZEBRA: [W4Z4R-NTSMD] zebra_nhg_rib_find_nhe: => nhe 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489021 ZEBRA: [ZH3FQ-TE9NV] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 new id: 44 old id: 44
2025/01/09 23:49:27.489021 ZEBRA: [YB8HE-Z86GN] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 NEW 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489023 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489024 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489025 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE
2025/01/09 23:49:27.489026 ZEBRA: [ZM3BX-HPETZ] zebra_nhg_rib_compare_old_nhe: 0.0.0.0/0 OLD 0x555f611d30c0 (44[38/39/45])
2025/01/09 23:49:27.489027 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 30.1.2.9[0] vrf default(0) wgt 1, with flags
2025/01/09 23:49:27.489028 ZEBRA: [ZSB1Z-XM2V3] 0.0.0.0/0: NH 20.1.1.2[4] vrf default(0) wgt 1, with flags ACTIVE

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2025-01-10 13:39:12 -08:00
Donald Sharp
a962ff7833
Merge pull request #17829 from Jafaral/static-metric
tests: avoid nondeterministic route
2025-01-10 10:12:39 -05:00
Donald Sharp
348c2dc3f8 bgpd: Only update peer connection information when needed
Currently bgp is repeatedly grabbing peer connection information.
This is a bit overkill.  There are two situations:

a) Opening a connection to the peer
   In this case, we know the remote port/address a priori and can get
   the local information by just asking the OS.
b) Peer opening a connection to us.
   In this case, we know the local port/address a priori and can get
   the remote information by just asking the OS.

Modify the code to just grab this data at the appropriate time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-10 10:07:11 -05:00
Donald Sharp
78fa9b6feb bgpd: su_remote and su_local are properties of the connection
su_local and su_remote in the peer can change based upon
if we are initiating the remote connection or receiving it.
As such we need to treat it as a property of the connection.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-10 10:07:11 -05:00
Donald Sharp
0e416ff157 bgpd: bgp_getsockanme is connection oriented
Let's make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-10 10:06:16 -05:00
Donald Sharp
4c166947a8 zebra: Uninstall NHG in some situations
If you have this series of events:

a) Decision to install a NHG is made in zebra, enqueue to DPLANE
b) Changes to NHG are made and we remove it in the master pthread
   Since this NHG is not marked as installed it is not removed
   but the NHG data structure is deleted
c) DPLANE installs the NHG

In the end the NHG stays installed but ZEBRA has lost track of it.

Modify the removal code to check to see if the NHG is queued.
There are 2 cases:

a) NHG is kept around for a bit before being deleted.  In this case
just see that the NHG is Queued and keep it around too.

b) NHG is not kept around and we are just removing it.  In this case
check to see if it is queued and send another deletion event.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-10 09:35:35 -05:00
Donatas Abraitis
b4d640fc38
Merge pull request #17813 from enkechen-panw/aigp-fix6
bgpd: use igpmetric in bgp_aigp_metric_total()
2025-01-10 16:26:34 +02:00
Donald Sharp
d390f471f1
Merge pull request #17830 from opensourcerouting/fix/timers_bgp_default
bgpd: Fix showing default `timers bgp x y`
2025-01-10 09:24:00 -05:00
Donatas Abraitis
35c0c827f2
Merge pull request #17811 from enkechen-panw/aggr-fix3
bgpd: fix memory leak in bgp_aggregate_install()
2025-01-10 09:47:21 +02:00
Donatas Abraitis
485342fe35
Merge pull request #17831 from Jafaral/ospf6-nodebug
ospf6d: guard a couple of debugs
2025-01-10 09:45:20 +02:00
anlan_cs
a5ec72aa8c ospfd: avoid the redundant timers
Since the timer thread for ```OSPF_ROUTE_AGGR_DEL``` has been created,
the subsequent "no summary-address" commands shouldn't trigger redundant timers.

Signed-off-by: anlan_cs <anlan_cs@126.com>
2025-01-10 08:51:40 +08:00
Jafar Al-Gharaibeh
83990851ba ospf6d: guard a couple of debugs
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-09 17:26:10 -06:00
Enke Chen
36ce18d278 bgpd: fix memory leak in bgp_aggregate_install()
Potential memory leak with as-set and matching-MED-only config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2025-01-09 14:48:35 -08:00
Nathan Bahr
f75ec46dfb doc: Document rpf-lookup-mode changes
Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00
Nathan Bahr
590c937e8a tests: Add tests for new RPF lookup group and source list features
Expand existing pim_mrib tests to include testing lookup modes
specific to source and/or group as defined in prefix lists.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00
Nathan Bahr
e8d81ab5ce pimd: Implement rpf lookup mode as a list
Add the support to store lookup modes as a sorted list.
List is non-unique and sorts mode with both lists < modes with one list < global mode (no lists).
This way, when finding the right mode, we will match a lookup using a prefix list before the global mode.
Add passing group address into all lookups (using nht cache and/or synchronous lookup).
Many areas don't have a group address, use PIMADDR_ANY if no valid group is needed.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00
Nathan Bahr
8b00575fbb pimd,yang: Expand rpf-lookup-mode command
Add options for group-list and source-list, both of which take a prefix list name.
The prefix list is used to determine the lookup mode for specific sources and/or groups.
Any number of lookup modes can be configured as long as the combination of group
and source list is unique.
A global lookup mode (empty group and source lists) is always added and defaults to mrib-then-urib
as it currently functions. The global lookup mode can be changed as it current exists with the command
`rpf-lookup-mode MODE`.
When determinig which mode to use, match source (and group if provided) against the lists, if they are set.
If a lookup does not specify a group, then only use lookup modes that do not have a group list defined.
A lookup by definition will have a source, so no special handling there.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
2025-01-09 21:58:22 +00:00
Donatas Abraitis
76fc75de9e bgpd: Fix showing default timers bgp x y
Fixes: ef4a9215b9 ("bgpd: Reuse defined constants for BGP timers")
Fixes: ab3535fbcf ("bgpd: Implement connect retry backoff")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-09 23:56:31 +02:00
Jafar Al-Gharaibeh
3915dd5b53 tests: avoid nondeterministic route
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2025-01-09 15:44:25 -06:00
Jafar Al-Gharaibeh
7e3d4048a6
Merge pull request #17805 from donaldsharp/2_test_fixes
2 test fixes
2025-01-09 15:40:08 -06:00
Jafar Al-Gharaibeh
34431a38f1
Merge pull request #17809 from donaldsharp/nhg_fix
zebra: Fix leaked nhe
2025-01-09 15:38:54 -06:00
Donatas Abraitis
003869b179
Merge pull request #17801 from enkechen-panw/aggr-fix2
bgpd: apply route-map for aggregate before attribute comparison
2025-01-09 23:02:26 +02:00
Donatas Abraitis
0b48c8e134
Merge pull request #17807 from louis-6wind/fix-bgp-orf-crash
bgpd: fix crash in displaying json orf prefix-list
2025-01-09 22:57:51 +02:00
Donatas Abraitis
3c3c7fc08d
Merge pull request #17808 from louis-6wind/rem-if-dead
lib: remove interface dead code
2025-01-09 22:54:43 +02:00