Commit Graph

35214 Commits

Author SHA1 Message Date
Donatas Abraitis
38d741be2c FRR Release 10.0.3
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-23 23:26:08 +02:00
Jafar Al-Gharaibeh
6cc954085c
Merge pull request #17714 from opensourcerouting/fix/backport_b6dcf618777bb7a11176617d647e16ab64f49b7b_10.0
bgpd: Fix `enforce-first-as` per peer-group removal (backport)
2024-12-22 22:49:01 -06:00
Donatas Abraitis
327d08bebb bgpd: Fix enforce-first-as per peer-group removal
If we do `no neighbor PG enforce-first-as`, it wasn't working because the flag
was inherited incorrectly for the members of the peer-group.

Fixes: 322462920e ("bgpd: Enable enforce-first-as by default")

Closes: https://github.com/FRRouting/frr/issues/17702

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-22 13:30:10 +02:00
Jafar Al-Gharaibeh
a2c3cfa5ef
Merge pull request #17701 from opensourcerouting/fix/backport_b0800bfdf04b4fcf48504737ebfe4ba7f05268d3
bgpd: Validate only affected RPKI prefixes instead of a full RIB (backport)
2024-12-21 22:55:10 -06:00
Donatas Abraitis
01531d74c4
Merge pull request #17688 from FRRouting/mergify/bp/stable/10.0/pr-17669
bgpd: fix memory leak when reconfiguring a route distinguisher (backport #17669)
2024-12-21 22:21:02 +02:00
Donatas Abraitis
5b51fbda0c bgpd: Validate only affected RPKI prefixes instead of a full RIB
Before this fix, if rpki_sync_socket_rtr socket returns EAGAIN, then ALL routes
in the RIB are revalidated which takes lots of CPU and some unnecessary traffic,
e.g. if using BMP servers. With a full feed it would waste 50-80Mbps.

Instead we should try to drain an existing pipe (another end), and revalidate
only affected prefixes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-12-20 23:09:32 +02:00
Philippe Guibert
fee57833d7 bgpd: fix memory leak when reconfiguring a route distinguisher
A memory leak happens when reconfiguring an already configured route
distinguisher on an L3VPN BGP instance. Fix this by freeing the previous
route distinguisher.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 0dd96287dd)
2024-12-20 14:16:07 +00:00
Jafar Al-Gharaibeh
80f5df3f09
Merge pull request #17680 from FRRouting/mergify/bp/stable/10.0/pr-17675
bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)
2024-12-19 20:19:06 -06:00
Donatas Abraitis
5d0cef584f bgpd: Fix memory leak when creating BMP connection with a source interface
Testing done with:

```
for x in $(seq 1 100000); do vtysh -c 'conf' -c 'router bgp' -c 'bmp targets test' -c 'bmp connect localhost port 123 min-retry 100 max-retry 100 source-interface lo'; done
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7d19cb59cf)
2024-12-19 21:56:16 +00:00
Jafar Al-Gharaibeh
cbe7fc3a98
Merge pull request #17658 from FRRouting/mergify/bp/stable/10.0/pr-17615
lib: Take ge/le into consideration when checking the prefix with the prefix-list (backport #17615)
2024-12-17 18:38:52 -06:00
Donatas Abraitis
9df941700a lib: Take ge/le into consideration when checking the prefix with the prefix-list
Without the fix:

```
show ip prefix-list test_1 10.20.30.96/27 first-match
 <no result>

show ip prefix-list test_2 192.168.1.2/32 first-match
 <no result>
```

With the fix:

```
ip prefix-list test_1 seq 10 permit 10.20.30.64/26 le 27
!
end
donatas# show ip prefix-list test_1 10.20.30.96/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 1, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/27
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 2, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.64/28
donatas# show ip prefix-list test_1 10.20.30.126/26
   seq 10 permit 10.20.30.64/26 le 27 (hit count: 3, refcount: 0)
