]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
2 months agoMerge pull request #17987 from pguibert6WIND/evpn_bgp_l2_attr_ext_community
Russ White [Wed, 5 Feb 2025 15:17:46 +0000 (10:17 -0500)]
Merge pull request #17987 from pguibert6WIND/evpn_bgp_l2_attr_ext_community

bgpd: add L2 attr community support as per RFC8214

2 months agoMerge pull request #17901 from opensourcerouting/nexthop_hashing
Donald Sharp [Wed, 5 Feb 2025 14:14:58 +0000 (09:14 -0500)]
Merge pull request #17901 from opensourcerouting/nexthop_hashing

lib: actually hash all 16 bytes of IPv6 addresses, not just 4

2 months agoMerge pull request #18014 from donaldsharp/nexthop_leak
Russ White [Wed, 5 Feb 2025 13:32:13 +0000 (08:32 -0500)]
Merge pull request #18014 from donaldsharp/nexthop_leak

Nexthop leak

2 months agoMerge pull request #18018 from forrestchu/sbfd
Donald Sharp [Wed, 5 Feb 2025 13:17:52 +0000 (08:17 -0500)]
Merge pull request #18018 from forrestchu/sbfd

doc: fix sbfd.rst doc warnings

2 months agoMerge pull request #18000 from donaldsharp/bgp_eoiu_mem_leak
Jafar Al-Gharaibeh [Wed, 5 Feb 2025 05:20:42 +0000 (23:20 -0600)]
Merge pull request #18000 from donaldsharp/bgp_eoiu_mem_leak

bgpd: Fix up memory leak in processing eoiu marker

2 months agodoc: fix sbfd.rst doc warnings
wumu.zsl [Wed, 5 Feb 2025 02:18:23 +0000 (02:18 +0000)]
doc: fix sbfd.rst doc warnings

Signed-off-by: wumu.zsl <wumu.zsl@alibaba-inc.com>
2 months agozebra: Fix srv6 segment nexthop memory leak.
Donald Sharp [Tue, 4 Feb 2025 20:13:48 +0000 (15:13 -0500)]
zebra: Fix srv6 segment nexthop memory leak.

The srv6 segment was being set but never freed
on the statically allocated nexthop.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17962 from donaldsharp/fpm_problems
Russ White [Tue, 4 Feb 2025 20:09:05 +0000 (15:09 -0500)]
Merge pull request #17962 from donaldsharp/fpm_problems

Fpm problems

2 months agozebra: Stop leaking labels when receiving nexthops from kernel
Donald Sharp [Tue, 4 Feb 2025 20:00:12 +0000 (15:00 -0500)]
zebra: Stop leaking labels when receiving nexthops from kernel

This leak is happening:
Direct leak of 96 byte(s) in 2 object(s) allocated from:
    0 0x7f6922eb83b7 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
    1 0x7f6922a38ebb in qcalloc lib/memory.c:106
    2 0x7f6922a553d6 in nexthop_add_srv6_seg6 lib/nexthop.c:652
    3 0x562825e56b38 in parse_nexthop_unicast zebra/rt_netlink.c:589
    4 0x562825e58c4a in netlink_route_change_read_unicast_internal zebra/rt_netlink.c:1291
    5 0x562825e58eef in netlink_route_change_read_unicast zebra/rt_netlink.c:1321
    6 0x562825e64921 in netlink_route_change zebra/rt_netlink.c:1494
    7 0x562825e43407 in netlink_information_fetch zebra/kernel_netlink.c:407
    8 0x562825e439b5 in netlink_parse_info zebra/kernel_netlink.c:1148
    9 0x562825e44060 in kernel_read zebra/kernel_netlink.c:510
    10 0x7f6922aeca72 in event_call lib/event.c:1984
    11 0x7f6922a19e01 in frr_run lib/libfrr.c:1246
    12 0x562825e4b0b9 in main zebra/main.c:543
    13 0x7f692250c249 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Just check to see if it has been allocated.  The nexthop is a stack
variable so it's a bit odd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17988 from cscarpitta/feature/srv6-ipv4-traffic-steering
Russ White [Tue, 4 Feb 2025 16:45:02 +0000 (11:45 -0500)]
Merge pull request #17988 from cscarpitta/feature/srv6-ipv4-traffic-steering

staticd: Add CLI to support steering of IPv4 traffic over SRv6 SID list

2 months agoMerge pull request #17953 from donaldsharp/limit_ip_protocol
Russ White [Tue, 4 Feb 2025 16:43:10 +0000 (11:43 -0500)]
Merge pull request #17953 from donaldsharp/limit_ip_protocol

lib: Remove System routes from ip protocol route map choices

2 months agoMerge pull request #17918 from lsang6WIND/bgp_evpn_route_map
Russ White [Tue, 4 Feb 2025 16:42:42 +0000 (11:42 -0500)]
Merge pull request #17918 from lsang6WIND/bgp_evpn_route_map

Add bgpevpn route type-2 route map filter tests

2 months agoMerge pull request #17896 from opensourcerouting/fix/bgp_oad_extended_communities
Russ White [Tue, 4 Feb 2025 16:42:16 +0000 (11:42 -0500)]
Merge pull request #17896 from opensourcerouting/fix/bgp_oad_extended_communities

