Commit Graph

38268 Commits

Author SHA1 Message Date
Rafael Zalamena
99861a084a pim6d: implement clear IPv6 MLD interfaces
Allow user to reset MLD state on all interfaces in a VRF.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
Rafael Zalamena
8a29d74004 doc: IGMP/MLD commands to limit source/groups
Document the newly added commands to limit the maximum amount of
groups/source to learn.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
Rafael Zalamena
a98f2b86c4 pim6d: implement MLD source/group limits
Let user configure a source/group limit for MLD protocol.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
David Lamparter
f07d379b74 pimd: implement IGMP group/source count limit
For groups we can just look at the length of the list, for sources we
need to count them on a per-interface level.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-10 15:40:07 -03:00
Donald Sharp
14eac319e8 bgpd: Fix crash in bgp_labelpool
The bgp labelpool code is grabbing the vpn policy data structure.
This vpn_policy has a pointer to the bgp data structure.  If
a item placed on the bgp label pool workqueue happens to sit
there for the microsecond or so and the operator issues a
`no router bgp...` command that corresponds to the vpn_policy
bgp pointer, when the workqueue is run it will crash because
the bgp pointer is now freed and something else owns it.

Modify the labelpool code to store the vrf id associated
with the request on the workqueue.  When you wake up
if the vrf id still has a bgp pointer allow the request
to continue, else drop it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-10 12:09:59 -05:00
Donald Sharp
baf4c1a78f
Merge pull request #18077 from y-bharath14/srib-babeld-code-maintainability
babeld: Improve code clarity and maintainability
2025-02-10 09:48:23 -05:00
David Lamparter
a97be61de8
Merge pull request #17775 from gromit1811/pr_journald_bugfix 2025-02-10 09:27:50 +01:00
Y Bharath
db8e385752 babeld: Improve code clarity and maintainability
Improve code clarity and maintainability

Signed-off-by: y-bharath14 <y.bharath@samsung.com>
2025-02-10 11:43:05 +05:30
Carmine Scarpitta
16640b615d bgpd: Request SRv6 locator after zebra connection
When SRv6 is enabled and an SRv6 locator is specified in the BGP
configuration, BGP may attempt to request SRv6 locator information from
zebra before the connection is fully established. If this occurs, the
request fails with the following error:

