Commit Graph

36886 Commits

Author SHA1 Message Date
Donald Sharp
f640f0714c
Merge pull request #17345 from FRRouting/mergify/bp/dev/10.2/pr-17115
nhrpd: fix passphrase handling, add topotest for resolution request (backport #17115)
2024-11-05 14:28:10 -05:00
Donald Sharp
0533efc5e4
Merge pull request #17357 from FRRouting/mergify/bp/dev/10.2/pr-17326
zebra: fix missing kernel routes (backport #17326)
2024-11-05 14:27:53 -05:00
Donald Sharp
4f823efd63
Merge pull request #17352 from FRRouting/mergify/bp/dev/10.2/pr-17319
ospfd: Use router_id what Zebra has if we remove a static router_id (backport #17319)
2024-11-05 14:26:20 -05:00
Jafar Al-Gharaibeh
530b71b0ac
Merge pull request #17347 from FRRouting/mergify/bp/dev/10.2/pr-17305
bgpd: Treat numbered community-list only if it's in a range 1-500 (backport #17305)
2024-11-05 12:14:02 -06:00
anlan_cs
ac1bd83312 test: add test case for kernel blackhole routes
The test verifies that a kernel blackhole route is not affected by
interface's link change.

Signed-off-by: anlan_cs <anlan_cs@126.com>
(cherry picked from commit 0073a870d1)
2024-11-05 15:22:24 +00:00
anlan_cs
3cb4dcda5c zebra: fix missing kernel routes
The `rib_update_handle_kernel_route_down_possibility()` didn't consider
the kernel routes ( blackhole )  without interface.  When some other
interfaces are down, these kernel routes will be wrongly removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
(cherry picked from commit 44a82da405)
2024-11-05 15:22:23 +00:00
Donatas Abraitis
efb2f7c080 ospfd: Use router_id what Zebra has if we remove a static router_id
If we set router-id, e.g. `router-id x.x.x.x`, then we have:

```
pc.donatas.net# show ip ospf | include Router ID
 OSPF Routing Process, Router ID: x.x.x.x
```

But once we remove it (`no router-id x.x.x.x`), the old router-id remains.

This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra
already has, instead of retaining the old one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1073e0f9b3)
2024-11-05 15:20:52 +00:00
Donatas Abraitis
4e65bbc825 ospfd: Add a hidden command for old no router-id
A new command is `ospf router-id ...`, but the old one is also valid. Just a no
form was missed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 80bfe6784f)
2024-11-05 15:20:52 +00:00
Donatas Abraitis
8d1ade44be bgpd: Treat numbered community-list only if it's in a range 1-500
Before this patch, if we set something like:

```
bgp extcommunity-list expanded 1234 permit admin
```

In running config we have:

```
bgp extcommunity-list 1234 seq 5 permit admin
```

That leads to incorrect rendering, even more the line can't be deleted.

With this fix we treat numbered community-list only if it's inside the range
1-500, otherwise it's a non-numbered clist.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 4c1ee29116)
2024-11-05 15:17:25 +00:00
Joshua Muthii
a5c5a2fd24 nhrpd: Modify NHRP authentication feature logging
Modified nhrp_connection_authorized(). Initially, when writing debug
information about incoming NHRP packets with authentication enabled,
the nhrp_connection_authorized() function would print the
passphrase of the incoming packet as if it were a null terminated
string. This meant that if the passphrase on the incoming packet
had non ASCII-complient bytes in it, it would attempt to print those
bytes anyway. There was also no check that the size of the passphrase in
the incoming packet matched the size of the passphrase on the interface.
The changes in this commit log the passphrase on the incoming packet as
well as the passphrase on interface in HEX to avoid issues with ASCII.
It also performs a check that accounts for the sizes of the two different
passphrases

Moved CISCO_PASS_LENGTH_LEN from nhrp_vty.c to nhrp_protocol.h
for easier access  to the macro in other files

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
(cherry picked from commit 5718ee37c7)
2024-11-05 15:11:07 +00:00
Joshua Muthii
e127b7f464 nhrpd: Add topotest for retrying resolution request
Modified nhrp_topo topotest to test for newly added resolution
request retry feature. Changes to the topotest include adding a spoke to the
existing nhrp_topo topotest so that a topology with two spokes and hub
can be used to create shortcuts and test the sending/resending of
resolution requests and responses between spoke and hub. The resolution
request retry feature was tested by blocking incoming resolution requests on a
receiving nodes to stop the creation of a successful shortcut - which
then triggered the sending spoke to retry sending resolution requests

Signed-off-by: Joshua Muthii <jmuthii@labn.net>
(cherry picked from commit d599aa1da6)
2024-11-05 15:11:07 +00:00
Jafar Al-Gharaibeh
02f4fef5ff
Merge pull request #17325 from FRRouting/mergify/bp/dev/10.2/pr-17317
tests: Add an ability to specify daemon params with unified config (backport #17317)
2024-11-01 09:03:27 -05:00
Mark Stapp
6fbc39904b
Merge pull request #17321 from FRRouting/mergify/bp/dev/10.2/pr-17318
zebra: Add missing new line for help string (backport #17318)
2024-10-31 12:00:42 -04:00
Donatas Abraitis
9474e8677e tests: Add an ability to specify daemon params with unified config
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 879466731b)
2024-10-31 13:55:51 +00:00
Donatas Abraitis
c8341f265f
Merge pull request #17300 from FRRouting/mergify/bp/dev/10.2/pr-17250
isisd: fix change flex-algorithm number from uint32 to uint8 (backport #17250)
2024-10-31 15:17:02 +02:00
Donatas Abraitis
644211270f zebra: Add missing new line for help string
```
  -A, --asic-offload        FRR is interacting with an asic underneath the linux kernel
      --v6-with-v4-nexthops Underlying dataplane supports v6 routes with v4 nexthops  -s, --nl-bufsize          Set netlink receive buffer size
```

Fixes: 1f5611c06d ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 25ae643996)
2024-10-31 13:14:40 +00:00
Jafar Al-Gharaibeh
4e23ebed1e
Merge pull request #17315 from FRRouting/mergify/bp/dev/10.2/pr-17310
doc: Create html_context before setting READTHEDOCS (backport #17310)
2024-10-30 16:16:25 -05:00
Jafar Al-Gharaibeh
01be55aa5c
Merge pull request #17309 from donaldsharp/backport_17254_10.2
Mrib nht wonky (backport #17254)
2024-10-30 14:36:56 -05:00
Donatas Abraitis
410b406afe doc: Create html_context before setting READTHEDOCS
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/envs/latest/lib/python3.11/site-packages/sphinx/config.py", line 529, in eval_config_file
    exec(code, namespace)  # NoQA: S102
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/frrouting/checkouts/latest/doc/user/conf.py", line 77, in <module>
    html_context["READTHEDOCS"] = True
    ^^^^^^^^^^^^
NameError: name 'html_context' is not defined

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ef9f698e04)
2024-10-30 18:14:56 +00:00
Donald Sharp
7ddbadd7f7 zebra: When installing a mroute, allow it to flow
Currently the mroute code was not allowing the mroute
to be sent to the dataplane.  This leaves us with a
situation where the routes being installed where never
being set as installed and additionally nht against
the mrib would not work if the route came into existence
after the nexthop tracking was asked for.

Turns out all the pieces where there to let this work.
Modify the code to pass it to the dplane and to send
it back up as having worked.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-30 07:47:32 -04:00
Donald Sharp
fb08f08ebb zebra: Add safi to some debugs
Trying to figure out what safi we are talking about is fun when
it is not put into the debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 811168ecc3)
2024-10-30 07:45:08 -04:00
Donald Sharp
d48fab2707 sharpd: Allow sharpd to watch nexthops in the mrib
Nothing special here, just allow sharpd to ask to watch
nexthops in the mrib.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit aff8eaa4a2)
2024-10-30 07:45:02 -04:00
Philippe Guibert
909e6dd621 isisd: fix change flex-algorithm number from uint32 to uint8
The algorithm number is encoded on 8 bits and does not require
an unsigned 32 bit value to store the value.

Fixes: cc4926c128 ("isisd,yang: add algorithm-prefix-sid configuration tree")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 8e861a75e8)
2024-10-30 08:43:56 +00:00
Russ White
0aacf8f93a
Merge pull request #17291 from FRRouting/mergify/bp/dev/10.2/pr-17245
bgpd:  fix crash when polling bgp4v2PathAttrTable (backport #17245)
2024-10-29 10:22:54 -04:00
Francois Dumontet
2432b6481e 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:12:51 +00:00
Donatas Abraitis
dbda55017c
Merge pull request #17282 from FRRouting/mergify/bp/dev/10.2/pr-17278
bgpd: fix blank line in running-config with bmp listener cmd (backport #17278)
2024-10-29 13:17:07 +02:00
Philippe Guibert
a6cda19865 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:17 +00:00
Jafar Al-Gharaibeh
354537aa8d
Merge pull request #17277 from FRRouting/mergify/bp/dev/10.2/pr-17157
tests: logger masked in topotest.py (backport #17157)
2024-10-28 13:21:17 -05:00
Jafar Al-Gharaibeh
e144cc3ea7
Merge pull request #17265 from FRRouting/mergify/bp/dev/10.2/pr-16354
bgpd: add bgp ipv6-auto-ra command (backport #16354)
2024-10-28 12:53:35 -05:00
Jafar Al-Gharaibeh
36527bab2d
Merge pull request #17272 from FRRouting/mergify/bp/dev/10.2/pr-17243
bgpd: fix display of local label in show bgp (backport #17243)
2024-10-28 12:37:30 -05:00
Liam Brady
9a830b3cf4 tests: logger masked in topotest.py
a local logger masks the global logger and prevents errors from being
gracefully handled within topotest.py

Signed-off-by: Liam Brady <lbrady@labn.net>
(cherry picked from commit 1b38f33041)
2024-10-28 15:17:56 +00:00
Louis Scalbert
ebe0388c7d 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
f4f0e2cd38
Merge pull request #17258 from FRRouting/mergify/bp/dev/10.2/pr-17160
lib, zebra: Keep `zebra on-rib-process script` in frr.conf (backport #17160)
2024-10-28 08:56:04 -05:00
Mikhail Sokolovskiy
87823585cb 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>
(cherry picked from commit 7b1c0c23fc)
2024-10-28 12:30:10 +00:00
Jafar Al-Gharaibeh
f6ef4e91e3
Merge pull request #17256 from FRRouting/mergify/bp/dev/10.2/pr-17216
pimd, tests: fix bsr assert and expand topotest to pimv6 (backport #17216)
2024-10-27 23:41:15 -05:00
Donatas Abraitis
b65f4ad423 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:50 +00:00
Jafar Al-Gharaibeh
288d27431d tests: expand bsr topotest to cover ipv6
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit a7e7cc301d)
2024-10-27 19:12:49 +00:00
Jafar Al-Gharaibeh
d2dd5da999 pimd: allow a bsr with higher priority to take over
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 4e74183d0f)
2024-10-27 19:12:49 +00:00
Jafar Al-Gharaibeh
943b96b181 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>
(cherry picked from commit 8fbd88c5a7)
2024-10-27 19:12:48 +00:00
Donald Sharp
4309d9148b
Merge pull request #17232 from FRRouting/mergify/bp/dev/10.2/pr-17215
pimd: PIM autorp no path RP fix (backport #17215)
2024-10-25 07:34:00 -04:00
Donatas Abraitis
6b6422899b
Merge pull request #17234 from FRRouting/mergify/bp/dev/10.2/pr-17199
bgpd: compare aigp after local route check in bgp_path_info_cmp() (backport #17199)
2024-10-25 13:10:24 +03:00
Enke Chen
9be765d9ae 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 07:00:48 +00:00
Enke Chen
5d953ab5b2 tests: add a new BGP AIGP topotest
The topotest verifies that a local route is favored irrespective
of its AIGP value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 1a2c3d684a)
2024-10-25 07:00:47 +00:00
Nathan Bahr
1ca967160c pimd: PIM autorp no path RP fix
Just because there is currently no path to the RP doesn't mean it failed to add.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
(cherry picked from commit 433fce647c)
2024-10-25 06:06:25 +00:00
Jafar Al-Gharaibeh
2368b6119e
Merge pull request #17221 from FRRouting/mergify/bp/dev/10.2/pr-17191
bgpd: fix uninitialized bgp_labels (backport #17191)
2024-10-24 16:10:18 -05:00
Louis Scalbert
5b78389959 bgpd: fix uninitialized labels
Fix uninitialized labels that cause multiple valgrind issues.

> ==3729602== Use of uninitialised value of size 8
> ==3729602==    at 0x492B493: hash_get (hash.c:140)
> ==3729602==    by 0x2629D2: bgp_labels_intern (bgp_label.c:98)
> ==3729602==    by 0x2E6C92: bgp_adj_out_set_subgroup (bgp_updgrp_adv.c:622)
> ==3729602==    by 0x2A6810: subgroup_process_announce_selected (bgp_route.c:3340)
> ==3729602==    by 0x2E5FF6: group_announce_route_walkcb (bgp_updgrp_adv.c:260)
> ==3729602==    by 0x2E3E28: update_group_walkcb (bgp_updgrp.c:1759)
> ==3729602==    by 0x492B9A0: hash_walk (hash.c:270)
> ==3729602==    by 0x2E498C: update_group_af_walk (bgp_updgrp.c:2090)
> ==3729602==    by 0x2E7C0D: group_announce_route (bgp_updgrp_adv.c:1119)
> ==3729602==    by 0x2A796E: bgp_process_main_one (bgp_route.c:3865)
> ==3729602==    by 0x2A808A: bgp_process_wq (bgp_route.c:3991)
> ==3729602==    by 0x49CC7CF: work_queue_run (workqueue.c:282)
> ==3729602==    by 0x49BBF25: event_call (event.c:2019)
> ==3729602==    by 0x49413CA: frr_run (libfrr.c:1238)
> ==3729602==    by 0x1FD1D3: main (bgp_main.c:555)

> ==2604268== Use of uninitialised value of size 8
> ==2604268==    at 0x4943016: hash_get (hash.c:159)
> ==2604268==    by 0x26EFC1: bgp_labels_intern (bgp_label.c:97)
> ==2604268==    by 0x28077B: leak_update (bgp_mplsvpn.c:1298)
> ==2604268==    by 0x2824A3: vpn_leak_from_vrf_update (bgp_mplsvpn.c:1932)
> ==2604268==    by 0x2C281C: bgp_static_update (bgp_route.c:6974)
> ==2604268==    by 0x2C366F: bgp_static_set (bgp_route.c:7263)
> ==2604268==    by 0x2C435B: bgp_network_magic (bgp_route.c:7556)
> ==2604268==    by 0x2ACF09: bgp_network (bgp_route_clippy.c:86)
> ==2604268==    by 0x4914EE7: cmd_execute_command_real (command.c:1003)
> ==2604268==    by 0x4915060: cmd_execute_command (command.c:1062)
> ==2604268==    by 0x4915610: cmd_execute (command.c:1228)
> ==2604268==    by 0x49E7C32: vty_command (vty.c:625)
> ==2604268==    by 0x49E9B56: vty_execute (vty.c:1388)
> ==2604268==    by 0x49EC331: vtysh_read (vty.c:2400)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: ddb5b4880b ("bgpd: vpn-vrf route leaking")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 3225b778ca)
2024-10-24 14:37:12 +00:00
Louis Scalbert
993cb692db bgpd: fix allocating uninitialized bgp_labels
Memory was not zeroed at allocation.

> ==2604268== Conditional jump or move depends on uninitialised value(s)
> ==2604268==    at 0x26F026: bgp_labels_unintern (bgp_label.c:116)
> ==2604268==    by 0x30000C: adj_free (bgp_updgrp_adv.c:81)
> ==2604268==    by 0x3019EE: bgp_adj_out_remove_subgroup (bgp_updgrp_adv.c:728)
> ==2604268==    by 0x30537C: subgroup_withdraw_packet (bgp_updgrp_packet.c:1042)
> ==2604268==    by 0x2970AF: bgp_generate_updgrp_packets (bgp_packet.c:508)
> ==2604268==    by 0x49E06F1: event_call (event.c:2001)
> ==2604268==    by 0x495AB8B: frr_run (libfrr.c:1238)
> ==2604268==    by 0x200C4B: main (bgp_main.c:555)

Fixes: 3c86f776f0 ("bgpd: add bgp_labels hash")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit dd10379b3e)
2024-10-24 14:37:11 +00:00
Donatas Abraitis
fceb618186
Merge pull request #17201 from FRRouting/mergify/bp/dev/10.2/pr-17198
Revert "lib: Attach stdout to child only if --log=stdout and stdout F… (backport #17198)
2024-10-23 09:18:44 +03:00
Donald Sharp
77e0dc9261 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:36:35 +00:00
Russ White
c471385a21
Merge pull request #17195 from FRRouting/mergify/bp/dev/10.2/pr-17165
bgpd: Do not filter no-export community for BGP OAD (backport #17165)
2024-10-22 15:25:45 -04:00