donatas# show ip prefix-list test_1 10.20.30.126/30
donatas#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit dd4c2acc2e)
2024-12-17 16:32:34 +00:00
Donald Sharp
5af15b0f0f
Merge pull request #17632 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a8b08a35fe9a172c4b_10.0
bgpd: Fix bgp core with a possible Intf delete (backport)
2024-12-11 07:20:36 -05:00
Rajasekar Raja
9c20cd200b bgpd: Fix bgp core with a possible Intf delete
Although trigger unknown, based on the backtrace in one of the internal
testing, we do see some delete in the Intf where we can have the peer
ifp pointer null and we try to dereference it while trying to install
the route leading to a crash

Skip updating the ifindex in such cases and since the nexthop is not
properly updated, BGP skips sending it to zebra.

BackTrace:
0  0x00007faef05e7ebc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007faef0598fb2 in raise () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007faef09900dc in core_handler (signo=11, siginfo=0x7ffdde8cb4b0, context=<optimized out>) at lib/sigevent.c:274
3  <signal handler called>
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
   nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
5  bgp_zebra_announce_actual (dest=dest@entry=0x5560afcfa950, info=0x5560b21187d0, bgp=0x5560ace04df0) at bgpd/bgp_zebra.c:1521
6  0x00005560aad4bc85 in bgp_handle_route_announcements_to_zebra (e=<optimized out>) at bgpd/bgp_zebra.c:1896
7  0x00007faef09a1c0d in thread_call (thread=thread@entry=0x7ffdde8d7580) at lib/thread.c:2008
8  0x00007faef095a598 in frr_run (master=0x5560ac7e5190) at lib/libfrr.c:1223
9  0x00005560aac65db6 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:557

(gdb) f 4
4  0x00005560aad4b7d8 in update_ipv6nh_for_route_install (api_nh=0x7ffdde8cbe94, is_evpn=false, best_pi=0x5560b21187d0, pi=0x5560b21187d0, ifindex=0, nexthop=0x5560b03cb0dc,
    nh_bgp=0x5560ace04df0, nh_othervrf=0) at bgpd/bgp_zebra.c:1273
1273	in bgpd/bgp_zebra.c
(gdb) p pi->peer->ifp
$26 = (struct interface *) 0x0

Ticket :#4203904

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-12-11 10:54:24 +02:00
Jafar Al-Gharaibeh
e11efcd7b8
Merge pull request #17596 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf3e793346e23558901_10.0
bgpd: fix unconfigure asdot neighbor (backport)
2024-12-05 09:25:28 -06:00
Philippe Guibert
69c3e672a4 bgpd: fix unconfigure asdot neighbor
The below command is not successfull on an existing as dot peer

> no neighbor 10.0.0.2 remote-as 1.1
> % Create the peer-group or interface first

Handle the case where the remote-as argument can be an ASNUM.