bgpd: Send non-transitive extended communities from/to OAD peers

2 months agoMerge pull request #16593 from baozhen-H3C/202408151540
Russ White [Tue, 4 Feb 2025 16:39:29 +0000 (11:39 -0500)]
Merge pull request #16593 from baozhen-H3C/202408151540

isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation

2 months agoMerge pull request #17985 from pguibert6WIND/evpn_ead_label_support
Russ White [Tue, 4 Feb 2025 16:39:03 +0000 (11:39 -0500)]
Merge pull request #17985 from pguibert6WIND/evpn_ead_label_support

bgpd: fix add label support to EVPN AD routes

2 months agoMerge pull request #17959 from opensourcerouting/fix/bgp_deny_zero_bgp_identifier_to_...
Russ White [Tue, 4 Feb 2025 16:31:57 +0000 (11:31 -0500)]
Merge pull request #17959 from opensourcerouting/fix/bgp_deny_zero_bgp_identifier_to_establish

bgpd: Do not start BGP session if BGP identifier is not set

2 months agobuild: FRR 10.4 development version frr-10.4-dev
Jafar Al-Gharaibeh [Tue, 4 Feb 2025 16:21:51 +0000 (10:21 -0600)]
build: FRR 10.4 development version

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 months agoMerge pull request #17969 from donaldsharp/fpm_lost_sends base_10.3
Mark Stapp [Tue, 4 Feb 2025 16:18:07 +0000 (11:18 -0500)]
Merge pull request #17969 from donaldsharp/fpm_lost_sends

zebra: Ensure dplane does not send work back to master at wrong time

2 months agobgpd: Fix up memory leak in processing eoiu marker
Donald Sharp [Tue, 4 Feb 2025 15:56:59 +0000 (10:56 -0500)]
bgpd: Fix up memory leak in processing eoiu marker

Memory is being leaked when processing the eoiu marker.
BGP is creating a dummy dest to contain the data but
it was never freed.  As well as the eoiu info was
not being freed either.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agobgpd: add L2 attr community support as per RFC8214
Philippe Guibert [Mon, 3 Feb 2025 15:08:45 +0000 (16:08 +0100)]
bgpd: add L2 attr community support as per RFC8214

The L2 attribute extended community can not be decoded when using L2VPN
EVPN as a route reflector. Decode the extended community and dump the
detailed information about flags and MTU information.

> rt4# show bgp l2vpn evpn
> BGP table version is 1, local router ID is 4.4.4.4
> Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
> Origin codes: i - IGP, e - EGP, ? - incomplete
> EVPN type-1 prefix: [1]:[EthTag]:[ESI]:[IPlen]:[VTEP-IP]:[Frag-id]
> EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
> EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
> EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
> EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]
>
>    Network          Next Hop            Metric LocPrf Weight Path
> Route Distinguisher: 1.1.1.1:100
>  *>i[1]:[12]:[00:00:00:00:00:00:00:00:00:00]:[32]:[0.0.0.0]:[0]
>                     1.1.1.1                       100      0 i
>                     RT:65500:100 L2: P flag:N, B Flag N, C word N, MTU 0
> Route Distinguisher: 5.5.5.5:100
>  *>i[1]:[10]:[00:00:00:00:00:00:00:00:00:00]:[32]:[0.0.0.0]:[0]
>                     5.5.5.5                       100      0 i
>                     RT:65500:100 L2: P flag:N, B Flag N, C word N, MTU 0
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agoMerge pull request #17992 from chiragshah6/fdev5
Russ White [Tue, 4 Feb 2025 12:40:36 +0000 (07:40 -0500)]
Merge pull request #17992 from chiragshah6/fdev5

bgpd: fix route-distinguisher in vrf leak json cmd

2 months agoMerge pull request #17991 from chiragshah6/bgp_dev4
Donatas Abraitis [Tue, 4 Feb 2025 12:34:21 +0000 (14:34 +0200)]
Merge pull request #17991 from chiragshah6/bgp_dev4

zebra: fix evpn svd hash avoid double free

2 months agoMerge pull request #17943 from opensourcerouting/clear-event-cpu-uaf
Russ White [Tue, 4 Feb 2025 11:57:52 +0000 (06:57 -0500)]
Merge pull request #17943 from opensourcerouting/clear-event-cpu-uaf

lib: fix use after free in `clear event cpu`

2 months agoMerge pull request #17336 from forrestchu/sbfd
Russ White [Tue, 4 Feb 2025 11:36:43 +0000 (06:36 -0500)]
Merge pull request #17336 from forrestchu/sbfd

implement SBFD

2 months agoisisd: 'tiebreaker' command line funtionality is inconsistent with its implementation
b29332 [Thu, 15 Aug 2024 08:20:19 +0000 (16:20 +0800)]
isisd: 'tiebreaker' command line funtionality is inconsistent with its implementation

The command fast-reroute lfa tiebreaker [downstream | lowest-backup-metric | node-protecting] index (1-255) [level-1 | level-2] will overwrite configurations with the same index but different types. This is because the index is set as the key in frr-isisd.yang. However, the lfa_tiebreaker_cmp function uses a tuple (index, type) as the key. Therefore, the yang file should be modified to stay in sync with the business logic.

Test Scenario:
On RouterA, first configure fast-reroute lfa tiebreaker downstream index 100 level-1, then configure fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1, and check the configuration:

