]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 months agobgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table 17892/head
Krishnasamy R [Tue, 21 Jan 2025 09:06:53 +0000 (01:06 -0800)]
bgpd: Fix for local interface MAC cache issue in 'bgp mac hash' table

Issue:
During FRR restart, we fail to add some of the local interface's MAC
to the 'bgp mac hash'. Not having local MAC in the hash table can cause
lookup issues while receiving EVPN RT-2.

Currently, we have code to add local MAC(bgp_mac_add_mac_entry) while handling
interface add/up events in BGP(bgp_ifp_up/bgp_ifp_create). But the code
'bgp_mac_add_mac_entry' in bgp_ifp_create is not getting invoked as it
is placed under a specific check(vrf->bgp link check).

Fix:
We can skip this check 'vrf->bgp link existence' as the tenant VRF might
not have BGP instance but still we want to cache the tenant VRF local
MACs. So keeping this check in bgp_ifp_create inline with bgp_ifp_up.

Ticket: #4204154

Signed-off-by: Krishnasamy R <krishnasamyr@nvidia.com>
(cherry picked from commit 016528364e686fb3b23a688707bd6ae6c5ea5f41)

3 months agoMerge pull request #17851 from FRRouting/mergify/bp/stable/10.1/pr-17832
Russ White [Tue, 14 Jan 2025 16:09:13 +0000 (11:09 -0500)]
Merge pull request #17851 from FRRouting/mergify/bp/stable/10.1/pr-17832

bgpd: Aggregate backports (backport #17832)

3 months agobgpd: fix memory leak in bgp_aggregate_install() 17851/head
Enke Chen [Thu, 9 Jan 2025 22:48:35 +0000 (14:48 -0800)]
bgpd: fix memory leak in bgp_aggregate_install()

Potential memory leak with as-set and matching-MED-only config.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 94ca6ddfae959a08e84a7a5a070f44ddba70f156)

3 months agobgpd: apply route-map for aggregate before attribute comparison
Enke Chen [Thu, 9 Jan 2025 01:34:29 +0000 (17:34 -0800)]
bgpd: apply route-map for aggregate before attribute comparison

Currently when re-evaluating an aggregate route, the full attribute of
the aggregate route is not compared with the existing one in the BGP
table. That can result in unnecessary churns (un-install and then
install) of the aggregate route when a more specific route is added or
deleted, or when the route-map for the aggregate changes. The churn
would impact route installation and route advertisement.

The fix is to apply the route-map for the aggregate first and then
compare the attribute.

Here is an example of the churn:

debug bgp aggregate prefix 5.5.5.0/24
!
route-map set-comm permit 10
 set community 65004:200
!
router bgp 65001
 address-family ipv4 unicast
  redistribute static
  aggregate-address 5.5.5.0/24 route-map set-comm
!

Step 1:
  ip route 5.5.5.1/32 Null0

Jan  8 10:28:49 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 1
Jan  8 10:28:49 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed

Step 2:
  ip route 5.5.5.2/32 Null0

Jan  8 10:29:03 enke-vm1 bgpd[285786]: [J7PXJ-A7YA2] bgp_aggregate_install: aggregate 5.5.5.0/24, count 2
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [S2EH5-EQSX6]   aggregate 5.5.5.0/24: existing, removed
Jan  8 10:29:03 enke-vm1 bgpd[285786]: [Y444T-HEVNG]   aggregate 5.5.5.0/24: installed
---

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 22d95f4ba8444171944eab29e99dfa6087813d6f)

3 months agoRevert "bgpd: Reinstall aggregated routes if using route-maps and it was changed"
Enke Chen [Wed, 8 Jan 2025 17:12:56 +0000 (09:12 -0800)]
Revert "bgpd: Reinstall aggregated routes if using route-maps and it was changed"

This reverts commit ee1986f1b5ae6b94b446b12e1b77cc30d8f5f46d.

The fix is incomplete, and is no longer needed with the fix that applies
the route-map for an aggregate and then compares the attribute.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 74c9d89aaf3df1b583de341169c4cb77eaa1b3b4)

3 months agoMerge pull request #17834 from FRRouting/mergify/bp/stable/10.1/pr-17813
Donald Sharp [Fri, 10 Jan 2025 18:35:34 +0000 (13:35 -0500)]
Merge pull request #17834 from FRRouting/mergify/bp/stable/10.1/pr-17813

bgpd: use igpmetric in bgp_aigp_metric_total() (backport #17813)

3 months agobgpd: use igpmetric in bgp_aigp_metric_total() 17834/head
Enke Chen [Thu, 9 Jan 2025 20:02:02 +0000 (12:02 -0800)]
bgpd: use igpmetric in bgp_aigp_metric_total()

Use igpmetric from bgp_path_info in bgp_igp_metric_total() to be
consistent with all other cases, e.g., as in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit b89e66a3bcd5644278f34ec5899b071066e102a1)

3 months agoMerge pull request #17816 from FRRouting/mergify/bp/stable/10.1/pr-17807
Donatas Abraitis [Fri, 10 Jan 2025 07:42:59 +0000 (09:42 +0200)]
Merge pull request #17816 from FRRouting/mergify/bp/stable/10.1/pr-17807

