Commit Graph

35946 Commits

Author SHA1 Message Date
Jafar Al-Gharaibeh
ecaada19cf
Merge pull request #17298 from FRRouting/mergify/bp/stable/10.1/pr-15716
isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN (backport #15716)
2024-10-29 13:40:53 -05:00
zhou-run
f145648d0a isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN
When receiving a hello packet, if the neighbor state transitions directly from a non-ISIS_ADJ_UP state (such as ISIS_ADJ_INITIALIZING) to ISIS_ADJ_DOWN state, the neighbor entry cannot be deleted. If the neighbor is removed or the neighbor's System ID changes, it may result in memory leakage in the neighbor entry.

Test Scenario:
LAN link between Router A and Router B is established. Router A does not configure neighbor authentication, while Router B is configured with neighbor authentication. When the neighbor entry on Router B ages out, the neighbor state on Router A transitions to INIT. If Router B is then removed, the neighbor state on Router A transitions to DOWN and persists.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>

fix frrbot styling issues found.

fix frrbot styling issues found.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
(cherry picked from commit 5009f7539a)
2024-10-29 15:19:54 +00:00
Russ White
b14878822e
Merge pull request #17287 from opensourcerouting/16354-bp-10.1
(10.1 backport) bgpd: add `bgp ipv6-auto-ra` command
2024-10-29 10:28:19 -04:00
Russ White
680ccfbbbb
Merge pull request #17292 from FRRouting/mergify/bp/stable/10.1/pr-17245
bgpd:  fix crash when polling bgp4v2PathAttrTable (backport #17245)
2024-10-29 10:22:48 -04:00
Donatas Abraitis
fd230e4041
Merge pull request #17283 from FRRouting/mergify/bp/stable/10.1/pr-17278
bgpd: fix blank line in running-config with bmp listener cmd (backport #17278)
2024-10-29 14:36:51 +02:00
Francois Dumontet
6dcdfd464f bgpd: fix crash when polling bgp4v2PathAttrTable
we have

(gdb) p *path->attr->aspath
$1 = {refcnt = 3, segments = 0x0, json = 0x0, str = 0x55723d0b7470 "", str_len = 0, asnotation = ASNOTATION_PLAIN}

It looks like this aspath is empty, resulting in a size 0 and NULL pointer for path->attr->aspath->segments which leads to the SIGSEGV

fixe: return 0 when segments is null.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
(cherry picked from commit ee2f1b85cf)
2024-10-29 12:13:10 +00:00
Mikhail Sokolovskiy
681738681a bgpd: add bgp ipv6-auto-ra command
Introduce a command to stop bgpd from enabling IPv6 router advertisement
messages sending on interfaces.

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2024-10-29 12:08:40 +01:00
Philippe Guibert
878890f3e4 bgpd: fix blank line in running-config with bmp listener cmd
An extra blank line is added in show running-config with BMP:

> ubuntu2204hwe(config)# router bgp 65500
> ubuntu2204hwe(config-router)# bmp targets tgt
> ubuntu2204hwe(config-bgp-bmp)# bmp monitor ipv4 unicast pre-policy
> ubuntu2204hwe(config-bgp-bmp)# bmp listener 192.0.2.100 port 44
> ubuntu2204hwe(config-bgp-bmp)# do show running-config
>
> router bgp 65500
> [..]
>  bmp targets tgt
>   bmp monitor ipv4 unicast pre-policy
>                                       <-- blank line
>   bmp listener 192.0.2.100 port 44
>  exit

Remove the blank line.

Fixes: ed18356f1f ("bgpd/bmp: BMP implementation")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 9a33ee18bf)
2024-10-29 08:58:20 +00:00
Jafar Al-Gharaibeh
4f89c0a289
Merge pull request #17273 from FRRouting/mergify/bp/stable/10.1/pr-17243
bgpd: fix display of local label in show bgp (backport #17243)
2024-10-28 12:37:45 -05:00
Louis Scalbert
7b1b5e210d bgpd: fix display of local label in show bgp
Fix the display of the local label in show bgp.

> r1# show bgp ipv4 labeled-unicast 172.16.2.2/32
> BGP routing table entry for 172.16.2.2/32, version 2
> Local label: 16 <---- MISSING
> Paths: (1 available, best #1, table default, vrf (null))
>   Advertised to non peer-group peers:
>  192.168.1.2
>  65501
>    192.168.1.2 from 192.168.1.2 (172.16.2.2)
>      Origin IGP, metric 0, valid, external, best (First path received)
>      Remote label: 3
>      Last update: Fri Oct 25 17:55:45 2024

Fixes: 67f67ba481 ("bgpd: Drop label_ntop/label_pton functions")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit e7b3276ace)
2024-10-28 14:37:07 +00:00
Jafar Al-Gharaibeh
e4c22875c3
Merge pull request #17259 from FRRouting/mergify/bp/stable/10.1/pr-17160
lib, zebra: Keep `zebra on-rib-process script` in frr.conf (backport #17160)
2024-10-28 08:55:50 -05:00
Jafar Al-Gharaibeh
848b7db96e
Merge pull request #17239 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b456c1c225a29609c8_10.1
bgpd: compare aigp after local route check in bgp_path_info_cmp()
2024-10-27 23:44:40 -05:00
Donatas Abraitis
5e136ceb83 lib, zebra: Keep zebra on-rib-process script in frr.conf
After the change:

```
$ grep on-rib-process /etc/frr/frr.conf
zebra on-rib-process script script4

$ systemctl restart frr

$ vtysh -c 'show run' | grep on-rib-process
zebra on-rib-process script script4
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1fe1f8d87c)
2024-10-27 23:24:52 +00:00
Donald Sharp
894077e940
Merge pull request #17217 from Jafaral/fix-bsm-backport
pimd: allow resolving bsr via directly connected secondary address (backport)
2024-10-25 16:06:00 -04:00
Enke Chen
2677b1b736 bgpd: compare aigp after local route check in bgp_path_info_cmp()
For consistency between RIB and BGP, the aigp comparison should
be made after the local route check in bgp bestpath selection.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 6a7049aaac)
2024-10-25 13:11:21 +03:00
Donatas Abraitis
d98d41b3c5
Merge pull request #17208 from cscarpitta/fix/backport_add-sid-structure-to-seg6local-nh_for_10.1
bgpd, lib: Include SID structure in seg6local nexthop (backport for 10.1)
2024-10-24 17:32:28 +03:00
Jafar Al-Gharaibeh
d23a7d0949 pimd: allow resolving bsr via directly connected secondary address
This only matters to single hop nodes that are adjacent to the bsr. More common
with IPv6 where LL address is used in PIM as the primary address. If the BSR IP
happens to be an address on the same interface, the receiving pim router
rejects the BSR address because it expects the BSR IP to resolve via the LL address
even if we have a connected route for the same BSR IP subnet. Effectively, we want to
allow rpf to be resolved via secondary IPs with connected routes on the same interface,
and not limit them to primary addresses.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-10-23 15:22:23 -05:00
Carmine Scarpitta
88320c88e5 bgpd: Include structure when removing End.DT46 SID
Include SID structure information when removing an SRv6 End.DT46 SID
from the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-23 17:25:16 +02:00
Carmine Scarpitta
29caedcda6 bgpd: Include structure when removing End.DT4/6 SID
Include SID structure information when removing an SRv6 End.DT4 or End.DT6 SID
from the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-23 17:24:52 +02:00
Carmine Scarpitta
f1c9c38d58 bgpd: Include structure when installing End.DT46 SID
Include SID structure information when installing an SRv6 End.DT46 SID
in the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-23 17:24:37 +02:00
Carmine Scarpitta
7669e2784d bgpd: Include structure when installing End.DT4/6 SID
Include SID structure information when installing an SRv6 End.DT6 or End.DT4 SID
in the forwarding plane.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-23 17:24:22 +02:00
Carmine Scarpitta
ddaf2a7e9b lib: Include SID structure in seg6local nexthop
Include SID structure information in seg6local nexthop data structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-10-23 16:06:54 +02:00
Donatas Abraitis
be50cd1ee0
Merge pull request #17202 from FRRouting/mergify/bp/stable/10.1/pr-17198
Revert "lib: Attach stdout to child only if --log=stdout and stdout F… (backport #17198)
2024-10-23 12:40:07 +03:00
Donald Sharp
cbeb51ca2c Revert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"
This reverts commit 0e3c5e8e59.

(cherry picked from commit 6a36b9ef49)
2024-10-22 20:37:05 +00:00
Russ White
0401930508
Merge pull request #17196 from FRRouting/mergify/bp/stable/10.1/pr-17165
bgpd: Do not filter no-export community for BGP OAD (backport #17165)
2024-10-22 14:42:14 -04:00
Donatas Abraitis
f213be906c tests: Check if BGP no-export community is passed to BGP OAD peers
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7eaec540ec)
2024-10-22 15:07:24 +00:00
Donatas Abraitis
3b70206416 bgpd: Do not filter no-export community for BGP OAD (one administration domain)
OAD is treated as an _internal_ BGP peer, and some of the rules (including BGP
attributes) can be relaxed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e63b1520f1)
2024-10-22 15:07:24 +00:00
Jafar Al-Gharaibeh
6bb1cc1541
Merge pull request #17176 from FRRouting/mergify/bp/stable/10.1/pr-17169
bgpd: allow value 0 in aigp-metric setting (backport #17169)
2024-10-21 13:39:39 -05:00
Enke Chen
c09f979483 bgpd: allow value 0 in aigp-metric setting
The value of 0 is accepted from peers, and can also be set by the
route-map "set aigp-metric igp-metric". For coonsistency, it should
be allowed in "set aigp-metric <value>" as well.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit e07f38a43f)
2024-10-21 08:34:30 +00:00
Donatas Abraitis
ddce313558
Merge pull request #17130 from FRRouting/mergify/bp/stable/10.1/pr-17116
zebra: unlock node only after operation in zebra_free_rnh() (backport #17116)
2024-10-18 15:18:25 +03:00
Jafar Al-Gharaibeh
16c17f55d7
Merge pull request #17147 from FRRouting/mergify/bp/stable/10.1/pr-17091
bgpd: fix several issues in sourcing AIGP attribute (backport #17091)
2024-10-17 11:29:40 -05:00
Enke Chen
f34920fd62 tests: add a new topotest to bgp_aigp
Add a new topotest for getting the aigp from the "igp-metric"
for a redistributed route (ospf route in the test).

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 51612593f7)
2024-10-17 05:56:13 +00:00
Enke Chen
c163463231 bgpd: fix several issues in sourcing AIGP attribute
Fix several issues in sourcing AIGP attribute:

1) AIGP should not be set as default for a redistributed route or a
   static network. It should be set by config instead.

2) AIGP sourced by "set aigp-metric igp-metric" in a route-map does
   not set the correct value for a redistributed route.

3) When redistribute a connected route like loopback, the AGIP (with
   value 0) is sourced by "set aigp-metric igp-metric", but the
   attribute is not propagated as the attribute flag is not set.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit f65356d8bb)
2024-10-17 05:56:13 +00:00
Donald Sharp
13d500dd14
Merge pull request #17138 from FRRouting/mergify/bp/stable/10.1/pr-17020
zebra: fix heap-use-after free on ns shutdown (backport #17020)
2024-10-16 12:49:16 -04:00
Philippe Guibert
0ddb53ee36 zebra: fix heap-use-after free on ns shutdown
The following ASAN issue has been observed:

> ERROR: AddressSanitizer: heap-use-after-free on address 0x6160000acba4 at pc 0x55910c5694d0 bp 0x7ffe3a8ac850 sp 0x7ffe3a8ac840
> READ of size 4 at 0x6160000acba4 thread T0
>         #0 0x55910c5694cf in ctx_info_from_zns zebra/zebra_dplane.c:3315
>     #1 0x55910c569696 in dplane_ctx_ns_init zebra/zebra_dplane.c:3331
>     #2 0x55910c56bf61 in dplane_ctx_nexthop_init zebra/zebra_dplane.c:3680
>     #3 0x55910c5711ca in dplane_nexthop_update_internal zebra/zebra_dplane.c:4490
>     #4 0x55910c571c5c in dplane_nexthop_delete zebra/zebra_dplane.c:4717
>     #5 0x55910c61e90e in zebra_nhg_uninstall_kernel zebra/zebra_nhg.c:3413
>     #6 0x55910c615d8a in zebra_nhg_decrement_ref zebra/zebra_nhg.c:1919
>     #7 0x55910c6404db in route_entry_update_nhe zebra/zebra_rib.c:454
>     #8 0x55910c64c904 in rib_re_nhg_free zebra/zebra_rib.c:2822
>     #9 0x55910c655be2 in rib_unlink zebra/zebra_rib.c:4212
>     #10 0x55910c6430f9 in zebra_rtable_node_cleanup zebra/zebra_rib.c:968
>     #11 0x7f26f275b8a9 in route_node_free lib/table.c:75
>     #12 0x7f26f275bae4 in route_table_free lib/table.c:111
>     #13 0x7f26f275b749 in route_table_finish lib/table.c:46
>     #14 0x55910c65db17 in zebra_router_free_table zebra/zebra_router.c:191
>     #15 0x55910c65dfb5 in zebra_router_terminate zebra/zebra_router.c:244
>     #16 0x55910c4f40db in zebra_finalize zebra/main.c:249
>     #17 0x7f26f2777108 in event_call lib/event.c:2011
>     #18 0x7f26f264180e in frr_run lib/libfrr.c:1212
>     #19 0x55910c4f49cb in main zebra/main.c:531
>     #20 0x7f26f2029d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
>     #21 0x7f26f2029e3f in __libc_start_main_impl ../csu/libc-start.c:392
>     #22 0x55910c4b0114 in _start (/usr/lib/frr/zebra+0x1ae114)

It happens with FRR using the kernel. During shutdown, the
namespace identifier is attempted to be obtained by zebra, in an
attempt to prepare zebra dataplane nexthop messages.

Fix this by accessing the ns structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 7ae70eb5ef)
2024-10-16 13:16:20 +00:00
Enke Chen
e9c99dfd7a zebra: unlock node only after operation in zebra_free_rnh()
Move route_unlock_node() after rnh_list_del().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 5b6ff51b8a)
2024-10-16 05:13:52 +00:00
Russ White
4d229b0019
Merge pull request #17109 from FRRouting/mergify/bp/stable/10.1/pr-17093
bgpd: fix route selection with AIGP (backport #17093)
2024-10-15 14:19:00 -04:00
Enke Chen
4fc971a53e tests: fix and adjust topotest/bgp_aigp
Fix and adjust the topotest post the fix for route selection with
AIGP.

When there are multiple	IGP domains (OSPF in this case), the nexthop
for a BGP route with the AIGP attribute must be resolved in its own
IGP domain.

The changes in r2/bgpd.conf and r3/bgpd.conf are needed as incorrect
IGP metrics are received from NHT for the recursive nexthops. Once
the issue is resolved, the changes can be reverted.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 1ee7e63a6c)
2024-10-15 14:25:06 +00:00
Enke Chen
3394680c23 bgpd: fix route selection with AIGP
The nexthop metric should be added to AIGP when calculating the
bestpath in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 081422e8e7)
2024-10-15 14:25:06 +00:00
Donatas Abraitis
5a48cef8f5
Merge pull request #17095 from FRRouting/mergify/bp/stable/10.1/pr-17074
bgpd: fix evpn mh esi down (backport #17074)
2024-10-15 10:50:40 +03:00
Chirag Shah
3ec60f20e2 bgpd: fix evpn mh esi flap remove local routes
In symmetric routing, when local ESI is down,
the MH peer learnt local mac-ip
prefix is installed into teannt vrf (given l3vni).

When ESI is back up and associated to evi/vni then
remove the local synced mac-ip imported routes from the
tenant vrf as local neigh/arp is present.

Ticket: #3878699
Testing:

peer advertised mac-ip route:
*> [2]:[0]:[48]:[aa:aa:aa:00:00:01]:[32]:[45.0.0.51] RD 27.0.0.4:9
                    27.0.0.4 (spine-1)
                                                           0 64435 65016 i
                    ESI:03:44:38:39:ff:ff:01:00:00:01
                    RT:65016:1000 RT:65016:4000 ET:8 Rmac:44:38:39:ff:ff:16

When local ESI is flapped
torm-11:# ip neigh show 45.0.0.51
45.0.0.51 dev vlan1000 lladdr aa:aa:aa:00:00:01 REACHABLE proto zebra

Before fix:
(The imported route remained in tenant-vrf)
torm-11:# ip route show vrf vrf1 45.0.0.51
45.0.0.51 nhid 257 proto bgp metric 20

After fix:

torm-11# ip route show vrf vrf1 45.0.0.51
torm-11#

trace:
2024/10/11 18:19:29 BGP: [JMP3T-178G8] route [2]:[0]:[48]:[00:02:00:00:00:08]:[32]:[21.1.0.5]
is matched on local esi 03:00:00:00:77:01:04:00:00:0e, uninstall from VRF tenant1 route table

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 3f00709a39)
2024-10-15 05:21:53 +00:00
Donald Sharp
02e556b6a2
Merge pull request #17067 from FRRouting/mergify/bp/stable/10.1/pr-17059
bgpd: Move some non BGP-specific route-map functions to lib (backport #17059)
2024-10-11 12:14:45 -04:00
Donatas Abraitis
6685763c08 bgpd: Move some non BGP-specific route-map functions to lib
They are managed under `frr-route-map`, not under `frr-bgp-route-map`.

Fixes: https://github.com/FRRouting/frr/issues/17055

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9a9be492e)
2024-10-11 11:16:57 +00:00
Donald Sharp
7ecf4f2245
Merge pull request #17033 from FRRouting/mergify/bp/stable/10.1/pr-17022
vrrpd: iterate over all ancillary messages (backport #17022)
2024-10-08 18:22:21 -04:00
Rafael Zalamena
12d494731c vrrpd: iterate over all ancillary messages
Assign the return of `CMSG_NXTHDR` so we can really iterate over the
ancillary data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 5e1a3cd2ad)
2024-10-08 13:32:24 +00:00
Donald Sharp
9b69084cac
Merge pull request #17026 from FRRouting/mergify/bp/stable/10.1/pr-17014
isisd: fix wrong check for MT commands (backport #17014)
2024-10-08 09:24:41 -04:00
anlan_cs
5bc541c430 isisd: fix wrong check for MT commands
```
anlan# show run
!
interface eth0
 ip router isis A
exit
!
router isis A
 metric-style narrow <- NOT wide
exit
!
end
anlan (config)# int eth0
anlan (config-if)# no isis topology ipv6-unicast
% Configuration failed.

Error type: validation
Error description: Multi topology IS-IS can only be used with wide metrics
```

The MT commands are mainly controlled by the binded area, not by interface.
Currently if there is any MT configuration in the area, `metric-style` must
be with the `wide` mode, this requirement is sufficient.  So, the
unnecessary/wrong check for MT in the interface should be removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
(cherry picked from commit 424cec61c0)
2024-10-08 05:11:10 +00:00
Donatas Abraitis
4daa9b2e3a
Merge pull request #17003 from FRRouting/mergify/bp/stable/10.1/pr-17000
zebra: Fix crash during reconnect (backport #17000)
2024-10-07 11:26:33 +03:00
Igor Zhukov
bcfd0ad4ba zebra: Fix crash during reconnect
fpm_enqueue_rmac_table expects an fpm_rmac_arg* as its argument.

The issue can be reproduced by dropping the TCP session using:

ss -K dst 127.0.0.1 dport = 2620

I used Fedora 40 and frr 9.1.2 and I got the gdb backtrace:

(gdb) bt
0  0x00007fdd7d6997ea in fpm_enqueue_rmac_table (bucket=0x2134dd0, arg=0x2132b60) at zebra/dplane_fpm_nl.c:1217
1  0x00007fdd7dd1560d in hash_iterate (hash=0x21335f0, func=0x7fdd7d6997a0 <fpm_enqueue_rmac_table>, arg=0x2132b60) at lib/hash.c:252
2  0x00007fdd7dd1560d in hash_iterate (hash=0x1e5bf10, func=func@entry=0x7fdd7d698900 <fpm_enqueue_l3vni_table>,
    arg=arg@entry=0x7ffed983bef0) at lib/hash.c:252
3  0x00007fdd7d698b5c in fpm_rmac_send (t=<optimized out>) at zebra/dplane_fpm_nl.c:1262
4  0x00007fdd7dd6ce22 in event_call (thread=thread@entry=0x7ffed983c010) at lib/event.c:1970
5  0x00007fdd7dd20758 in frr_run (master=0x1d27f10) at lib/libfrr.c:1213
6  0x0000000000425588 in main (argc=10, argv=0x7ffed983c2e8) at zebra/main.c:492

Signed-off-by: Igor Zhukov <fsb4000@yandex.ru>
(cherry picked from commit a3877e4444)
2024-10-04 11:41:59 +00:00
Jafar Al-Gharaibeh
086d067b0c
Merge pull request #16996 from FRRouting/mergify/bp/stable/10.1/pr-16934
*: Modify clang-format column limit to 100 (backport #16934)
2024-10-03 20:08:42 -05:00