!
router isis 10
 fast-reroute lfa tiebreaker lowest-backup-metric index 100 level-1
exit
!

Signed-off-by: baozhen-H3C <bao.zhen@h3c.com>
2 months agoMerge pull request #17990 from enkechen-panw/aigp-cfg-default
Donatas Abraitis [Tue, 4 Feb 2025 08:51:52 +0000 (10:51 +0200)]
Merge pull request #17990 from enkechen-panw/aigp-cfg-default

bgpd: add config default for "bgp bestpath aigp"

2 months agoMerge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid
Donatas Abraitis [Tue, 4 Feb 2025 08:47:20 +0000 (10:47 +0200)]
Merge pull request #17989 from cscarpitta/fix/fix_staticd_no_sid

staticd: Fix wrong xpath in `no sid X:X::X:X/M`

2 months agobgpd: fix route-distinguisher in vrf leak json cmd
Chirag Shah [Mon, 3 Feb 2025 20:00:41 +0000 (12:00 -0800)]
bgpd: fix route-distinguisher in vrf leak json cmd

For auto configured value RD value comes as NULL,
switching back to original change will ensure to cover
for both auto and user configured RD value in JSON.

tor-11# show bgp vrf blue ipv4 unicast route-leak json
{
  "vrf":"blue",
  "afiSafi":"ipv4Unicast",
  "importFromVrfs":[
    "purple"
  ],
  "importRts":"10.10.3.11:6",
  "exportToVrfs":[
    "purple"
  ],
  "routeDistinguisher":"(null)", <<<<<
  "exportRts":"10.10.3.11:10"
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agozebra: evpn svd hash avoid double free
Chirag Shah [Fri, 31 Jan 2025 01:26:46 +0000 (17:26 -0800)]
zebra: evpn svd hash avoid double free

Upon zebra shutdown hash_clean_and_free is called
where user free function is passed,
The free function should not call hash_release
which lead to double free of hash bucket.

Fix:
The fix is to avoid calling hash_release from
free function if its called from hash_clean_and_free
path.

10 0x00007f0422b7df1f in free () from /lib/x86_64-linux-gnu/libc.so.6
11 0x00007f0422edd779 in qfree (mt=0x7f0423047ca0 <MTYPE_HASH_BUCKET>,
    ptr=0x55fc8bc81980) at ../lib/memory.c:130
12 0x00007f0422eb97e2 in hash_clean (hash=0x55fc8b979a60,
    free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:290
13 0x00007f0422eb98a1 in hash_clean_and_free (hash=0x55fc8a675920
    <svd_nh_table>, free_func=0x55fc8a529478 <svd_nh_del_terminate>) at
    ../lib/hash.c:305
14 0x000055fc8a5323a5 in zebra_vxlan_terminate () at
    ../zebra/zebra_vxlan.c:6099
15 0x000055fc8a4c9227 in zebra_router_terminate () at
    ../zebra/zebra_router.c:276
16 0x000055fc8a4413b3 in zebra_finalize (dummy=0x7fffb881c1d0) at
    ../zebra/main.c:269
17 0x00007f0422f44387 in event_call (thread=0x7fffb881c1d0) at
    ../lib/event.c:2011
18 0x00007f0422ecb6fa in frr_run (master=0x55fc8b733cb0) at
    ../lib/libfrr.c:1243
19 0x000055fc8a441987 in main (argc=14, argv=0x7fffb881c4a8) at
    ../zebra/main.c:584

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2 months agotests: Add test case to verify SID re-add
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:51 +0000 (12:56 +0100)]
tests: Add test case to verify SID re-add

Add a new test case that re-add the deleted SIDs and verifies that all
SIDs are added back to the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add test case to verify SID delete
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:41 +0000 (12:56 +0100)]
tests: Add test case to verify SID delete

Add a new test case that deletes a SID and verifies that only this
SID has been removed from the RIB.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Fix wrong xpath in `no sid X:X::X:X/M`
Carmine Scarpitta [Mon, 3 Feb 2025 11:56:02 +0000 (12:56 +0100)]
staticd: Fix wrong xpath in `no sid X:X::X:X/M`

When a user wants to delete a specific SRv6 SID, he executes the
`no sid X:X::X:X/M` command.
However, by mistake, in addition to deleting the SID requested by the
user, this command also removes all other SIDs.

This happens because `no sid X:X::X:X/M` triggers a destroy operation
on the wrong xpath `frr-staticd:staticd/segment-routing/srv6`.

This commit fixes the issue by replacing the wrong xpath
`frr-staticd:staticd/segment-routing/srv6` with the correct xpath
`frr-staticd:staticd/segment-routing/srv6/static-sids/sid[sid='%s']`.

This ensures that the `no sid X:X::X:X/M` command only deletes the SID
that was requested by the user.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agotests: Add topotest for SRv6 IPv4 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 08:42:34 +0000 (09:42 +0100)]
tests: Add topotest for SRv6 IPv4 traffic steering

Add a topotest to verify the newly introduced CLI to support
steering of IPv4 traffic over an SRv6 SID list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agodoc: Add documentation for SRv6 IPv4 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 08:22:52 +0000 (09:22 +0100)]
doc: Add documentation for SRv6 IPv4 traffic steering