bgpd: fix crash in displaying json orf prefix-list (backport #17807)

3 months agobgpd: fix crash in displaying json orf prefix-list 17816/head
Louis Scalbert [Thu, 9 Jan 2025 17:28:53 +0000 (18:28 +0100)]
bgpd: fix crash in displaying json orf prefix-list

bgpd crashes when there is several entries in the prefix-list. No
backtrace is provided because the issue was catched from a code review.

Fixes: 856ca177c4 ("Added json formating support to show-...-neighbors-... bgp commands.")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 8ccf60921b85893d301186a0f8156fb702da379f)

3 months agobgpd: fix bgp orf prefix-list json prefix
Louis Scalbert [Thu, 9 Jan 2025 17:24:39 +0000 (18:24 +0100)]
bgpd: fix bgp orf prefix-list json prefix

0x<address>FX was displayed instead of the prefix.

Fixes: b219dda129 ("lib: Convert usage of strings to %pFX and %pRN")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit b7e843d7e8afe57d3815dbb44e30307654e73711)

3 months agoMerge pull request #17785 from FRRouting/mergify/bp/stable/10.1/pr-17780
Donald Sharp [Tue, 7 Jan 2025 18:11:58 +0000 (13:11 -0500)]
Merge pull request #17785 from FRRouting/mergify/bp/stable/10.1/pr-17780

bgpd: fix a bug in peer_allowas_in_set() (backport #17780)

3 months agoMerge pull request #17789 from FRRouting/mergify/bp/stable/10.1/pr-17725
Donald Sharp [Tue, 7 Jan 2025 18:08:43 +0000 (13:08 -0500)]
Merge pull request #17789 from FRRouting/mergify/bp/stable/10.1/pr-17725

isisd: Allow full `no` form for `domain-password` and `area-password` (backport #17725)

3 months agoisisd: Allow full `no` form for `domain-password` and `area-password` 17789/head
Donatas Abraitis [Thu, 26 Dec 2024 15:33:03 +0000 (17:33 +0200)]
isisd: Allow full `no` form for `domain-password` and `area-password`

Before:

```
LR1.wue3(config)# router isis VyOS
LR1.wue3(config-router)# no  area-password clear
% Unknown command: no  area-password clear
LR1.wue3(config-router)# no  area-password clear foo
% Unknown command: no  area-password clear foo
LR1.wue3(config-router)#
```

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a696547d6c78d4140649f96d6bef9a335fe5dfa5)

3 months agobgpd: fix a bug in peer_allowas_in_set() 17785/head
Enke Chen [Tue, 7 Jan 2025 05:01:14 +0000 (21:01 -0800)]
bgpd: fix a bug in peer_allowas_in_set()

Fix a bug in peer_allowas_in_set() so that the config takes effect
for peer-group members.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit bcd10177940223d86cbcfbe1818b2a0b29e0552b)

3 months agoMerge pull request #17764 from FRRouting/mergify/bp/stable/10.1/pr-17750
Jafar Al-Gharaibeh [Sun, 5 Jan 2025 22:06:09 +0000 (16:06 -0600)]
Merge pull request #17764 from FRRouting/mergify/bp/stable/10.1/pr-17750

