Commit Graph

35967 Commits

Author SHA1 Message Date
Mark Stapp
b71fd2f68f bfdd: retain remote dplane client socket
When using bfd in remote-dataplane client mode, don't close
a new client socket if we're going to try to use it.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit f511530788)
2024-11-20 19:06:18 +00:00
Donald Sharp
0994cb293e
Merge pull request #17447 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_10.1
bgpd: Validate both nexthop information (NEXTHOP and NLRI) (backport)
2024-11-19 09:28:54 -05:00
Donatas Abraitis
af4f6f4395 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:19:19 +02:00
Jafar Al-Gharaibeh
a5755342e2
Merge pull request #17438 from FRRouting/mergify/bp/stable/10.1/pr-17432
bgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers (backport #17432)
2024-11-16 19:31:12 -06:00
Rajasekar Raja
67fea9157b bgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers
In cases such as 'no advertise-all-vni' and L2 VNI DELETE, we need to
pop all the VPN routes present in the bgp_zebra_announce FIFO yet to
be processed regardless of VNI is configured or not.

NOTE: NO need to pop the VPN routes in two cases
 1) In free_vni_entry
   - Called by bgp_free()->bgp_evpn_cleanup().
   - Since bgp_delete is called before bgp_free and we pop all the dest
     pertaining to bgp under delete.
 2) evpn_delete_vni() when user configures "no vni" since the withdraw
    of all routes happen in normal cycle.

Fixes: a07df6f754
("bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation")

Ticket :#4163611

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 898852f269)
2024-11-16 10:53:01 +00:00
Russ White
549e39a18e
Merge pull request #17412 from FRRouting/mergify/bp/stable/10.1/pr-17409
bgpd: fix resolvedPrefix in show nexthop json output (backport #17409)
2024-11-12 10:04:02 -05:00
Russ White
575532953b
Merge pull request #17402 from opensourcerouting/fix/backport_031d4271018e827010abfa8f3ecfe60bbf1de21d_10.1
bgpd: Fix for match source-protocol in route-map for redistribute cmd (backport)
2024-11-12 10:01:48 -05:00
Krishnasamy R
978a3cdcfd bgpd: fix resolvedPrefix in show nexthop json output
While populating  the nexthop info for "show bgp nexthop json", resolvedPrefix
is added in parent json object instead of json_nexthop object.
This results in displaying wrong resolvedPrefix for nexthops.
Fixing the same by adding resolvedPrefix to json_nexthop object, so that
the proper resolvedPrefix would be displayed for the respective nexthop

Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
(cherry picked from commit 95c08e082c)
2024-11-11 15:11:39 +00:00
Rajasekar Raja
f93e5aa166 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>
2024-11-10 19:11:44 +02:00
Donald Sharp
7f28c4786a
Merge pull request #17392 from opensourcerouting/fix/backport_17376_10.1
bgpd: Clear stale routes with multiple paths (backport)
2024-11-08 11:12:50 -05:00
Donatas Abraitis
a603771fd7 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:57:18 +02:00
Donatas Abraitis
6225c5de8b 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:56:18 +02:00
Donald Sharp
6b98c2acc8
Merge pull request #17348 from FRRouting/mergify/bp/stable/10.1/pr-17305
bgpd: Treat numbered community-list only if it's in a range 1-500 (backport #17305)
2024-11-05 14:27:20 -05:00
Donald Sharp
7f464c7af0
Merge pull request #17353 from FRRouting/mergify/bp/stable/10.1/pr-17319
ospfd: Use router_id what Zebra has if we remove a static router_id (backport #17319)
2024-11-05 14:25:22 -05:00
Donatas Abraitis
d12ea7dd8d 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:02 +00:00
Donatas Abraitis
e283627fe0 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:01 +00:00
Donatas Abraitis
e8cf0e581b 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:32 +00:00
Mark Stapp
73765eda41
Merge pull request #17322 from FRRouting/mergify/bp/stable/10.1/pr-17318
zebra: Add missing new line for help string (backport #17318)
2024-10-31 12:02:42 -04:00
Donatas Abraitis
06ced047f7
Merge pull request #17301 from FRRouting/mergify/bp/stable/10.1/pr-17250
isisd: fix change flex-algorithm number from uint32 to uint8 (backport #17250)
2024-10-31 17:21:13 +02:00
Donatas Abraitis
1907f215ba 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:17 +00:00
Philippe Guibert
e61379f38c 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:02 +00:00
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