Add an example of how to steer IPv4 traffic over an SRv6 SID list.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route_vrf` CLI to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:59:18 +0000 (08:59 +0100)]
staticd: Extend `ip_route_vrf` CLI to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
vrf vrf10
 ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
vrf vrf10
 ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route` CLI to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:58:41 +0000 (08:58 +0100)]
staticd: Extend `ip_route` CLI to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route_address_interface_vrf` to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:57:28 +0000 (08:57 +0100)]
staticd: Extend `ip_route_address_interface_vrf` to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
vrf vrf10
 ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
vrf vrf10
 ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agostaticd: Extend `ip_route_address_interface` to support SRv6 traffic steering
Carmine Scarpitta [Tue, 24 Dec 2024 07:56:28 +0000 (08:56 +0100)]
staticd: Extend `ip_route_address_interface` to support SRv6 traffic steering

staticd already has a CLI to steer IPv6 traffic over a given SRv6 SID
list:

```
ipv6 route 2001:db8:1:1::/64 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

This PR extends the existing CLI `ip route` to support steering of IPv4
traffic over an SRv6 SID list.

```
ip route 10.0.0.0/24 sr0 segments fcbb:bbbb:1:2:3:fe00::
```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17970 from mjstapp/fix_privs_no_caps
Donald Sharp [Mon, 3 Feb 2025 17:57:44 +0000 (12:57 -0500)]
Merge pull request #17970 from mjstapp/fix_privs_no_caps

libs: return from change_caps if no caps

2 months agobgpd: fix add label support to EVPN AD routes
Philippe Guibert [Mon, 3 Feb 2025 13:49:53 +0000 (14:49 +0100)]
bgpd: fix add label support to EVPN AD routes

When peering with an EVPN device from other vendor, FRR acting as route
reflector is not able to read nor transmit the label value.

Actually, EVPN AD routes completely ignore the label value in the code,
whereas in some functionalities like evpn-vpws, it is authorised to
carry and propagate label value.

Fix this by handling the label value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agoMerge pull request #17913 from Sokolmish/bgp-sid-release
Carmine Scarpitta [Mon, 3 Feb 2025 13:52:00 +0000 (14:52 +0100)]
Merge pull request #17913 from Sokolmish/bgp-sid-release

bgpd: Release SID on router deletion

2 months agobgpd: add config default for "bgp bestpath aigp"
Enke Chen [Mon, 3 Feb 2025 04:35:44 +0000 (20:35 -0800)]
bgpd: add config default for "bgp bestpath aigp"

Just to make it simpler for compiling with a different default value.
No change to its default value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2 months agoMerge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify
Donatas Abraitis [Sun, 2 Feb 2025 19:17:33 +0000 (21:17 +0200)]
Merge pull request #17979 from cscarpitta/fix/fix_staticd_sid_notify

staticd: Fix NULL pointer dereference when receiving `ZAPI_SRV6_SID_RELEASED` notification

2 months agoMerge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf
Russ White [Sun, 2 Feb 2025 17:41:12 +0000 (12:41 -0500)]
Merge pull request #17947 from opensourcerouting/fix/bgp_disable_vrf

bgpd: Do not ignore auto generated VRF instances when deleting

2 months agoMerge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager
Donatas Abraitis [Sun, 2 Feb 2025 11:32:36 +0000 (13:32 +0200)]
Merge pull request #17964 from cscarpitta/fix/fix-srv6-sid-manager

Fix SRv6 SID Manager

2 months agostaticd: Fix NULL pointer dereference
Carmine Scarpitta [Sun, 2 Feb 2025 09:06:22 +0000 (10:06 +0100)]
staticd: Fix NULL pointer dereference

When staticd receives a `ZAPI_SRV6_SID_RELEASED` notification from SRv6
SID Manager, it tries to unset the validity flag of `sid`. But since
the `sid` variable is NULL, we get a NULL pointer dereference.

```
=================================================================
==13815==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000060 (pc 0xc14b813d9eac bp 0xffffcb135a40 sp 0xffffcb135a40 T0)
==13815==The signal is caused by a READ memory access.
==13815==Hint: address points to the zero page.
    #0 0xc14b813d9eac in static_zebra_srv6_sid_notify staticd/static_zebra.c:1172
    #1 0xe44e7aa2c194 in zclient_read lib/zclient.c:4746
    #2 0xe44e7a9b69d8 in event_call lib/event.c:1984
    #3 0xe44e7a85ac28 in frr_run lib/libfrr.c:1246
    #4 0xc14b813ccf98 in main staticd/static_main.c:193
    #5 0xe44e7a4773f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #6 0xe44e7a4774c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #7 0xc14b813cc92c in _start (/usr/lib/frr/staticd+0x1c92c)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV staticd/static_zebra.c:1172 in static_zebra_srv6_sid_notify
==13815==ABORTING
```

This commit fixes the problem by doing a SID lookup first. If the SID
can't be found, we log an error and return. If the SID is found, we go
ahead and unset the validity flag.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17972 from enkechen-panw/rr-policy
Donatas Abraitis [Sun, 2 Feb 2025 07:53:16 +0000 (09:53 +0200)]
Merge pull request #17972 from enkechen-panw/rr-policy

bgpd: add config default for "route-reflector allow-outbound-policy"