tools: Add missing rpki keyword to vrf in frr-reload (backport #17750)

3 months agotools: Add missing rpki keyword to vrf in frr-reload 17764/head
Jonathan Voss [Fri, 3 Jan 2025 03:19:30 +0000 (03:19 +0000)]
tools: Add missing rpki keyword to vrf in frr-reload

When reloading the following configuration:
```
vrf red
 rpki
  rpki cache tcp 172.65.0.2 8282 preference 1
 exit
exit-vrf
```
frr-reload.py does not properly enter the `rpki` context
within a `vrf`. Because of this, it fails to apply RPKI
configurations.

Signed-off-by: Jonathan Voss <jvoss@onvox.net>
(cherry picked from commit 975ee8ed6eb22f68538f3446b29ca34d65bec72f)

3 months agoMerge pull request #17741 from FRRouting/mergify/bp/stable/10.1/pr-17731
Donatas Abraitis [Sat, 4 Jan 2025 11:52:05 +0000 (13:52 +0200)]
Merge pull request #17741 from FRRouting/mergify/bp/stable/10.1/pr-17731

zebra: Fix resetting valid flags for NHG dependents (backport #17731)

3 months agoMerge pull request #17756 from FRRouting/mergify/bp/stable/10.1/pr-17732
Donatas Abraitis [Sat, 4 Jan 2025 11:49:38 +0000 (13:49 +0200)]
Merge pull request #17756 from FRRouting/mergify/bp/stable/10.1/pr-17732

isisd: Show correct level information for `show isis interface detail json` (backport #17732)

3 months agoisisd: Show correct level information for `show isis interface detail json` 17756/head
Donatas Abraitis [Mon, 30 Dec 2024 08:31:44 +0000 (10:31 +0200)]
isisd: Show correct level information for `show isis interface detail json`

Having this configuration:

```
!
interface r1-eth0
 ip address 10.0.0.1/30
 ip router isis 1
 isis priority 44 level-1
 isis priority 88 level-2
 isis csnp-interval 90 level-1
 isis csnp-interval 99 level-2
 isis psnp-interval 70 level-1
 isis psnp-interval 50 level-2
 isis hello-interval level-1 120
 isis hello-interval level-2 150

!
interface r1-eth1
 ip address 10.0.0.10/30
 ip router isis 1
!
interface lo
 ip address 192.0.2.1/32
 ip router isis 1
 isis passive
!
router isis 1
net 49.0000.0000.0000.0001.00
 metric-style wide
```

Produces:

```
{
 "areas":[
   {
     "area":"1",
     "circuits":[
       {
         "circuit":2,
         "interface":{
           "name":"r1-eth0",
           "state":"Up",
           "is-passive":"active",
           "circuit-id":"0x2",
           "type":"lan",
           "level":"L1L2",
           "snpa":"6e28.9c92.da5e",
           "levels":[
             {
               "level":"L1",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120,
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90,
               "psnp-interval":70,
               "lan":{
                 "priority":44,
                 "is-dis":"no"
               }
             },
             {
               "level":"L2",
               "metric":10,
               "active-neighbors":1,
               "hello-interval":120, <<<<<<<<<<<<<<<<<<
               "holddown":{
                 "count":10,
                 "pad":"yes"
               },
               "cnsp-interval":90, <<<<<<<<<<<<<<<<<<
               "psnp-interval":70, <<<<<<<<<<<<<<<<<<
               "lan":{
                 "priority":44, <<<<<<<<<<<<<<<<<<
                 "is-dis":"no"
               }
             }
           ],
...
```

Fixes: 9fee4d4c6038ef6b14e9f509d6b04d189660c4cd ("isisd: Add json to show isis interface command.")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 360a0d6f4ca68fda0eb5d64a8633018a3b5a4a1d)

3 months agozebra: Fix resetting valid flags for NHG dependents 17741/head
Donald Sharp [Sun, 29 Dec 2024 06:40:37 +0000 (22:40 -0800)]
zebra: Fix resetting valid flags for NHG dependents

Upon if_down, we don't reset the valid flag for dependents
and unset the INSTALLED flag.

So when its time for the NHG to be deleted (routes dereferenced),
zebra deletes it since refcnt goes to 0, but stale NHG remains in kernel.

Ticket :#4200788

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 54ec9f38884fb63e045732537c4c1f4a94608987)

4 months agoFRR Release 10.1.2 rc/10.1.2 docker/10.1.2 frr-10.1.2
Donatas Abraitis [Mon, 23 Dec 2024 21:07:38 +0000 (23:07 +0200)]
FRR Release 10.1.2

- babeld
-   Do not remove route when replacing
-   Send the route's metric down to zebra.
- bfdd
-   Add no variants to interval configurations
-   Retain remote dplane client socket
- bgpd
-   Actually make ` --v6-with-v4-nexthops` it work
-   Add `bgp ipv6-auto-ra` command
-   Allow value 0 in aigp-metric setting
-   Avoid use-after-free when doing `no router bgp` with auto created instances
-   Fix to pop items off zebra_announce FIFO for few EVPN triggers
-   Clear all paths including addpath once GR expires
-   Compare aigp after local route check in bgp_path_info_cmp()
-   Do not filter no-export community for BGP OAD (one administration domain)
-   Do not reset peers on suppress-fib toggling
-   EVPN fix per rd specific type-2 json output
-   Fix bgp core with a possible Intf delete
-   Fix blank line in running-config with bmp listener cmd
-   Fix crash when polling bgp4v2PathAttrTable
-   Fix display of local label in show bgp
-   Fix `enforce-first-as` per peer-group removal
-   Fix evpn bestpath calculation when path is not established
-   Fix evpn mh esi flap remove local routes
-   Fix for match source-protocol in route-map for redistribute cmd
-   Fix memory leak when creating BMP connection with a source interface
-   Fix memory leak when reconfiguring a route distinguisher
-   Fix printfrr_bp for non initialized peers
-   Fix resolvedPrefix in show nexthop json output
-   Fix route selection with AIGP
-   Fix several issues in sourcing AIGP attribute
-   Fix unconfigure asdot neighbor
-   Fix use single whitespace when displaying flowspec entries
-   Fix version attribute is an int, not a string
-   Include structure when installing End.DT4/6 SID
-   Include structure when installing End.DT46 SID
-   Include structure when removing End.DT4/6 SID
-   Include structure when removing End.DT46 SID
-   Move some non BGP-specific route-map functions to lib
-   Set LLGR stale routes for all the paths including addpath
-   Treat numbered community-list only if it's in a range 1-500
-   Validate both nexthop information (NEXTHOP and NLRI)
-   Validate only affected RPKI prefixes instead of a full RIB
- isisd
-   Fix change flex-algorithm number from uint32 to uint8
-   Fix memory leaks when the transition of neighbor state from non-UP to DOWN
-   Fix rcap tlv double-free crash
-   Fix wrong check for MT commands
- lib
-   Attach stdout to child only if --log=stdout and stdout FD is a tty
-   Include SID structure in seg6local nexthop
-   Take ge/le into consideration when checking the prefix with the prefix-list
-   Keep `zebra on-rib-process script` in frr.conf
- nhrpd
-   Fixes duplicate auth extension
- ospfd
-   Add a hidden command for old `no router-id`
-   Fix heap corruption vulnerability when parsing SR-Algorithm TLV
-   Fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands
-   Interface 'ip ospf neighbor-filter' startup config not applied.
-   Use router_id what Zebra has if we remove a static router_id
- pimd
-   Allow resolving bsr via directly connected secondary address
-   Fix access-list memory leak in pimd
- vrrpd
-   Iterate over all ancillary messages
- zebra
-   Add missing new line for help string
-   Add missing proto translations
-   Correctly report metrics
-   Fix crash during reconnect
-   Fix heap-use-after free on ns shutdown
-   Fix snmp walk of zebra rib
-   Let's use memset instead of walking bytes and setting to 0
-   Separate zebra ZAPI server open and accept
-   Unlock node only after operation in zebra_free_rnh()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17697 from FRRouting/mergify/bp/stable/10.1/pr-17586
Donatas Abraitis [Mon, 23 Dec 2024 20:10:07 +0000 (22:10 +0200)]
Merge pull request #17697 from FRRouting/mergify/bp/stable/10.1/pr-17586

bgpd: Validate only affected RPKI prefixes instead of a full RIB (backport #17586)

4 months agoMerge pull request #17679 from FRRouting/mergify/bp/stable/10.1/pr-17675
Jafar Al-Gharaibeh [Mon, 23 Dec 2024 04:50:40 +0000 (22:50 -0600)]
Merge pull request #17679 from FRRouting/mergify/bp/stable/10.1/pr-17675

bgpd: Fix memory leak when creating BMP connection with a source interface (backport #17675)

4 months agoMerge pull request #17713 from opensourcerouting/fix/backport_b6dcf618777bb7a11176617...
Jafar Al-Gharaibeh [Mon, 23 Dec 2024 04:48:37 +0000 (22:48 -0600)]
Merge pull request #17713 from opensourcerouting/fix/backport_b6dcf618777bb7a11176617d647e16ab64f49b7b_10.1

bgpd: Fix `enforce-first-as` per peer-group removal (backport)

4 months agobgpd: Fix `enforce-first-as` per peer-group removal 17713/head
Donatas Abraitis [Sat, 21 Dec 2024 15:03:14 +0000 (17:03 +0200)]
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: 322462920e2a2c8b73191c6eb5157d64cf4a593e ("bgpd: Enable enforce-first-as by default")
Closes: https://github.com/FRRouting/frr/issues/17702
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
4 months agoMerge pull request #17687 from FRRouting/mergify/bp/stable/10.1/pr-17669
Donatas Abraitis [Sat, 21 Dec 2024 07:12:31 +0000 (09:12 +0200)]
Merge pull request #17687 from FRRouting/mergify/bp/stable/10.1/pr-17669

bgpd: fix memory leak when reconfiguring a route distinguisher (backport #17669)

4 months agobgpd: Validate only affected RPKI prefixes instead of a full RIB 17697/head
Donatas Abraitis [Wed, 4 Dec 2024 21:38:34 +0000 (23:38 +0200)]
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>
(cherry picked from commit b0800bfdf04b4fcf48504737ebfe4ba7f05268d3)

4 months agobgpd: fix memory leak when reconfiguring a route distinguisher 17687/head
Philippe Guibert [Wed, 18 Dec 2024 15:53:48 +0000 (16:53 +0100)]
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 0dd96287dda22b79ef6d7424f4e1a8dc92959f92)

4 months agobgpd: Fix memory leak when creating BMP connection with a source interface 17679/head
Donatas Abraitis [Thu, 19 Dec 2024 08:56:52 +0000 (10:56 +0200)]
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 7d19cb59cf5b129f61f3c568899343b3f031f9b4)

4 months agoMerge pull request #17657 from FRRouting/mergify/bp/stable/10.1/pr-17615
Donatas Abraitis [Tue, 17 Dec 2024 20:50:54 +0000 (22:50 +0200)]
Merge pull request #17657 from FRRouting/mergify/bp/stable/10.1/pr-17615

lib: Take ge/le into consideration when checking the prefix with the prefix-list (backport #17615)

4 months agoMerge pull request #17663 from FRRouting/mergify/bp/stable/10.1/pr-17613
Donatas Abraitis [Tue, 17 Dec 2024 20:49:58 +0000 (22:49 +0200)]
Merge pull request #17663 from FRRouting/mergify/bp/stable/10.1/pr-17613

bgpd: Fix evpn bestpath calculation when path is not established (backport #17613)

4 months agobgpd: Fix evpn bestpath calculation when path is not established 17663/head
Donald Sharp [Thu, 5 Dec 2024 18:12:00 +0000 (13:12 -0500)]
bgpd: Fix evpn bestpath calculation when path is not established

If you have a bestpath list that looks something like this:

<local evpn mac route>
<learned from peer out swp60>
<learned from peer out swp57>

And a network event happens that causes the peer out swp60
to not be in an established state, yet we still have the
path_info for the destination for swp60, bestpath
will currently end up with this order:

<learned from peer out swp60>
<local evpn mac route>
<learned from peer out swp57>

This causes the local evpn mac route to be deleted in zebra( Wrong! ).

This is happening because swp60 is skipped in bestpath calculation and
not considered to be a path yet it stays at the front of the list.

Modify bestpath calculation such that when pulling the unsorted_list
together to pull path info's into that list when they are also
not in a established state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 9f88cb56dc0fe7a4ce864f672c6ca420fcd420c2)

4 months agolib: Take ge/le into consideration when checking the prefix with the prefix-list 17657/head
Donatas Abraitis [Tue, 10 Dec 2024 14:28:26 +0000 (16:28 +0200)]
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 dd4c2acc2e871283256f6cea16ede6d2d7f72dfe)

4 months agoMerge pull request #17631 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a...
Donald Sharp [Wed, 11 Dec 2024 12:20:48 +0000 (07:20 -0500)]
Merge pull request #17631 from opensourcerouting/fix/backport_9b0b9282d317a9aeab36d9a8b08a35fe9a172c4b_10.1

bgpd: Fix bgp core with a possible Intf delete (backport)

4 months agobgpd: Fix bgp core with a possible Intf delete 17631/head
Rajasekar Raja [Tue, 10 Dec 2024 21:45:02 +0000 (13:45 -0800)]
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>
4 months agoMerge pull request #17595 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf...
Jafar Al-Gharaibeh [Thu, 5 Dec 2024 15:25:00 +0000 (09:25 -0600)]
Merge pull request #17595 from opensourcerouting/fix/backport_12a9ca4de6c781b061cccdf3e793346e23558901_10.1

bgpd: fix unconfigure asdot neighbor (backport)

4 months agobgpd: fix unconfigure asdot neighbor 17595/head
Philippe Guibert [Wed, 4 Dec 2024 20:25:33 +0000 (21:25 +0100)]
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: 8079a4138d61 ("lib, bgp: add initial support for asdot format")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
4 months agoMerge pull request #17559 from FRRouting/mergify/bp/stable/10.1/pr-17313
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 03:50:09 +0000 (21:50 -0600)]
Merge pull request #17559 from FRRouting/mergify/bp/stable/10.1/pr-17313

zebra: separate zebra ZAPI server open and accept (backport #17313)

4 months agoMerge pull request #17568 from FRRouting/mergify/bp/stable/10.1/pr-17518
Jafar Al-Gharaibeh [Wed, 4 Dec 2024 01:51:01 +0000 (19:51 -0600)]
Merge pull request #17568 from FRRouting/mergify/bp/stable/10.1/pr-17518

pimd: Fix access-list memory leak in pimd (backport #17518)

4 months agopimd: Fix access-list memory leak in pimd 17568/head
Corey Siltala [Tue, 26 Nov 2024 16:04:14 +0000 (10:04 -0600)]
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 d21a993f16dc23df6a1f1a7c81e9f562446437a0)

4 months agozebra: separate zebra ZAPI server open and accept 17559/head
Mark Stapp [Wed, 30 Oct 2024 15:02:17 +0000 (11:02 -0400)]
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 506097a1b96974c261411edd25330ceaf90fa3db)

5 months agoMerge pull request #17523 from FRRouting/mergify/bp/stable/10.1/pr-17510
Donatas Abraitis [Thu, 28 Nov 2024 05:53:38 +0000 (07:53 +0200)]
Merge pull request #17523 from FRRouting/mergify/bp/stable/10.1/pr-17510

bgpd: fix use single whitespace when displaying flowspec entries (backport #17510)

5 months agobgpd: fix use single whitespace when displaying flowspec entries 17523/head
Philippe Guibert [Tue, 26 Nov 2024 13:19:34 +0000 (14:19 +0100)]
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 561debab5430ac85e8e42e839312d213479a767a)

5 months agoMerge pull request #17512 from FRRouting/mergify/bp/stable/10.1/pr-17506
Russ White [Tue, 26 Nov 2024 16:37:52 +0000 (11:37 -0500)]
Merge pull request #17512 from FRRouting/mergify/bp/stable/10.1/pr-17506

bgpd: fix version attribute is an int, not a string (backport #17506)

5 months agobgpd: fix version attribute is an int, not a string 17512/head
Philippe Guibert [Mon, 25 Nov 2024 21:47:21 +0000 (22:47 +0100)]
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: f9f2d188e398 ("bgpd: fix 'json detail' output structure")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit c5d7815cccb92c192ca6b752843b8b827a607b53)

5 months agoMerge pull request #17490 from FRRouting/mergify/bp/stable/10.1/pr-17487
Donald Sharp [Fri, 22 Nov 2024 23:33:22 +0000 (18:33 -0500)]
Merge pull request #17490 from FRRouting/mergify/bp/stable/10.1/pr-17487

bgpd: Do not reset peers on suppress-fib toggling (backport #17487)

5 months agobgpd: Do not reset peers on suppress-fib toggling 17490/head
Donatas Abraitis [Fri, 22 Nov 2024 08:30:37 +0000 (10:30 +0200)]
bgpd: Do not reset peers on suppress-fib toggling

If the desired state is the same - do nothing instead of resetting once again.

Fixes: bdb5ae8bce94432eb5e581f04f48dc4aa5db7ca4 ("bgpd: Make suppress-fib-pending clear peering")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 7fb4c03f5b1c9cd4e8acb85b4cf953ac85aa0bbf)

5 months agoMerge pull request #17471 from FRRouting/mergify/bp/stable/10.1/pr-17464
Donald Sharp [Thu, 21 Nov 2024 13:52:59 +0000 (08:52 -0500)]
Merge pull request #17471 from FRRouting/mergify/bp/stable/10.1/pr-17464

bfdd: retain remote dplane client socket (backport #17464)

5 months agobfdd: retain remote dplane client socket 17471/head
Mark Stapp [Tue, 19 Nov 2024 19:54:06 +0000 (14:54 -0500)]
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 f5115307888dc8ca4b6369d1b705686d3c689d23)

5 months agoMerge pull request #17447 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c93...
Donald Sharp [Tue, 19 Nov 2024 14:28:54 +0000 (09:28 -0500)]
Merge pull request #17447 from opensourcerouting/fix/backport_65a43b57efd60c4fdf80c935750046ba861ec79f_10.1

bgpd: Validate both nexthop information (NEXTHOP and NLRI) (backport)

5 months agobgpd: Validate both nexthop information (NEXTHOP and NLRI) 17447/head
Donatas Abraitis [Sun, 17 Nov 2024 09:19:19 +0000 (11:19 +0200)]
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 a0d2734e879f78fbef5f1815429de331b9940c73)