Fixes: 8079a4138d ("lib, bgp: add initial support for asdot format")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-12-05 09:40:15 +02:00
Jafar Al-Gharaibeh
934b67b1e3
Merge pull request #17564 from FRRouting/mergify/bp/stable/10.0/pr-17518
pimd: Fix access-list memory leak in pimd (backport #17518)
2024-12-03 23:42:25 -06:00
Jafar Al-Gharaibeh
f9b320dd65
Merge pull request #17560 from FRRouting/mergify/bp/stable/10.0/pr-17313
zebra: separate zebra ZAPI server open and accept (backport #17313)
2024-12-03 21:49:46 -06:00
Corey Siltala
db1cb06557 pimd: Fix access-list memory leak in pimd
Reset access-lists in pimd on terminate

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
(cherry picked from commit d21a993f16)
2024-12-03 21:37:17 +00:00
Mark Stapp
9e67464d77 zebra: separate zebra ZAPI server open and accept
Separate zebra's ZAPI server socket handling into two phases:
an early phase that opens the socket, and a later phase that
starts listening for client connections.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit 506097a1b9)
2024-12-03 20:27:50 +00:00
Donatas Abraitis
dafe8e9d46
Merge pull request #17524 from FRRouting/mergify/bp/stable/10.0/pr-17510
bgpd: fix use single whitespace when displaying flowspec entries (backport #17510)
2024-11-28 07:53:56 +02:00
Philippe Guibert
9c78057ef9 bgpd: fix use single whitespace when displaying flowspec entries
There is an extra space in the 'Displayed' line of show bgp command,
that should not be present.
Fix this by being consistent with the output of the other address
families.

Fixes: ("a1baf9e84f71") bgpd: Use single whitespace when displaying show bgp summary
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 561debab54)
2024-11-26 18:12:40 +00:00
Russ White
61bcff83b6
Merge pull request #17513 from FRRouting/mergify/bp/stable/10.0/pr-17506
bgpd: fix version attribute is an int, not a string (backport #17506)
2024-11-26 11:49:27 -05:00
Philippe Guibert
cd238c71bb bgpd: fix version attribute is an int, not a string
The json display of the version attribute is originally an
integer. It has changed, most probably mistakenly.

> {
>   "vrfId": 7,
>   "vrfName": "vrf1",
>   "tableVersion": 3,
>   "routerId": "192.0.2.1",
>   "defaultLocPrf": 100,
>   "localAS": 65500,
>   "routes": {
>     "172.31.0.1/32": {
>       "prefix": "172.31.0.1/32",
>       "version": "1",		<--- int or string ??

Let us fix it, by using the integer display instead.

Fixes: f9f2d188e3 ("bgpd: fix 'json detail' output structure")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit c5d7815ccc)
2024-11-26 13:30:21 +00:00
Donald Sharp
0268aef6ad
Merge pull request #17489 from FRRouting/mergify/bp/stable/10.0/pr-17487
bgpd: Do not reset peers on suppress-fib toggling (backport #17487)
2024-11-22 18:33:44 -05:00
Donatas Abraitis
02d922c6b1 bgpd: Do not reset peers on suppress-fib toggling
If the desired state is the same - do nothing instead of resetting once again.

Fixes: bdb5ae8bce ("bgpd: Make suppress-fib-pending clear peering")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7fb4c03f5b)
2024-11-22 15:17:31 +00:00
Donald Sharp
321638388d
Merge pull request #17448 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_10.0
bgpd: Validate both nexthop information (NEXTHOP and NLRI) (backport)
2024-11-19 09:29:24 -05:00
Donatas Abraitis
91790796bc bgpd: Validate both nexthop information (NEXTHOP and NLRI)
If we receive an IPv6 prefix e.g.: 2001:db8:100::/64 with nextop: 0.0.0.0, and
mp_nexthop: fc00::2, we should not treat this with an invalid nexthop because
of 0.0.0.0. We MUST check for MP_REACH attribute also and decide later if we
have at least one a valid nexthop.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a0d2734e87)
2024-11-17 11:25:41 +02:00
Jafar Al-Gharaibeh
81c2fe3453
Merge pull request #17417 from FRRouting/mergify/bp/stable/10.0/pr-17402
bgpd: Fix for match source-protocol in route-map for redistribute cmd (backport) (backport #17402)
2024-11-12 11:45:12 -06:00
Rajasekar Raja
718b76fc3f bgpd: Fix for match source-protocol in route-map for redistribute cmd
A redistribute cmd can have a route-map attached to it and adding the
match source-protocol to that route-map means BGP to filter which
protocol routes to accept among the bunch of routes zebra is sending.

Fixing this since this wasnt implemented earlier.

Ticket :#4119692

Signed-off-by: Donald Sharp <sharpd@nvidia.com>

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 68358c0f92)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit f93e5aa166)
2024-11-12 15:02:54 +00:00
Russ White
930ee69279
Merge pull request #17405 from FRRouting/mergify/bp/stable/10.0/pr-15686
BGP TCP non established : get port and ip (backport #15686)
2024-11-12 10:02:11 -05:00
Philippe Guibert
9b50df7fe7 bgpd: fix addressing information of non established outgoing sessions
When trying to connect to a BGP peer that does not respons, the 'show
bgp neighbors' command does not give any indication on the local and
remote addresses used:

> # show bgp neighbors
>  BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:04,   Waiting for peer OPEN (n/a)
>   Internal BGP neighbor may be up to 255 hops away.
> BGP Connect Retry Timer in Seconds: 120
> Next connect timer due in 117 seconds
> Read thread: off  Write thread: off  FD used: 27

The addressing information (address and port) are only available
when TCP session is established, whereas this information is present
at the system level:

> root@ubuntu2204:~# netstat -pan | grep 192.0.2.1
> tcp        0      0 192.0.2.1:179           192.0.2.150:38060       SYN_RECV    -
> tcp        0      1 192.0.2.1:46526         192.0.2.150:179         SYN_SENT    488310/bgpd

Add the display for outgoing BGP session, as the information in
the getsockname() API provides information for connected streams.
When getpeername() API does not give any information, use the peer
configuration (destination port is encoded in peer->port).

> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:16,   Waiting for peer OPEN (n/a)
> Local host: 192.0.2.1, Local port: 46084
> Foreign host: 192.0.2.150, Foreign port: 179

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 78ce63952a)
2024-11-11 08:27:19 +00:00
Philippe Guibert
862a15da9b bgpd: remove useless control checks about TCP connection
When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.

Relaxing the error code for all the returned adressing.

Fixes: 1ff9a34058 ("bgpd: bgpd-fsm-fix.patch")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit ba71303099)
2024-11-11 08:27:19 +00:00
Donald Sharp
30129152c1
Merge pull request #17393 from opensourcerouting/fix/backport_17376_10.0
bgpd: Clear stale routes with multiple paths (backport)
2024-11-08 11:13:12 -05:00
Donatas Abraitis
896958317e bgpd: Set LLGR stale routes for all the paths including addpath
Without this patch we set only the first path for the route (if multiple exist)
as LLGR stale and stop doing that for the rest of the paths, which is wrong.

Fixes: 1479ed2fb3 ("bgpd: Implement LLGR helper mode")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-08 09:59:17 +02:00
Donatas Abraitis
099795ee61 bgpd: Clear all paths including addpath once GR expires
We iterated over all bgp_path_info's, but once we remove the path, we didn't
check for other paths under the same bgp_dest.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-08 09:58:48 +02:00
Donald Sharp
035b33f0db
Merge pull request #17349 from FRRouting/mergify/bp/stable/10.0/pr-17305
bgpd: Treat numbered community-list only if it's in a range 1-500 (backport #17305)
2024-11-05 14:27:07 -05:00
Donald Sharp
08c1bb1e86
Merge pull request #17354 from FRRouting/mergify/bp/stable/10.0/pr-17319
ospfd: Use router_id what Zebra has if we remove a static router_id (backport #17319)
2024-11-05 14:25:10 -05:00
Donatas Abraitis
a5fe2ec138 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:21:04 +00:00
Donatas Abraitis
45a9295d87 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:21:04 +00:00
Donatas Abraitis
791cd3657c 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:31 +00:00
Mark Stapp
1b56305c73
Merge pull request #17323 from FRRouting/mergify/bp/stable/10.0/pr-17318
zebra: Add missing new line for help string (backport #17318)
2024-10-31 13:26:11 -04:00
Donatas Abraitis
c138594830
Merge pull request #17302 from FRRouting/mergify/bp/stable/10.0/pr-17250
isisd: fix change flex-algorithm number from uint32 to uint8 (backport #17250)
2024-10-31 17:21:22 +02:00
Donatas Abraitis
bdaf82c54d 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:15:24 +00:00
Philippe Guibert
6b1cf330c4 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:44:08 +00:00
Russ White
7dddef2a49
Merge pull request #17288 from opensourcerouting/16354-bp-10.0
(10.0 backport) bgpd: add `bgp ipv6-auto-ra` command
2024-10-29 10:28:11 -04:00
Russ White
5a19a51f09
Merge pull request #17284 from FRRouting/mergify/bp/stable/10.0/pr-17278
bgpd: fix blank line in running-config with bmp listener cmd (backport #17278)
2024-10-29 10:26:34 -04:00
Russ White
58f9e8ebc7
Merge pull request #17293 from FRRouting/mergify/bp/stable/10.0/pr-17245
bgpd:  fix crash when polling bgp4v2PathAttrTable (backport #17245)
2024-10-29 10:22:41 -04:00
Francois Dumontet
c35b299b9f 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:37 +00:00
Mikhail Sokolovskiy
44bf223d8b 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:12:19 +01:00
Philippe Guibert
5241a3652b 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