2 months agobgpd: add config default for "route-reflector allow-outbound-policy"
Enke Chen [Sat, 1 Feb 2025 18:24:19 +0000 (10:24 -0800)]
bgpd: add config default for "route-reflector allow-outbound-policy"

Just to make it simpler for compiling with a different default value.
No change to its default value.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
2 months agoMerge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business
Donatas Abraitis [Sat, 1 Feb 2025 11:25:37 +0000 (13:25 +0200)]
Merge pull request #17971 from donaldsharp/suppress_fib_giving_us_the_business

bgpd: With suppress-fib-pending ensure withdrawal is sent

2 months agobgpd: With suppress-fib-pending ensure withdrawal is sent
Donald Sharp [Fri, 31 Jan 2025 23:53:30 +0000 (18:53 -0500)]
bgpd: With suppress-fib-pending ensure withdrawal is sent

When you have suppress-fib-pending turned on it is possible
to end up in a situation where the prefix is not withdrawn
from downstream peers.

Here is the timing that I believe is happening:

a) have 2 paths to a peer.
b) receive a withdrawal from 1 path, set BGP_NODE_FIB_INSTALL_PENDING
   and send the route install to zebra.
c) receive a withdrawal from the other path.
d) At this point we have a dest->flags set BGP_NODE_FIB_INSTALL_PENDING
   old_select the path_info going away, new_select is NULL
e) A bit further down we call group_announce_route() which calls
   the code to see if we should advertise the path.  It sees the
   BGP_NODE_FIB_INSTALL_PENDING flag and says, nope.
f) the route is sent to zebra to withdraw, which unsets the
   BGP_NODE_FIB_INSTALL_PENDING.
g) This function winds up and deletes the path_info.  Dest now
   has no path infos.
h) BGP receives the route install(from step b) and unsets the
   BGP_NODE_FIB_INSTALL_PENDING flag
i) BGP receives the route removed from zebra (from step f) and
   unsets the flag again.

We know if there is no new_select, let's go ahead and just
unset the PENDING flag to allow the withdrawal to go out
at the time when the second withdrawal is received.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agozebra: Ensure dplane does not send work back to master at wrong time
Donald Sharp [Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)]
zebra: Ensure dplane does not send work back to master at wrong time

When looping through the dplane providers, the worklist was
being populated with items from the last provider and then
the event system was checked to see if we should stop processing.
If the event system says `yes` then the dplane code would stop
and send the worklist to the master zebra pthread for collection.
This obviously skipped the next dplane provider on the list
which is double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agozebra: Stop buffering output from fpm_listener
Donald Sharp [Fri, 31 Jan 2025 17:14:36 +0000 (12:14 -0500)]
zebra: Stop buffering output from fpm_listener

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agozebra: Limit mutex for obuf to when we access obuf
Donald Sharp [Fri, 31 Jan 2025 17:12:17 +0000 (12:12 -0500)]
zebra: Limit mutex for obuf to when we access obuf

The mutex that wraps access to the output buffer
is being held for the entire time the data is
being generated to send down the pipe.  Since
the generation has absolutely nothing to do
with the obuf, let's limit the mutex holding some.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agotests: Show that asic offload works in the fpm testing
Donald Sharp [Thu, 30 Jan 2025 14:53:09 +0000 (09:53 -0500)]
tests: Show that asic offload works in the fpm testing

The fpm_testing_topo1 didn't turn on the fpm_listener
sending the routes back to zebra to set the asic offload.

Modify the test to tell the fpm_listener to set the offloaded
flag and reflect the route back to the dplane_fpm_nl.c code.
Also modify zebra to expect a response to the underlying fpm listener.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agozebra: fpm_listener allow continued operation
Donald Sharp [Thu, 30 Jan 2025 14:02:44 +0000 (09:02 -0500)]
zebra: fpm_listener allow continued operation

In fpm_listener, when a error is detected it would
stop listening and not recover.  Modify the code
to close the socket and allow the connection to
recover.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agozebra: Fix pass back of data from dplane through fpm pipe
Donald Sharp [Thu, 30 Jan 2025 13:57:57 +0000 (08:57 -0500)]
zebra: Fix pass back of data from dplane through fpm pipe

A recent code change 29122bc9b8d5317f6f486f9fe61a92a854948cc5
changed the passing of data up the fpm from passing the
tableid and vrf to the sonic expected tableid contains
the vrfid.  This violates the assumptions in the code
that the netlink message passes up the tableid as the
tableid.  Additionally this code change did not modify
the rib_find_rn_from_ctx to actually properly decode
what could be passed up.  Let's just fix this and let
Sonic carry the patch as appropriate for themselves
since they are not the only users of dplane_fpm_nl.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agolibs: return from change_caps if no caps
Mark Stapp [Fri, 31 Jan 2025 18:13:48 +0000 (13:13 -0500)]
libs: return from change_caps if no caps

When called without caps/privs, just return from "change_caps"
instead of exiting - it's possible that a process may not need
privs, but a lib (for example) may use the api.

Signed-off-by: Mark Stapp <mjs@cisco.com>
2 months agozebra: Ensure dplane does not send work back to master at wrong time
Donald Sharp [Fri, 31 Jan 2025 17:38:20 +0000 (12:38 -0500)]
zebra: Ensure dplane does not send work back to master at wrong time