5 months agoMerge pull request #17438 from FRRouting/mergify/bp/stable/10.1/pr-17432
Jafar Al-Gharaibeh [Sun, 17 Nov 2024 01:31:12 +0000 (19:31 -0600)]
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)

5 months agobgpd : backpressure - Fix to pop items off zebra_announce FIFO for few EVPN triggers 17438/head
Rajasekar Raja [Thu, 14 Nov 2024 07:09:55 +0000 (23:09 -0800)]
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: a07df6f7548f6bd1b92acbb7a10c3823de33fe5f
("bgpd : backpressure - Handle BGP-Zebra(EPVN) Install evt Creation")

Ticket :#4163611

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
(cherry picked from commit 898852f2699887bc92e96267cb3fcf221a3df01e)

5 months agoMerge pull request #17412 from FRRouting/mergify/bp/stable/10.1/pr-17409
Russ White [Tue, 12 Nov 2024 15:04:02 +0000 (10:04 -0500)]
Merge pull request #17412 from FRRouting/mergify/bp/stable/10.1/pr-17409

bgpd: fix resolvedPrefix in show nexthop json output (backport #17409)

5 months agoMerge pull request #17402 from opensourcerouting/fix/backport_031d4271018e827010abfa8...
Russ White [Tue, 12 Nov 2024 15:01:48 +0000 (10:01 -0500)]
Merge pull request #17402 from opensourcerouting/fix/backport_031d4271018e827010abfa8f3ecfe60bbf1de21d_10.1

bgpd: Fix for match source-protocol in route-map for redistribute cmd (backport)

5 months agobgpd: fix resolvedPrefix in show nexthop json output 17412/head
Krishnasamy R [Mon, 11 Nov 2024 09:59:31 +0000 (01:59 -0800)]
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 95c08e082c063374cbc62dea6529c8f54b0722df)