```
2025/02/06 16:37:32 BGP: [HR66R-TWQYD][EC 100663302] srv6_manager_get_locator: invalid zclient socket
````

As a result, BGP is unable to obtain the locator information,
preventing SRv6 VPN from working.

This commit fixes the issue by ensuring BGP requests SRv6 locator
information once the connection with zebra is successfully established.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-09 00:54:29 +01:00
Carmine Scarpitta
a6d02fe2fb tests: Extend SRv6 static SIDs topotest to verify SID structure
The `static_srv6_sids` topotest verifies that staticd correctly
programs the SIDs in the zebra RIB. Currently, the topotest only
validates the programmed behavior and SID attributes.

This commit extends the topotest to also validate the SID structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-08 22:31:19 +01:00
Carmine Scarpitta
312f7b3f8c lib: Add sidStructure in SRv6 SIDs JSON output
The `show ipv6 route json` command displays the IPv6 routing table in
JSON format, including SRv6 SIDs. For each SRv6 SID, it provides
behavior and SID attributes. However, it does not include the SID
structure.

This commit adds the SID structure to the SRv6 SID JSON output.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-08 22:31:19 +01:00
Carmine Scarpitta
e1654ba554 staticd: Fix SRv6 SID installation and deletion
The SRv6 support in staticd (PR #16894) does not set the correct SID
parameters (block length, node length, function length).

This commit fixes the issue and computes the correct parameters.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2025-02-08 22:31:19 +01:00
Donatas Abraitis
d3741f8437 bgpd: Do not check for capability length for Link-Local Next Hop capability
Capability's length is 0 and this is not needed to check if it's multiplied by
X or there is a minimum length for that.

Fixes: db853cc97e ("bgpd: Implement Link-Local Next Hop capability")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-02-08 13:01:53 +02:00
Russ White
2ef76a3350
Merge pull request #17871 from opensourcerouting/feature/bgp_link_local_capability
bgpd: Implement Link-Local Next Hop capability
2025-02-07 14:00:59 -05:00
Donald Sharp
eebe460168
Merge pull request #18045 from LabNConsulting/ziemba/250205-rfapi-mem-cleanup
bgpd: rfapi: fix mem leak when killed
2025-02-07 11:20:08 -05:00
David Lamparter
13a6ac5b4c lib: crash handlers must be allowed on threads
Blocking all signals on non-main threads is not the way to go, at least
the handlers for SIGSEGV, SIGBUS, SIGILL, SIGABRT and SIGFPE need to run
so we get backtraces.  Otherwise the process just exits.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2025-02-07 13:37:43 +01:00
Jafar Al-Gharaibeh
452732024e
Merge pull request #18048 from opensourcerouting/msdpt3f
pimd: fix DR election race on startup
2025-02-06 21:40:45 -06:00
Rafael Zalamena
fd66ede08b
Merge pull request #14105 from routingrocks/pim_ageout_fix
pimd: Fix for FHR mroute taking longer to age out
2025-02-06 21:25:45 -03:00
Rafael Zalamena
8644524606 pimd: fix DR election race on startup
In case interface address is learnt during configuration, make sure to
run DR election when configuring PIM/PIM passive on interface.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-06 19:30:51 -03:00
Russ White
f04f611633
Merge pull request #18033 from donaldsharp/isis_leak_lists
isisd: Do not leak a linked list in the circuit
2025-02-06 13:14:50 -05:00
Rajesh Varatharaj
51f26d17da pimd: During prefix-list update, behave as PIM_UPSTREAM_NOTJOINED state (conformance issue)
Issue:
If there are any changes to the prefix list, we perform a re-lookup to map the correct RP for the group.
Even if the S,G entry is PIM_UPSTREAM_NOTJOINED and in FHR, In the case of IGMPv3, an S,G entry can be
created with no joins. this is not necessary.
 https://www.rfc-editor.org/rfc/rfc4601#section-4.5.7 says no op in case of NOTJOINED

Solution:
To solve this issue, Stop RP mapping when the state is NOTJOINED

Ticket: #3496931

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2025-02-06 10:59:34 -06:00
G. Paul Ziemba
125a480b53 bgpd: rfapi: if BGP is terminating, free peer BPIs now instead of using timer
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2025-02-06 08:45:01 -08:00
Jafar Al-Gharaibeh
92b8e14460
Merge pull request #18038 from opensourcerouting/msdp-filter-leak
pimd: fix memory leak and assign allocation type
2025-02-06 10:31:31 -06:00
Rajesh Varatharaj
afed39ea2b pimd: Fix for FHR mroute taking longer to age out
Issue:
When there is no traffic for a group, the LHR and RP take the default KAT+Join timer expiry of
a maximum of 480 seconds to clear the S,G . However, in the FHR, we update the state from JOINED
to NOT Joined, downstream state from PPto NOINFO.  This restarts the ET timer, causing S,G on FHR to
take more than 10 minutes to age out.

In other words,
Consider a case where (S,G) is in Join state. When the traffic stops and the KAT (210) expires,
 the Join expiry timer restarts. At this time, if we receive a prune, the expectation is to set
 PPT to 0 (RFC 4601 sec 4.5.2).
 When the PPT expires, we move to the noinfo state and restart the expiry timer one more time. We remove the
 (S,G) entry only after ~10 minutes when there is no active traffic.

Summary:
KAT Join ET 210 + PP ET 210 + NOINFO ET 210.

Solution:
Delete the ifchannel when in noinfo state, and KAT is not running.

Ticket: #13703

Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2025-02-06 10:19:46 -06:00
Jafar Al-Gharaibeh
92288c9069
Merge pull request #17865 from donaldsharp/coverity_2024_new_hotness
Coverity 2024 new hotness
2025-02-06 10:15:55 -06:00
Martin Winter
075f44a417
Merge pull request #18029 from donaldsharp/more_support_bundle_data
tools: Add some more support bundle commands
2025-02-06 15:12:49 +01:00
Mark Stapp
e46bd54541
Merge pull request #18025 from donaldsharp/remove_sbfd_pymark
tests: Remove improper pymark
2025-02-06 08:58:27 -05:00
Rafael Zalamena
d1440dadff pimd: fix memory leak and assign allocation type
Use a memory allocation specific type for filter names (to help detect memory
leaks) and fix a memory leak when releasing peer memory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2025-02-06 10:17:19 -03:00
Philippe Guibert
658bf0281d lib: fix false context information for SRv6 route
The seg6local route dumped by 'show ipv6 route' makes think that the USP
flavor is supported, whereas it is not the case. This information is a
context information, and for End, the context information should be
empty.

> # show ipv6 route
> [..]
> I>* fc00:0:4::/128 [115/0] is directly connected, sr0, seg6local End USP, weight 1, 00:49:01

Fix this by suppressing the USP information from the output.

Fixes: e496b42030 ("bgpd: prefix-sid srv6 l3vpn service tlv")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2025-02-06 08:21:56 +01:00
Donald Sharp
bbb764c0f0 isisd: Remove unneeded modify functions
Our infrastructure was complaining about this:

2025/02/05 19:38:42 ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'modify' callback for '/frr-isisd:isis/instance/fast-reroute/level-1/lfa/tiebreaker/type'
2025/02/05 19:38:42 ISIS: [ZKB8W-3S2Q4][EC 100663330] unneeded 'modify' callback for '/frr-isisd:isis/instance/fast-reroute/level-2/lfa/tiebreaker/type'

Seems we don't need it.  Let's just remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 20:46:25 -05:00
Donald Sharp
3510a37b11 isisd: Do not leak a linked list in the circuit
Address sanitizer was telling us that linked lists
were being leaked.  No need to do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 20:15:01 -05:00
Russ White
a02ec27693
Merge pull request #17987 from pguibert6WIND/evpn_bgp_l2_attr_ext_community
bgpd: add L2 attr community support as per RFC8214
2025-02-05 10:17:46 -05:00
Donald Sharp
0b42b4ce6d
Merge pull request #17901 from opensourcerouting/nexthop_hashing
lib: actually hash all 16 bytes of IPv6 addresses, not just 4
2025-02-05 09:14:58 -05:00
Donald Sharp
2bda884dfd tools: Add some more support bundle commands
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 09:08:11 -05:00
Donald Sharp
8119e167b0 bfdd: Use pass by reference for bfd_key_delete
Coverity is pointing out that bfd_key_delete is
passing by value instead of reference for a very
large structure.  Double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 08:47:31 -05:00
Donald Sharp
6d80d0c595 bfdd: Use pass by reference instead of pass by value for a struct
The function bfd_key_lookup is currently sending by value for
a now very large structure.  Let's convert this over to pass
by reference.  This is noticed by coverity.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 08:42:00 -05:00
Russ White
3fabd4f4f9
Merge pull request #18014 from donaldsharp/nexthop_leak
Nexthop leak
2025-02-05 08:32:13 -05:00
Donald Sharp
b7d58011bd
Merge pull request #18018 from forrestchu/sbfd
doc: fix sbfd.rst doc warnings
2025-02-05 08:17:52 -05:00
Donald Sharp
3b9595e91c tests: Remove improper pymark
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-05 08:16:03 -05:00
Jafar Al-Gharaibeh
8d71ce9d7d
Merge pull request #18000 from donaldsharp/bgp_eoiu_mem_leak
bgpd: Fix up memory leak in processing eoiu marker
2025-02-04 23:20:42 -06:00
wumu.zsl
6c45ec3929 doc: fix sbfd.rst doc warnings
Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2025-02-05 02:18:23 +00:00
Donald Sharp
abbfcc49f9 zebra: Fix srv6 segment nexthop memory leak.
The srv6 segment was being set but never freed
on the statically allocated nexthop.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-04 15:13:48 -05:00
Russ White
1cbb4b9e3d
Merge pull request #17962 from donaldsharp/fpm_problems
Fpm problems
2025-02-04 15:09:05 -05:00
Donald Sharp
29dcfd415f zebra: Stop leaking labels when receiving nexthops from kernel
This leak is happening:
Direct leak of 96 byte(s) in 2 object(s) allocated from:
    0 0x7f6922eb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f6922a38ebb in qcalloc lib/memory.c:106
    2 0x7f6922a553d6 in nexthop_add_srv6_seg6 lib/nexthop.c:652
    3 0x562825e56b38 in parse_nexthop_unicast zebra/rt_netlink.c:589
    4 0x562825e58c4a in netlink_route_change_read_unicast_internal zebra/rt_netlink.c:1291
    5 0x562825e58eef in netlink_route_change_read_unicast zebra/rt_netlink.c:1321
    6 0x562825e64921 in netlink_route_change zebra/rt_netlink.c:1494
    7 0x562825e43407 in netlink_information_fetch zebra/kernel_netlink.c:407
    8 0x562825e439b5 in netlink_parse_info zebra/kernel_netlink.c:1148
    9 0x562825e44060 in kernel_read zebra/kernel_netlink.c:510
    10 0x7f6922aeca72 in event_call lib/event.c:1984
    11 0x7f6922a19e01 in frr_run lib/libfrr.c:1246
    12 0x562825e4b0b9 in main zebra/main.c:543
    13 0x7f692250c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Just check to see if it has been allocated.  The nexthop is a stack
variable so it's a bit odd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-02-04 15:00:12 -05:00
Russ White
063c8cc6e5
Merge pull request #17988 from cscarpitta/feature/srv6-ipv4-traffic-steering
staticd: Add CLI to support steering of IPv4 traffic over SRv6 SID list
2025-02-04 11:45:02 -05:00
Russ White
4349cab51b
Merge pull request #17953 from donaldsharp/limit_ip_protocol
lib: Remove System routes from ip protocol route map choices
2025-02-04 11:43:10 -05:00
Russ White
d57353db2b
Merge pull request #17918 from lsang6WIND/bgp_evpn_route_map
Add bgpevpn route type-2 route map filter tests
2025-02-04 11:42:42 -05:00
Russ White
e6228f7880
Merge pull request #17896 from opensourcerouting/fix/bgp_oad_extended_communities
bgpd: Send non-transitive extended communities from/to OAD peers
2025-02-04 11:42:16 -05:00
Russ White
24fa9eede4
Merge pull request #16593 from baozhen-H3C/202408151540
isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation
2025-02-04 11:39:29 -05:00
Russ White
0735013fa9
Merge pull request #17985 from pguibert6WIND/evpn_ead_label_support
bgpd: fix add label support to EVPN AD routes
2025-02-04 11:39:03 -05:00