When looping through the dplane providers, the worklist was
being populated with items from the last provider and then
the event system was checked to see if we should stop processing.
If the event system says `yes` then the dplane code would stop
and send the worklist to the master zebra pthread for collection.
This obviously skipped the next dplane provider on the list
which is double plus not good.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous
Donatas Abraitis [Fri, 31 Jan 2025 11:56:09 +0000 (13:56 +0200)]
Merge pull request #17956 from pguibert6WIND/isis_srv6_codepoint_erroneous

isisd: fix erroneous srv6 information in database

2 months agotests: Add testcase for static End/uN validation
Carmine Scarpitta [Thu, 30 Jan 2025 18:26:57 +0000 (19:26 +0100)]
tests: Add testcase for static End/uN validation

This commit adds a testcase to validate static End/uN allocation.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agozebra: Fix SRv6 SID Manager
Carmine Scarpitta [Thu, 30 Jan 2025 18:25:57 +0000 (19:25 +0100)]
zebra: Fix SRv6 SID Manager

The SRv6 SID Manager does not allow allocating an SRv6 End/uN function
even though it is already supported by staticd.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2 months agoMerge pull request #17934 from nabahr/autorp-close
Donatas Abraitis [Thu, 30 Jan 2025 14:19:40 +0000 (16:19 +0200)]
Merge pull request #17934 from nabahr/autorp-close

pimd: Close AutoRP socket when not needed

2 months agotopotests: Router deletion in SRv6 sid reachability
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:47 +0000 (01:54 +0300)]
topotests: Router deletion in SRv6 sid reachability

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agobgpd: Release SID on router deletion
Mikhail Sokolovskiy [Wed, 29 Jan 2025 22:54:31 +0000 (01:54 +0300)]
bgpd: Release SID on router deletion

Signed-off-by: Mikhail Sokolovskiy <sokolmish@gmail.com>
2 months agotests: Check if the peer stays Idle if router-id is not set
Donatas Abraitis [Wed, 29 Jan 2025 21:11:35 +0000 (23:11 +0200)]
tests: Check if the peer stays Idle if router-id is not set

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agobgpd: Do not start BGP session if BGP identifier is not set
Donatas Abraitis [Wed, 29 Jan 2025 21:03:06 +0000 (23:03 +0200)]
bgpd: Do not start BGP session if BGP identifier is not set

If we have IPv6-only network and no IPv4 addresses at all, then by default
0.0.0.0 is created which is treated as malformed according to RFC 6286.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agodoc: Say that 0.0.0.0 (0) BGP identifier is invalid
Donatas Abraitis [Wed, 29 Jan 2025 20:24:39 +0000 (22:24 +0200)]
doc: Say that 0.0.0.0 (0) BGP identifier is invalid

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 months agolib: clean up nexthop hashing mess
David Lamparter [Wed, 22 Jan 2025 10:23:31 +0000 (11:23 +0100)]
lib: clean up nexthop hashing mess

We were hashing 4 bytes of the address.  Even for IPv6 addresses.

Oops.

The reason this was done was to try to make it faster, but made a
complex maze out of everything.  Time for a refactor.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agolib: guard against padding garbage in ZAPI read
David Lamparter [Wed, 22 Jan 2025 10:19:04 +0000 (11:19 +0100)]
lib: guard against padding garbage in ZAPI read

When reading in a nexthop from ZAPI, only set the fields that actually
have meaning.  While it shouldn't happen to begin with, we can otherwise
carry padding garbage into the unused leftover union bytes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agozebra: guard against junk in nexthop->rmap_src
David Lamparter [Wed, 22 Jan 2025 10:17:21 +0000 (11:17 +0100)]
zebra: guard against junk in nexthop->rmap_src

rmap_src wasn't initialized, so for IPv4 the unused 12 bytes would
contain whatever junk is on the stack on function entry.  Also move
the IPv4 parse before the IPv6 parse so if it's successful we can be
sure the other bytes haven't been touched.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agopbrd: initialize structs used in hash_lookup
David Lamparter [Wed, 22 Jan 2025 10:16:10 +0000 (11:16 +0100)]
pbrd: initialize structs used in hash_lookup

Doesn't seem to break anything but really poor style to pass potentially
uninitialized data to hash_lookup.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agofpm: guard against garbage in unused address bytes
David Lamparter [Wed, 22 Jan 2025 10:15:17 +0000 (11:15 +0100)]
fpm: guard against garbage in unused address bytes

Zero out the 12 unused bytes (for the IPv6 address) when reading in an
IPv4 address.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agobgpd: don't reuse nexthop variable in loop/switch
David Lamparter [Wed, 22 Jan 2025 10:13:21 +0000 (11:13 +0100)]
bgpd: don't reuse nexthop variable in loop/switch

While the loop is currently exited in all cases after using nexthop, it
is a footgun to have "nh" around to be reused in another iteration of
the loop.  This would leave nexthop with partial data from the previous
use.  Make it local where needed instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 months agoMerge pull request #17935 from mjstapp/fix_nhg_hash_equal
Donald Sharp [Wed, 29 Jan 2025 15:14:37 +0000 (10:14 -0500)]
Merge pull request #17935 from mjstapp/fix_nhg_hash_equal