5 months agobgpd: Fix for match source-protocol in route-map for redistribute cmd 17402/head
Rajasekar Raja [Mon, 21 Oct 2024 17:53:27 +0000 (10:53 -0700)]
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 68358c0f928eafe50c9e73b0cb6a443c03f2a33f)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agoMerge pull request #17392 from opensourcerouting/fix/backport_17376_10.1
Donald Sharp [Fri, 8 Nov 2024 16:12:50 +0000 (11:12 -0500)]
Merge pull request #17392 from opensourcerouting/fix/backport_17376_10.1

bgpd: Clear stale routes with multiple paths (backport)

5 months agobgpd: Set LLGR stale routes for all the paths including addpath 17392/head
Donatas Abraitis [Thu, 7 Nov 2024 11:08:35 +0000 (13:08 +0200)]
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: 1479ed2fb35f4a5ae1017201a7ee37ba2727163a ("bgpd: Implement LLGR helper mode")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
5 months agobgpd: Clear all paths including addpath once GR expires
Donatas Abraitis [Thu, 7 Nov 2024 11:04:54 +0000 (13:04 +0200)]
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>
5 months agoMerge pull request #17348 from FRRouting/mergify/bp/stable/10.1/pr-17305
Donald Sharp [Tue, 5 Nov 2024 19:27:20 +0000 (14:27 -0500)]
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)