zebra: include resolving nexthops in nhg hash

2 months agolib: Remove System routes from ip protocol route map choices
Donald Sharp [Wed, 29 Jan 2025 13:18:32 +0000 (08:18 -0500)]
lib: Remove System routes from ip protocol route map choices

Do not allow system routes to be selected for ip protocol

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 months agoMerge pull request #17946 from bobuhiro11/normalize_ebgp_multihop
Donatas Abraitis [Wed, 29 Jan 2025 12:05:12 +0000 (14:05 +0200)]
Merge pull request #17946 from bobuhiro11/normalize_ebgp_multihop

tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

2 months agoisisd: fix erroneous srv6 information in database
Philippe Guibert [Wed, 29 Jan 2025 11:19:24 +0000 (12:19 +0100)]
isisd: fix erroneous srv6 information in database

The show isis database detail command dumps invalid srv6 information:
>  SRv6 Locator: fc00:0:6::/64 (Metric: 0) ipv6-unicast
>    Sub-TLVs:
>      SRv6 End SID Endpoint Behavior: unknown, SID value: fc00:0:6:0:1::
>
>  MT Reachability: 0123.6452.1973.03 (Metric: 10) ipv6-unicast
>    Local Interface IPv6 Address(es): 192::4:3
>    SRv6 Lan End.X SID: fc00:0:3:0:43::, Algorithm: SPF, Weight: 0, Endpoint Behavior: End.DX6, Flags: B:0, S:0, P:0 Neighbor-ID: 0123.6452.1975
>        SRv6 SID Structure Locator Block length: 40, Locator Node length: 24, Function length: 16, Argument length: 0,

The behavior codepoint should use the IANA definitions to display the
correct value. Fix this by calling the appropriate convert function.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 months agotools: Fix frr-reload for ebgp-multihop TTL reconfiguration.
Nobuhiro MIKI [Wed, 29 Jan 2025 04:31:53 +0000 (04:31 +0000)]
tools: Fix frr-reload for ebgp-multihop TTL reconfiguration.

In ebgp-multihop, there is a difference in reload behavior when TTL is
unspecified (meaning default 255) and when 255 is explicitly specified.
For example, when reloading with 'neighbor <neighbor> ebgp-multihop
255' in the config, the following difference is created. This commit
fixes that.

    Lines To Delete
    ===============
    router bgp 65001
     no neighbor 10.0.0.4 ebgp-multihop
    exit

    Lines To Add
    ============
    router bgp 65001
     neighbor 10.0.0.4 ebgp-multihop 255
    exit

The commit 767aaa3a8048 is not sufficient and frr-reload needs to be
fixed to handle both unspecified and specified cases.

Signed-off-by: Nobuhiro MIKI <nob@bobuhiro11.net>
2 months agotests: Add a test that shows the v6 recursive nexthop problem
Donald Sharp [Mon, 27 Jan 2025 15:34:31 +0000 (10:34 -0500)]
tests: Add a test that shows the v6 recursive nexthop problem

Currently FRR does not handle v6 recurisive resolution properly
when the route being recursed through changes and the most
significant bits of the route are not changed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 months agoMerge pull request #17941 from opensourcerouting/fix-dst-src
Russ White [Tue, 28 Jan 2025 17:23:06 +0000 (12:23 -0500)]
Merge pull request #17941 from opensourcerouting/fix-dst-src

static: fix botched staticd YANG conversion for dst-src

3 months agoMerge pull request #17802 from askorichenko/test-fix-table-map
Russ White [Tue, 28 Jan 2025 17:20:43 +0000 (12:20 -0500)]
Merge pull request #17802 from askorichenko/test-fix-table-map

bgpd: fix table-map option

3 months agoMerge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops
Russ White [Tue, 28 Jan 2025 17:19:07 +0000 (12:19 -0500)]
Merge pull request #17906 from LabNConsulting/aceelindem/ospf-prune-dup-next-hops

ospfd: Prune duplicate next-hop when installing into zebra route table.

3 months agoMerge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping
Russ White [Tue, 28 Jan 2025 16:49:20 +0000 (11:49 -0500)]
Merge pull request #17848 from pguibert6WIND/isis_srv6_topo1_ping

Isis srv6 topo1 ping

3 months agoMerge pull request #17924 from donaldsharp/evaluate_paths_optimization
Russ White [Tue, 28 Jan 2025 16:29:15 +0000 (11:29 -0500)]
Merge pull request #17924 from donaldsharp/evaluate_paths_optimization

bgpd: Optimize evaluate paths for a peer going down

3 months agoMerge pull request #17881 from opensourcerouting/fix/last_reset_reason
Russ White [Tue, 28 Jan 2025 15:40:50 +0000 (10:40 -0500)]
Merge pull request #17881 from opensourcerouting/fix/last_reset_reason

bgpd: last reset SNAFU

3 months agolib: fix use after free in `clear event cpu`
David Lamparter [Tue, 28 Jan 2025 15:37:52 +0000 (16:37 +0100)]
lib: fix use after free in `clear event cpu`

Freeing any item here means freeing someone's `event->hist`, leaving a
dangling pointer there.  Which will immediately be written to because
we're executing in a CLI function under the `vty_read` event, whose
`event->hist` is then updated.

Deallocating `event->hist` anywhere other than shutting down the whole
event loop is a bad idea to begin with, just zero out the stats instead.

Fixes: FRRouting/frr#16419
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agoMerge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727
Russ White [Tue, 28 Jan 2025 15:35:57 +0000 (10:35 -0500)]
Merge pull request #17863 from opensourcerouting/fix/bgp_coverity_1617727

bgpd: Check if the peer really exists before sending dynamic capability

3 months agoMerge pull request #17736 from opensourcerouting/table-direct
Russ White [Tue, 28 Jan 2025 15:24:00 +0000 (10:24 -0500)]
Merge pull request #17736 from opensourcerouting/table-direct

bgpd,lib,zebra: permit table-direct on VRFs

3 months agobgpd: Do not ignore auto generated VRF instances when deleting
Donatas Abraitis [Tue, 28 Jan 2025 15:11:58 +0000 (17:11 +0200)]
bgpd: Do not ignore auto generated VRF instances when deleting

When VRF instance is going to be deleted inside bgp_vrf_disable(), it uses
a helper method that skips auto created VRF instances and that leads to STALE
issue.

When creating a VNI for a particular VRF vrfX with e.g. `advertise-all-vni`,
auto VRF instance is created, and then we do `router bgp ASN vrf vrfX`.

But when we do a reload bgp_vrf_disable() is called, and we miss previously
created auto instance.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
3 months agotopotests: test v6 & dst-src in static_simple
David Lamparter [Mon, 27 Jan 2025 17:36:12 +0000 (18:36 +0100)]
topotests: test v6 & dst-src in static_simple

The "static_simple" test has code for testing IPv6 routes, but it wasn't
even being run (duh.)  Enable it, and also test IPv6 dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agostaticd: fix NHT for dst-src routes
David Lamparter [Mon, 27 Jan 2025 16:57:54 +0000 (17:57 +0100)]
staticd: fix NHT for dst-src routes

staticd's NHT code wasn't updating dst-src routes :(

Fixes: FRRouting/frr#14247
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agolib, zebra: carry source prefix in route_notify
David Lamparter [Mon, 27 Jan 2025 19:26:32 +0000 (20:26 +0100)]
lib, zebra: carry source prefix in route_notify

When a daemon wants to know about its routes, make it possible to have
that work for dst-src routes.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agostaticd: fix botched staticd YANG for dst-src
David Lamparter [Mon, 27 Jan 2025 17:18:24 +0000 (18:18 +0100)]
staticd: fix botched staticd YANG for dst-src

The staticd YANG conversion completely f*cked up dst-src routes.
Stupidly enough, the correct thing is much simpler as seen by the amount
of deletes in this commit.

This does, unfortunately, involve a rather annoying YANG edge case with
what should reasonably be an optional leaf as part of a list key, which
is not possible.  It uses `::/0` as unconditional filler instead, since
that is semantically correct.

The `test_yang_mgmt` topotest needed to be adjusted after this to add
`src-prefix='::/0'`.

Fixes: 88fa5104a04a ("staticd : Configuration northbound implementation")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agobgpd: fix table-map option
Alexander Skorichenko [Thu, 23 Jan 2025 10:35:44 +0000 (11:35 +0100)]
bgpd: fix table-map option

Schedule zebra to withdraw routes filtered out by a table-map.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
3 months agozebra: install dst-src routes without NHG
David Lamparter [Mon, 27 Jan 2025 16:57:15 +0000 (17:57 +0100)]
zebra: install dst-src routes without NHG

The Linux kernel doesn't support dst-src routes with NHGs as nexthop,
for some (rather dubious) caching reasons.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 months agoMerge pull request #17905 from pguibert6WIND/advertised_routes_incorrect_json
Donatas Abraitis [Mon, 27 Jan 2025 21:32:33 +0000 (23:32 +0200)]
Merge pull request #17905 from pguibert6WIND/advertised_routes_incorrect_json

Advertised routes incorrect json

3 months agoMerge pull request #17919 from pguibert6WIND/bgp_suppressed_attribute
Donatas Abraitis [Mon, 27 Jan 2025 21:31:46 +0000 (23:31 +0200)]
Merge pull request #17919 from pguibert6WIND/bgp_suppressed_attribute

Bgp suppressed attribute

3 months agozebra: include resolving nexthops in nhg hash
Mark Stapp [Mon, 27 Jan 2025 19:17:24 +0000 (14:17 -0500)]
zebra: include resolving nexthops in nhg hash

Ensure that the nhg hash comparison function includes all
nexthops, including recursive-resolving nexthops.

Signed-off-by: Mark Stapp <mjs@cisco.com>
3 months agopimd: Close AutoRP socket when not needed
Nathan Bahr [Mon, 27 Jan 2025 15:57:04 +0000 (15:57 +0000)]
pimd: Close AutoRP socket when not needed

Don't leave the socket open if we are not enabled for discovery
or announcements.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
3 months agoMerge pull request #17926 from opensourcerouting/fix/remove_addpath_dynamic_handling
Donald Sharp [Mon, 27 Jan 2025 12:14:00 +0000 (07:14 -0500)]
Merge pull request #17926 from opensourcerouting/fix/remove_addpath_dynamic_handling

Revert "bgpd: Handle Addpath capability using dynamic capabilities"