5 months agoMerge pull request #17353 from FRRouting/mergify/bp/stable/10.1/pr-17319
Donald Sharp [Tue, 5 Nov 2024 19:25:22 +0000 (14:25 -0500)]
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)

5 months agoospfd: Use router_id what Zebra has if we remove a static router_id 17353/head
Donatas Abraitis [Thu, 31 Oct 2024 09:38:40 +0000 (11:38 +0200)]
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 1073e0f9b39b2810a114dea03f2d1e0b14e414d4)

5 months agoospfd: Add a hidden command for old `no router-id`
Donatas Abraitis [Thu, 31 Oct 2024 09:37:49 +0000 (11:37 +0200)]
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 80bfe6784fa945640251ae5c907899eb9d77cc0a)

5 months agobgpd: Treat numbered community-list only if it's in a range 1-500 17348/head
Donatas Abraitis [Wed, 30 Oct 2024 08:45:28 +0000 (10:45 +0200)]
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 4c1ee29116aff081f63b1fc7dad18cbfe1b8007f)

5 months agoMerge pull request #17322 from FRRouting/mergify/bp/stable/10.1/pr-17318
Mark Stapp [Thu, 31 Oct 2024 16:02:42 +0000 (12:02 -0400)]
Merge pull request #17322 from FRRouting/mergify/bp/stable/10.1/pr-17318

zebra: Add missing new line for help string (backport #17318)

5 months agoMerge pull request #17301 from FRRouting/mergify/bp/stable/10.1/pr-17250
Donatas Abraitis [Thu, 31 Oct 2024 15:21:13 +0000 (17:21 +0200)]
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)

5 months agozebra: Add missing new line for help string 17322/head
Donatas Abraitis [Thu, 31 Oct 2024 08:47:48 +0000 (10:47 +0200)]
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: 1f5611c06d1c243b42279748788f0627793ead9c ("zebra: Allow zebra cli to accept v6 routes with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 25ae643996d338b8230fb15a9064843fe85de224)

5 months agoisisd: fix change flex-algorithm number from uint32 to uint8 17301/head
Philippe Guibert [Fri, 25 Oct 2024 08:23:54 +0000 (10:23 +0200)]
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: cc4926c1284e ("isisd,yang: add algorithm-prefix-sid configuration tree")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 8e861a75e8b426f0944157387699fe1ab322fe8e)

5 months agoMerge pull request #17298 from FRRouting/mergify/bp/stable/10.1/pr-15716
Jafar Al-Gharaibeh [Tue, 29 Oct 2024 18:40:53 +0000 (13:40 -0500)]
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)

5 months agoisisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN 17298/head
zhou-run [Tue, 9 Apr 2024 13:04:39 +0000 (21:04 +0800)]
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 5009f7539ad6bf496158499917dcf3f7ab760753)

5 months agoMerge pull request #17287 from opensourcerouting/16354-bp-10.1
Russ White [Tue, 29 Oct 2024 14:28:19 +0000 (10:28 -0400)]
Merge pull request #17287 from opensourcerouting/16354-bp-10.1

(10.1 backport) bgpd: add `bgp ipv6-auto-ra` command

5 months agoMerge pull request #17292 from FRRouting/mergify/bp/stable/10.1/pr-17245
Russ White [Tue, 29 Oct 2024 14:22:48 +0000 (10:22 -0400)]
Merge pull request #17292 from FRRouting/mergify/bp/stable/10.1/pr-17245

bgpd:  fix crash when polling bgp4v2PathAttrTable (backport #17245)

5 months agoMerge pull request #17283 from FRRouting/mergify/bp/stable/10.1/pr-17278
Donatas Abraitis [Tue, 29 Oct 2024 12:36:51 +0000 (14:36 +0200)]
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)

5 months agobgpd: fix crash when polling bgp4v2PathAttrTable 17292/head
Francois Dumontet [Mon, 21 Oct 2024 10:49:50 +0000 (12:49 +0200)]
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 ee2f1b85cf95fcbfd0a54dc15b911f525e96b163)

5 months agobgpd: add `bgp ipv6-auto-ra` command 17287/head
Mikhail Sokolovskiy [Tue, 24 Sep 2024 16:00:11 +0000 (19:00 +0300)]
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>
6 months agobgpd: fix blank line in running-config with bmp listener cmd 17283/head
Philippe Guibert [Mon, 28 Oct 2024 15:04:45 +0000 (16:04 +0100)]
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: ed18356f1f2d ("bgpd/bmp: BMP implementation")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 9a33ee18bfe2769e173911d69cee64b78143184b)

6 months agoMerge pull request #17273 from FRRouting/mergify/bp/stable/10.1/pr-17243
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 17:37:45 +0000 (12:37 -0500)]
Merge pull request #17273 from FRRouting/mergify/bp/stable/10.1/pr-17243

bgpd: fix display of local label in show bgp (backport #17243)

6 months agobgpd: fix display of local label in show bgp 17273/head
Louis Scalbert [Fri, 25 Oct 2024 15:54:07 +0000 (17:54 +0200)]
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 e7b3276ace65d59edb4d614158d4f2959f12f868)

6 months agoMerge pull request #17259 from FRRouting/mergify/bp/stable/10.1/pr-17160
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 13:55:50 +0000 (08:55 -0500)]
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)

6 months agoMerge pull request #17239 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b...
Jafar Al-Gharaibeh [Mon, 28 Oct 2024 04:44:40 +0000 (23:44 -0500)]
Merge pull request #17239 from opensourcerouting/fix/backport_d46511d4456ccaccfdac34b456c1c225a29609c8_10.1

bgpd: compare aigp after local route check in bgp_path_info_cmp()

6 months agolib, zebra: Keep `zebra on-rib-process script` in frr.conf 17259/head
Donatas Abraitis [Fri, 18 Oct 2024 12:36:52 +0000 (15:36 +0300)]
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 1fe1f8d87c4ab46ae18536a2418c05ae5fd95185)

6 months agoMerge pull request #17217 from Jafaral/fix-bsm-backport
Donald Sharp [Fri, 25 Oct 2024 20:06:00 +0000 (16:06 -0400)]
Merge pull request #17217 from Jafaral/fix-bsm-backport

pimd: allow resolving bsr via directly connected secondary address (backport)

6 months agobgpd: compare aigp after local route check in bgp_path_info_cmp() 17239/head
Enke Chen [Thu, 24 Oct 2024 17:50:37 +0000 (10:50 -0700)]
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 6a7049aaacc32e6a473a4d56ca61444d1e1eb45d)

6 months agoMerge pull request #17208 from cscarpitta/fix/backport_add-sid-structure-to-seg6local...
Donatas Abraitis [Thu, 24 Oct 2024 14:32:28 +0000 (17:32 +0300)]
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)

6 months agopimd: allow resolving bsr via directly connected secondary address 17217/head
Jafar Al-Gharaibeh [Wed, 23 Oct 2024 04:09:53 +0000 (23:09 -0500)]
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>
6 months agobgpd: Include structure when removing End.DT46 SID 17208/head
Carmine Scarpitta [Sun, 15 Sep 2024 16:56:48 +0000 (18:56 +0200)]
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>
6 months agobgpd: Include structure when removing End.DT4/6 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:56:21 +0000 (18:56 +0200)]
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>
6 months agobgpd: Include structure when installing End.DT46 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:54:55 +0000 (18:54 +0200)]
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>
6 months agobgpd: Include structure when installing End.DT4/6 SID
Carmine Scarpitta [Sun, 15 Sep 2024 16:53:35 +0000 (18:53 +0200)]
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>
6 months agolib: Include SID structure in seg6local nexthop
Carmine Scarpitta [Sun, 15 Sep 2024 15:23:34 +0000 (17:23 +0200)]
lib: Include SID structure in seg6local nexthop

Include SID structure information in seg6local nexthop data structure.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
6 months agoMerge pull request #17202 from FRRouting/mergify/bp/stable/10.1/pr-17198
Donatas Abraitis [Wed, 23 Oct 2024 09:40:07 +0000 (12:40 +0300)]
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)

6 months agoRevert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty" 17202/head
Donald Sharp [Tue, 22 Oct 2024 15:13:07 +0000 (11:13 -0400)]
Revert "lib: Attach stdout to child only if --log=stdout and stdout FD is a tty"

This reverts commit 0e3c5e8e5907321b35201f0985c1d3f4a1b0e639.

(cherry picked from commit 6a36b9ef49bfce59a7e674df233265da6d275257)

6 months agoMerge pull request #17196 from FRRouting/mergify/bp/stable/10.1/pr-17165
Russ White [Tue, 22 Oct 2024 18:42:14 +0000 (14:42 -0400)]
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)

6 months agotests: Check if BGP no-export community is passed to BGP OAD peers 17196/head
Donatas Abraitis [Fri, 18 Oct 2024 19:51:37 +0000 (22:51 +0300)]
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 7eaec540ec8aaca5821fc5ac1259b8eb8127f230)

6 months agobgpd: Do not filter no-export community for BGP OAD (one administration domain)
Donatas Abraitis [Fri, 18 Oct 2024 19:35:28 +0000 (22:35 +0300)]
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 e63b1520f1ad1036455c1626a388ac3afb7f9d6d)

6 months agoMerge pull request #17176 from FRRouting/mergify/bp/stable/10.1/pr-17169
Jafar Al-Gharaibeh [Mon, 21 Oct 2024 18:39:39 +0000 (13:39 -0500)]
Merge pull request #17176 from FRRouting/mergify/bp/stable/10.1/pr-17169

bgpd: allow value 0 in aigp-metric setting (backport #17169)

6 months agobgpd: allow value 0 in aigp-metric setting 17176/head
Enke Chen [Sun, 20 Oct 2024 19:25:46 +0000 (12:25 -0700)]
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 e07f38a43f0b176fcfb96403db71291c04f76cfb)

6 months agoMerge pull request #17130 from FRRouting/mergify/bp/stable/10.1/pr-17116
Donatas Abraitis [Fri, 18 Oct 2024 12:18:25 +0000 (15:18 +0300)]
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)

6 months agoMerge pull request #17147 from FRRouting/mergify/bp/stable/10.1/pr-17091
Jafar Al-Gharaibeh [Thu, 17 Oct 2024 16:29:40 +0000 (11:29 -0500)]
Merge pull request #17147 from FRRouting/mergify/bp/stable/10.1/pr-17091

bgpd: fix several issues in sourcing AIGP attribute (backport #17091)