]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
10 months agobgpd: Relax OAD (One-Administration-Domain) for RFC8212 16290/head
Donatas Abraitis [Mon, 24 Jun 2024 17:16:16 +0000 (20:16 +0300)]
bgpd: Relax OAD (One-Administration-Domain) for RFC8212

RFC 8212 defines leak prevention for eBGP peers, but BGP-OAD defines a new
peering type One Administrative Domain (OAD), where multiple ASNs could be used
inside a single administrative domain. OAD allows sending non-transitive attributes,
so this prevention should be relaxed too.

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

10 months agoMerge pull request #16279 from FRRouting/mergify/bp/stable/10.0/pr-16211
Donatas Abraitis [Tue, 25 Jun 2024 10:48:05 +0000 (13:48 +0300)]
Merge pull request #16279 from FRRouting/mergify/bp/stable/10.0/pr-16211

bgpd: Check if we have really enough data before doing memcpy for software version (backport #16211)

10 months agoMerge pull request #16275 from FRRouting/mergify/bp/stable/10.0/pr-16242
Jafar Al-Gharaibeh [Tue, 25 Jun 2024 05:25:42 +0000 (01:25 -0400)]
Merge pull request #16275 from FRRouting/mergify/bp/stable/10.0/pr-16242

bgpd: Set last reset reason to admin shutdown if it was manually (backport #16242)

10 months agoMerge pull request #16268 from louis-6wind/show-isis-database-crash-bp
Russ White [Mon, 24 Jun 2024 21:18:26 +0000 (17:18 -0400)]
Merge pull request #16268 from louis-6wind/show-isis-database-crash-bp

isisd: fix crash when displaying asla in json

10 months agobgpd: Check if we have really enough data before doing memcpy for software version 16279/head
Donatas Abraitis [Wed, 12 Jun 2024 19:54:45 +0000 (22:54 +0300)]
bgpd: Check if we have really enough data before doing memcpy for software version

If we receive CAPABILITY message (software-version), we SHOULD check if we really
have enough data before doing memcpy(), that could also lead to buffer overflow.

(data + len > end) is not enough, because after this check we do data++ and later
memcpy(..., data, len). That means we have one more byte.

Hit this through fuzzing by

```
    0 0xaaaaaadf872c in __asan_memcpy (/home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/.libs/bgpd+0x35872c) (BuildId: 9c6e455d0d9a20f5a4d2f035b443f50add9564d7)
    1 0xaaaaab06bfbc in bgp_dynamic_capability_software_version /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3713:3
    2 0xaaaaab05ccb4 in bgp_capability_msg_parse /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3839:4
    3 0xaaaaab05c074 in bgp_capability_receive /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:3980:9
    4 0xaaaaab05e48c in bgp_process_packet /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_packet.c:4109:11
    5 0xaaaaaae36150 in LLVMFuzzerTestOneInput /home/ubuntu/frr-public/frr_public_private-libfuzzer/bgpd/bgp_main.c:582:3
```

Hit this again by Iggy \m/

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 5d7af51c4f7980507135babd94d392ca179c1bf7)

10 months agobgpd: Remove redundant whitespace before printing the reason of the failed peer 16275/head
Donatas Abraitis [Wed, 19 Jun 2024 11:32:16 +0000 (14:32 +0300)]
bgpd: Remove redundant whitespace before printing the reason of the failed peer

Before:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never  Waiting for peer OPEN (n/a)
```

After:

```
Neighbor        EstdCnt DropCnt ResetTime Reason
127.0.0.1             0       0     never Waiting for peer OPEN (n/a)
```

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

10 months agobgpd: Set last reset reason to admin shutdown if it was manually
Donatas Abraitis [Wed, 19 Jun 2024 11:09:00 +0000 (14:09 +0300)]
bgpd: Set last reset reason to admin shutdown if it was manually

Before this patch, we always printed the last reason "Waiting for OPEN", but
if it's a manual shutdown, then we technically are not waiting for OPEN.

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

10 months agoMerge pull request #16265 from FRRouting/mergify/bp/stable/10.0/pr-16252
Donatas Abraitis [Sat, 22 Jun 2024 18:07:49 +0000 (21:07 +0300)]
Merge pull request #16265 from FRRouting/mergify/bp/stable/10.0/pr-16252

zebra: fix evpn mh bond member proto reinstall (backport #16252)

10 months agoisisd: fix crash when displaying asla in json 16268/head
Louis Scalbert [Tue, 21 May 2024 09:48:58 +0000 (11:48 +0200)]
isisd: fix crash when displaying asla in json

Fix crash when displaying ASLAs (Application Specific Link-Attributes)
with JSON

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 1c397942a46999a850ada62ea015a658373150c6)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agoMerge pull request #16263 from FRRouting/mergify/bp/stable/10.0/pr-16260
Donatas Abraitis [Fri, 21 Jun 2024 14:50:30 +0000 (17:50 +0300)]
Merge pull request #16263 from FRRouting/mergify/bp/stable/10.0/pr-16260

bgpd: fix do not use api.backup_nexthop in ZAPI message (backport #16260)

10 months agozebra: fix evpn mh bond member proto reinstall 16265/head
Chirag Shah [Wed, 19 Jun 2024 00:21:49 +0000 (17:21 -0700)]
zebra: fix evpn mh bond member proto reinstall

In case of EVPN MH bond, a member port going in
protodown state due to external reason (one case being linkflap),
frr updates the state correctly but upon manually
clearing external reason trigger FRR to reinstate
protodown without any reason code.

Fix is to ensure if the protodown reason was external
and new state is to have protodown 'off' then do no reinstate
protodown.

Ticket: #3947432
Testing:
switch:#ip link show swp1
4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
   pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
   1000
       link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff protodown on
       protodown_reason <linkflap>

switch:#ip link set swp1 protodown off protodown_reason linkflap off
switch:#ip link show swp1
 4: swp1: <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> mtu 9216 qdisc
    pfifo_fast master bond1 state DOWN mode DEFAULT group default qlen
    1000
        link/ether 1c:34:da:2c:aa:68 brd ff:ff:ff:ff:ff:ff

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit e4d843b438ae7cbae89ae47af0754fb1db153c6c)

10 months agobgpd: fix do not use api.backup_nexthop in ZAPI message 16263/head
Philippe Guibert [Thu, 20 Jun 2024 16:02:26 +0000 (18:02 +0200)]
bgpd: fix do not use api.backup_nexthop in ZAPI message

The backup_nexthop entry list has been populated by mistake,
and should not. Fix this by reverting the introduced behavior.

Fixes: 237ebf8d4503 ("bgpd: rework bgp_zebra_announce() function, separate nexthop handling")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit d4390fc21795b09b84a6b95b1f8fa1ac2b3dcda9)

10 months agoMerge pull request #16203 from FRRouting/mergify/bp/stable/10.0/pr-16191
Donatas Abraitis [Fri, 14 Jun 2024 12:31:52 +0000 (15:31 +0300)]
Merge pull request #16203 from FRRouting/mergify/bp/stable/10.0/pr-16191

lib: fix copy srte_color from zapi_nexthop structure (backport #16191)

10 months agoMerge pull request #16212 from FRRouting/mergify/bp/stable/10.0/pr-16210
Jafar Al-Gharaibeh [Thu, 13 Jun 2024 19:55:37 +0000 (14:55 -0500)]
Merge pull request #16212 from FRRouting/mergify/bp/stable/10.0/pr-16210

lib: fix incorrect use of error checking macro (backport #16210)

10 months agolib: fix incorrect use of error checking macro 16212/head
Christian Hopps [Wed, 12 Jun 2024 22:48:02 +0000 (18:48 -0400)]
lib: fix incorrect use of error checking macro

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 07090ccf5a3c81f650faef914a646f0e31a26fc8)

10 months agolib: fix copy srte_color from zapi_nexthop structure 16203/head
Philippe Guibert [Sun, 17 Dec 2023 20:04:31 +0000 (21:04 +0100)]
lib: fix copy srte_color from zapi_nexthop structure

When switching from nexthop to zapi_nexthop, the srte color
is copied. Do the same in reverse.

Fixes: 31f937fb43f4 ("lib, zebra: Add SR-TE policy infrastructure to zebra")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 49bc1b6c21e8da0da82746373a7257aeb2c9fa4a)

10 months agoFRR Release 10.0.1 docker/10.0.1 frr-10.0.1
Jafar Al-Gharaibeh [Thu, 6 Jun 2024 05:01:52 +0000 (00:01 -0500)]
FRR Release 10.0.1

Changelog:

bgpd
    Fix route leaking from the default l3vrf
    Allow using optional table id for negative `no set table x` command
    Apply noop when doing negative commands for gr operations
    Drop newline in json output for `show bgp afi safi json detail`
    Fix `match peer` when switching between ipv4/ipv6/interface
    Fix `no set as-path prepend asnum...`
    Fix crash when deleting the srv6 locator
    Fix display when using `missing-as-worst`
    Fix dynamic peer graceful restart race condition
    Fix logging message when receiving a software version capability
    Fix show run of network route-distinguisher
    Fix srv6 memory leaks spotted by asan
    Fix the order of null check and zapi decode
    Ignore validating the attribute flags if path-attribute is configured
    Inherit `capability software-version` flag from the peer-group
    Inherit `enforce-first-as` flag from the peer-group
    Move srv6 cleanup functions
    Print old/new states of graceful restart fsm
    Revert "Fix pointer arithmetic in bgp snmp module"

debian, redhat, snapcraft
    Libyang min version is 2.1.128

isisd
    Fix heap-after-free with prefix sid
    Fix ip/ipv6 reachability tlvs

lib
    Check for not being a blackhole route
    Fix exit commands
    Remove nb/yang memory cleanup when daemonizing
    Replace deprecated ares_gethostbyname
    Replace deprecated ares_process()

nhrpd
    Fix race condition
    Fix core dump on shutdown
    Clean up shortcut cache entries on termination

ospf6d
    Accept cli `no` for point-to-multipoint
    Fix defun formatting wrecked by clang
    Fix loopback/ptp/ptmp conn. route checks
    Force recalculate on interface_up
    Prevent heap-buffer-overflow with unknown
    Ospfv3 route change comparision fixed for asbr-only change

ospfd
    Correct opaque lsa extended parser
    Fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer
    Protect call to get_edge() in ospf_te.c
    Solved crash in ri parsing with ospf te
    Revert "Fix some dicey pointer arith in snmp module"

pimd
    Fix crash unconfiguring rp keepalive timer
    Fix dr-priority range
    Fix null register before aging out reg-stop
    Fix order of operations for evaluating join
    Fix crash when mixing ssm/any-source joins

tests
    Check if ibgp session can drop invalid aigp attribute

tools
    Frr-reload strip interface vrf ctx line
    Handle seq num for bgp as-path in frr-reload.py

topotests
    Do not check table version

vtysh
    Check if bgpd is enabled before installing vtysh commands for rpki
    Fix `show route-map` command when calling via `do`
    Show `ip ospf network ...` even if it's not the same as the interface type

zebra
    Deny the routes if ip protocol cli refers to an undefined rmap
    Fix encoded dnssl length
    Fix evpn svd based remote nh neigh del
    Fix mpls command

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
10 months agoMerge pull request #16175 from FRRouting/mergify/bp/stable/10.0/pr-16170
Jafar Al-Gharaibeh [Thu, 6 Jun 2024 04:18:21 +0000 (23:18 -0500)]
Merge pull request #16175 from FRRouting/mergify/bp/stable/10.0/pr-16170

nhrpd: cleans up shortcut cache entries on termination (backport #16170)

10 months agonhrpd: cleans up shortcut cache entries on termination 16175/head
Dave LeRoy [Wed, 5 Jun 2024 17:22:57 +0000 (10:22 -0700)]
nhrpd: cleans up shortcut cache entries on termination

nhrp_shortcut_terminate() previously was just freeing the associated AFI shortcut
RIBs and not addressing existing shortcut cache entries. This cause a use after
free issue in vrf_terminate() later in the terminate sequence

NHRP: Received signal 7 at 1717516286 (si_addr 0x1955d, PC 0x7098786912c0); aborting...
NHRP: zlog_signal+0xf5                   709878ad1255     7fff3d992eb0 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: core_handler+0xb5                  709878b0db85     7fff3d992ff0 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: __sigaction+0x50                   709878642520     7fff3d993140 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x709878600000)
NHRP:     ---- signal ----
NHRP: __lll_lock_wait_private+0x90       7098786912c0     7fff3d9936d8 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x709878600000)
NHRP: pthread_mutex_lock+0x112           709878698002     7fff3d9936e0 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x709878600000)
NHRP: _event_add_read_write+0x63         709878b1f423     7fff3d993700 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: zclient_send_message+0xd4          709878b37614     7fff3d993770 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: nhrp_route_announce+0x1ad          5ab34d63d39d     7fff3d993790 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: nhrp_shortcut_cache_notify+0xd8     5ab34d63e758     7fff3d99d4e0 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: nhrp_cache_free+0x165              5ab34d632f25     7fff3d99d510 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: hash_iterate+0x4d                  709878ab949d     7fff3d99d540 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: nhrp_cache_interface_del+0x37      5ab34d633eb7     7fff3d99d580 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: nhrp_if_delete_hook+0x26           5ab34d6350d6     7fff3d99d5a0 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: if_delete_retain+0x3d              709878abcd1d     7fff3d99d5c0 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: if_delete+0x4c                     709878abd87c     7fff3d99d600 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: if_terminate+0x53                  709878abda83     7fff3d99d630 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: vrf_terminate_single+0x24          709878b23c74     7fff3d99d670 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: nhrp_request_stop+0x34             5ab34d636844     7fff3d99d690 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: frr_sigevent_process+0x53          709878b0df53     7fff3d99d6a0 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: event_fetch+0x6c5                  709878b20405     7fff3d99d6c0 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: frr_run+0xd3                       709878ac8163     7fff3d99d840 /usr/lib/frr/libfrr.so.0 (mapped at 0x709878a00000)
NHRP: main+0x195                         5ab34d631915     7fff3d99d960 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)
NHRP: __libc_init_first+0x90             709878629d90     7fff3d99d980 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x709878600000)
NHRP: __libc_start_main+0x80             709878629e40     7fff3d99da20 /lib/x86_64-linux-gnu/libc.so.6 (mapped at 0x709878600000)
NHRP: _start+0x25                        5ab34d631b65     7fff3d99da70 /usr/lib/frr/nhrpd (mapped at 0x5ab34d621000)

Signed-off-by: Dave LeRoy <dleroy@labn.net>
(cherry picked from commit 2b7e357cf902190aad544b4f7d46e9f229454346)

10 months agoMerge pull request #16104 from FRRouting/mergify/bp/stable/10.0/pr-16098
Donatas Abraitis [Sun, 2 Jun 2024 18:12:26 +0000 (21:12 +0300)]
Merge pull request #16104 from FRRouting/mergify/bp/stable/10.0/pr-16098

ospf6d: OSPFv3 route change comparision fixed for ASBR-only change (backport #16098)

10 months agoospf6d: OSPFv3 route change comparision fixed for ASBR-only change 16104/head
Acee [Tue, 28 May 2024 14:02:27 +0000 (10:02 -0400)]
ospf6d: OSPFv3 route change comparision fixed for ASBR-only change

When a router route already exists in the area border routers table
as an ABR and it solely changes its ABR or ASBR status, the change
was missed and border route is not updated. This fixes the comparison
for the router_bits in the ospf6_path structure.

This fixes issue https://github.com/FRRouting/frr/issues/16053 although
the actual problem is not the computing router (r2) and not the OSPFv3
redistribution (r3).

Signed-off-by: Acee <aceelindem@gmail.com>
(cherry picked from commit 772688d2d3c03d8eeeb711c2fe3735c9e0885498)

10 months agoMerge pull request #16133 from FRRouting/mergify/bp/stable/10.0/pr-16115
Donald Sharp [Sat, 1 Jun 2024 14:03:32 +0000 (10:03 -0400)]
Merge pull request #16133 from FRRouting/mergify/bp/stable/10.0/pr-16115

pimd: fix crash when mixing ssm/any-source joins (backport #16115)

10 months agoMerge pull request #16134 from FRRouting/mergify/bp/stable/10.0/pr-16111
Donald Sharp [Sat, 1 Jun 2024 14:02:50 +0000 (10:02 -0400)]
Merge pull request #16134 from FRRouting/mergify/bp/stable/10.0/pr-16111

ospf6d: Prevent heap-buffer-overflow with unknown type (backport #16111)

10 months agoospf6d: Prevent heap-buffer-overflow with unknown type 16134/head
Iggy Frankovic [Thu, 30 May 2024 11:59:54 +0000 (07:59 -0400)]
ospf6d: Prevent heap-buffer-overflow with unknown type

When parsing a osf6 grace lsa field and we receive an
unknown tlv type, ospf6d was not incrementing the pointer
to get beyond the tlv.  Leaving a situation where ospf6d
would parse the packet incorrectly.

Signed-off-by: Iggy Frankovic <iggy07@gmail.com>
(cherry picked from commit 826f2510e67711045e52cf4b5e3ddef514ed556e)

10 months agopimd: fix crash when mixing ssm/any-source joins 16133/head
Jafar Al-Gharaibeh [Thu, 30 May 2024 17:46:47 +0000 (12:46 -0500)]
pimd: fix crash when mixing ssm/any-source joins

There is no reason to call `igmp_anysource_forward_stop()` inside a call to
`igmp_get_source_by_addr()`; not only it is not expected for a "get" function
to perform such an action, but also the decision to start/stop forwarding is
already handled correctly by pim outside `igmp_get_source_by_addr()`.
That call was left there from the days pim was initially imported into the sources.

The problem/crash was happening because `igmp_find_source_by_addr()` would fail to
find the group/source combo when mixing `(*, G)` and `(S, G)`. When having an existing
flow `(*, G)`, and a new `(S, G)` igmp is received, a new entry is correctly created.
`igmp_anysource_forward_stop(group)` always stops and eventually frees `(*, G)`, even
when the new igmp is `(S, G)`, leaving a bad state. I.e, the new entry for `(S, G)`
causes `(*, G)` to be deleted.

Tested the fix with multiple receivers on the same interface with several ssm and
any source senders and receivers with various combination of start/stop orders and
they all worked correctly.

Fixes: #15630
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit a951960a15e8b6b5ed248abb0ecc9eb4e9a3427f)

10 months agoMerge pull request #16116 from FRRouting/mergify/bp/stable/10.0/pr-15879
Donald Sharp [Fri, 31 May 2024 14:55:21 +0000 (10:55 -0400)]
Merge pull request #16116 from FRRouting/mergify/bp/stable/10.0/pr-15879

nhrpd: fixes core dump on shutdown (backport #15879)

10 months agoMerge pull request #16122 from opensourcerouting/fix/add_missing_backports_10.0
Jafar Al-Gharaibeh [Fri, 31 May 2024 13:51:17 +0000 (08:51 -0500)]
Merge pull request #16122 from opensourcerouting/fix/add_missing_backports_10.0

tests: fix duplicates in bgp_vrf_route_leak_basic

10 months agotests: fix duplicates in bgp_vrf_route_leak_basic 16122/head
Louis Scalbert [Fri, 9 Feb 2024 14:55:47 +0000 (15:55 +0100)]
tests: fix duplicates in bgp_vrf_route_leak_basic

Test functions were duplicated by mistakes. They were identical.

Fixes: 8af61c8a34 ("topotests: test leak from the default vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
10 months agotests: add a topotest to verify nhrp shortcuts in a redundant nhs topology 16116/head
dleroy [Mon, 29 Apr 2024 21:59:25 +0000 (14:59 -0700)]
tests: add a topotest to verify nhrp shortcuts in a redundant nhs topology

Contains 2 testcases. The first does a basic configuration/connectivity.
The second testcase initiates a shortcut through the primary NHS,
verifies shortcut routes are installed. Primary NHS interface brought
down and verify that the shortcut is not impacted. Finally verify that
after the shortcut expires, it is able to be re-established via a backup
NHS.

Signed-off-by: dleroy <dleroy@labn.net>
(cherry picked from commit a7037ab23407d5667385f9be096e347caa0c94ad)

10 months agonhrpd: fixes core dump on shutdown
dleroy [Mon, 29 Apr 2024 16:40:21 +0000 (09:40 -0700)]
nhrpd: fixes core dump on shutdown

When nhrpd is shutdown via nhrp_request_stop() the shutdown
sequence was not handling the case where there are active
shortcut routes installed. The zebra client and shortcut rib
were being cleaned up before vrf_terminate() had an opportunity
to delete the active routes.

Signed-off-by: dleroy <dleroy@labn.net>
(cherry picked from commit a4ee9762734332697ba186ae7223da1eb0445cb2)

11 months agoMerge pull request #16084 from FRRouting/mergify/bp/stable/10.0/pr-15674
Donald Sharp [Sat, 25 May 2024 14:51:17 +0000 (10:51 -0400)]
Merge pull request #16084 from FRRouting/mergify/bp/stable/10.0/pr-15674

ospfd: Solved crash in RI parsing with OSPF TE (backport #15674)

11 months agoospfd: protect call to get_edge() in ospf_te.c 16084/head
Olivier Dugeon [Tue, 16 Apr 2024 14:42:06 +0000 (16:42 +0200)]
ospfd: protect call to get_edge() in ospf_te.c

During fuzzing, Iggy Frankovic discovered that get_edge() function in ospf_te.c
could return null pointer, in particular when the link_id or advertised router
IP addresses are fuzzed. As the null pointer returned by get_edge() function is
not handlei by calling functions, this could cause ospfd crash.

This patch introduces new verification of returned pointer by get_edge()
function and stop the processing in case of null pointer. In addition, link ID
and advertiser router ID are validated before calling ls_find_edge_by_key() to
avoid the creation of a new edge with an invalid key.

CVE-2024-34088

Co-authored-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit 8c177d69e32b91b45bda5fc5da6511fa03dc11ca)

11 months agoospfd: Correct Opaque LSA Extended parser
Olivier Dugeon [Fri, 5 Apr 2024 10:57:11 +0000 (12:57 +0200)]
ospfd: Correct Opaque LSA Extended parser

Iggy Frankovic discovered another ospfd crash when performing fuzzing of OSPF
LSA packets. The crash occurs in ospf_te_parse_ext_link() function when
attemping to read Segment Routing Adjacency SID subTLVs. The original code
doesn't check if the size of the Extended Link TLVs and subTLVs have the correct
length. In presence of erronous LSA, this will cause a buffer overflow and ospfd
crashes.

This patch introduces new verification of the subTLVs size for Extended Link
TLVs and subTLVs. Similar check has been also introduced for the Extended
Prefix TLV.

Co-authored-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit 5557a289acdaeec8cc63ffc97b5c2abf6dee7b3a)

11 months agoospfd: Solved crash in RI parsing with OSPF TE
Olivier Dugeon [Wed, 3 Apr 2024 14:28:23 +0000 (16:28 +0200)]
ospfd: Solved crash in RI parsing with OSPF TE

Iggy Frankovic discovered another ospfd crash when performing fuzzing of OSPF
LSA packets. The crash occurs in ospf_te_parse_ri() function when attemping to
read Segment Routing subTLVs. The original code doesn't check if the size of
the SR subTLVs have the correct length. In presence of erronous LSA, this will
cause a buffer overflow and ospfd crash.

This patch introduces new verification of the subTLVs size for Router
Information TLV.

Co-authored-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
(cherry picked from commit f69d1313b19047d3d83fc2b36a518355b861dfc4)

11 months agoMerge pull request #16082 from FRRouting/mergify/bp/stable/10.0/pr-16044
Donald Sharp [Fri, 24 May 2024 14:29:30 +0000 (10:29 -0400)]
Merge pull request #16082 from FRRouting/mergify/bp/stable/10.0/pr-16044

bgpd: fix route leaking from the default l3vrf (backport #16044)

11 months agoMerge pull request #16077 from FRRouting/mergify/bp/stable/10.0/pr-16021
Donald Sharp [Fri, 24 May 2024 13:47:34 +0000 (09:47 -0400)]
Merge pull request #16077 from FRRouting/mergify/bp/stable/10.0/pr-16021

isisd: fix heap-after-free with prefix sid (backport #16021)

11 months agobgpd, tests: fix route leaking from the default l3vrf 16082/head
Louis Scalbert [Fri, 17 May 2024 15:57:46 +0000 (17:57 +0200)]
bgpd, tests: fix route leaking from the default l3vrf

Leaked route from the l3VRF are installed with the loopback as the
nexthop interface instead of the real interface.

> B>* 10.0.0.0/30 [20/0] is directly connected, lo (vrf default), weight 1, 00:21:01

Routing of packet from a L3VRF to the default L3VRF destined to a leak
prefix fails because of the default routing rules on Linux.

> 0:      from all lookup local
> 1000:   from all lookup [l3mdev-table]
> 32766:  from all lookup main
> 32767:  from all lookup default

When the packet is received in the loopback interface, the local rules
are checked without match, then the l3mdev-table says to route to the
loopback. A routing loop occurs (TTL is decreasing).

> 12:26:27.928748 ens37 In  IP (tos 0x0, ttl 64, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64
> 12:26:27.928784 red   Out IP (tos 0x0, ttl 63, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64
> 12:26:27.928797 ens38 Out IP (tos 0x0, ttl 63, id 26402, offset 0, flags [DF], proto ICMP (1), length 84)
>     10.0.0.2 > 10.0.1.2: ICMP echo request, id 47463, seq 1, length 64

Do not set the lo interface as a nexthop interface. Keep the real
interface where possible.

Fixes: db7cf73a33 ("bgpd: fix interface on leaks from redistribute connected")
Fixes: 067fbab4e4 ("bgpd: fix interface on leaks from network statement")
Fixes: 8a02d9fe1e ("bgpd: Set nh ifindex to VRF's interface, not the real")
Fixes: https://github.com/FRRouting/frr/issues/15909
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 31fc89b2301ca624a331539c0a077627bacddbe2)

11 months agoisisd: fix heap-after-free with prefix sid 16077/head
Louis Scalbert [Thu, 16 May 2024 14:44:03 +0000 (16:44 +0200)]
isisd: fix heap-after-free with prefix sid

> ==2334217==ERROR: AddressSanitizer: heap-use-after-free on address 0x61000001d0a0 at pc 0x563828c8de6f bp 0x7fffbdaee560 sp 0x7fffbdaee558
> READ of size 1 at 0x61000001d0a0 thread T0
>     #0 0x563828c8de6e in prefix_sid_cmp isisd/isis_spf.c:187
>     #1 0x7f84b8204f71 in hash_get lib/hash.c:142
>     #2 0x7f84b82055ec in hash_lookup lib/hash.c:184
>     #3 0x563828c8e185 in isis_spf_prefix_sid_lookup isisd/isis_spf.c:209
>     #4 0x563828c90642 in isis_spf_add2tent isisd/isis_spf.c:598
>     #5 0x563828c91cd0 in process_N isisd/isis_spf.c:824
>     #6 0x563828c93852 in isis_spf_process_lsp isisd/isis_spf.c:1041
>     #7 0x563828c98dde in isis_spf_loop isisd/isis_spf.c:1821
>     #8 0x563828c998de in isis_run_spf isisd/isis_spf.c:1983
>     #9 0x563828c99c7b in isis_run_spf_with_protection isisd/isis_spf.c:2009
>     #10 0x563828c9a60d in isis_run_spf_cb isisd/isis_spf.c:2090
>     #11 0x7f84b835c72d in event_call lib/event.c:2011
>     #12 0x7f84b8236d93 in frr_run lib/libfrr.c:1217
>     #13 0x563828c21918 in main isisd/isis_main.c:346
>     #14 0x7f84b7e4fd09 in __libc_start_main ../csu/libc-start.c:308
>     #15 0x563828c20df9 in _start (/usr/lib/frr/isisd+0xf5df9)
>
> 0x61000001d0a0 is located 96 bytes inside of 184-byte region [0x61000001d040,0x61000001d0f8)
> freed by thread T0 here:
>     #0 0x7f84b88a9b6f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123
>     #1 0x7f84b8263bae in qfree lib/memory.c:130
>     #2 0x563828c8e433 in isis_vertex_del isisd/isis_spf.c:249
>     #3 0x563828c91c95 in process_N isisd/isis_spf.c:811
>     #4 0x563828c93852 in isis_spf_process_lsp isisd/isis_spf.c:1041
>     #5 0x563828c98dde in isis_spf_loop isisd/isis_spf.c:1821
>     #6 0x563828c998de in isis_run_spf isisd/isis_spf.c:1983
>     #7 0x563828c99c7b in isis_run_spf_with_protection isisd/isis_spf.c:2009
>     #8 0x563828c9a60d in isis_run_spf_cb isisd/isis_spf.c:2090
>     #9 0x7f84b835c72d in event_call lib/event.c:2011
>     #10 0x7f84b8236d93 in frr_run lib/libfrr.c:1217
>     #11 0x563828c21918 in main isisd/isis_main.c:346
>     #12 0x7f84b7e4fd09 in __libc_start_main ../csu/libc-start.c:308
>
> previously allocated by thread T0 here:
>     #0 0x7f84b88aa037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
>     #1 0x7f84b8263a6c in qcalloc lib/memory.c:105
>     #2 0x563828c8e262 in isis_vertex_new isisd/isis_spf.c:225
>     #3 0x563828c904db in isis_spf_add2tent isisd/isis_spf.c:588
>     #4 0x563828c91cd0 in process_N isisd/isis_spf.c:824
>     #5 0x563828c93852 in isis_spf_process_lsp isisd/isis_spf.c:1041
>     #6 0x563828c98dde in isis_spf_loop isisd/isis_spf.c:1821
>     #7 0x563828c998de in isis_run_spf isisd/isis_spf.c:1983
>     #8 0x563828c99c7b in isis_run_spf_with_protection isisd/isis_spf.c:2009
>     #9 0x563828c9a60d in isis_run_spf_cb isisd/isis_spf.c:2090
>     #10 0x7f84b835c72d in event_call lib/event.c:2011
>     #11 0x7f84b8236d93 in frr_run lib/libfrr.c:1217
>     #12 0x563828c21918 in main isisd/isis_main.c:346
>     #13 0x7f84b7e4fd09 in __libc_start_main ../csu/libc-start.c:308
>
> SUMMARY: AddressSanitizer: heap-use-after-free isisd/isis_spf.c:187 in prefix_sid_cmp
> Shadow bytes around the buggy address:
>   0x0c207fffb9c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
>   0x0c207fffb9d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
>   0x0c207fffb9e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
>   0x0c207fffb9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
>   0x0c207fffba00: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
> =>0x0c207fffba10: fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fa
>   0x0c207fffba20: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
>   0x0c207fffba30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
>   0x0c207fffba40: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
>   0x0c207fffba50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
>   0x0c207fffba60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
> Shadow byte legend (one shadow byte represents 8 application bytes):
>   Addressable:           00
>   Partially addressable: 01 02 03 04 05 06 07
>   Heap left redzone:       fa
>   Freed heap region:       fd
>   Stack left redzone:      f1
>   Stack mid redzone:       f2
>   Stack right redzone:     f3
>   Stack after return:      f5
>   Stack use after scope:   f8
>   Global redzone:          f9
>   Global init order:       f6
>   Poisoned by user:        f7
>   Container overflow:      fc
>   Array cookie:            ac
>   Intra object redzone:    bb
>   ASan internal:           fe
>   Left alloca redzone:     ca
>   Right alloca redzone:    cb
>   Shadow gap:              cc
> ==2334217==ABORTING

Fixes: 2f7cc7bcd3 ("isisd: detect Prefix-SID collisions and handle them appropriately")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit e697de58431474cdb06eff79bcbc70de4215e222)

11 months agoMerge pull request #16060 from FRRouting/mergify/bp/stable/10.0/pr-16032
Donald Sharp [Tue, 21 May 2024 18:45:08 +0000 (14:45 -0400)]
Merge pull request #16060 from FRRouting/mergify/bp/stable/10.0/pr-16032

zebra: Deny the routes if ip protocol CLI refers to an undefined rmap (backport #16032)

11 months agozebra: Deny the routes if ip protocol CLI refers to an undefined rmap 16060/head
Pooja Jagadeesh Doijode [Thu, 16 May 2024 23:36:18 +0000 (16:36 -0700)]
zebra: Deny the routes if ip protocol CLI refers to an undefined rmap

Currently zebra does not deny the routes if `ip protocol <proto> route-map
FOO`
commmand is configured with reference to an undefined route-map (FOO in
this case).
However, on FRR restart, in zebra_route_map_check() routes get denied
if route-map name is available but the route-map is not defined. This
change was introduced in fd303a4ba14c762550db972317e1e88528768005.

Fix:
When `ip protocol <proto> route-map FOO` CLI is configured with reference to an
undefined route-map FOO, let the processing in ip_protocol_rm_add() and
ip_protocol_rm_del() go through so that zebra can deny the routes instead
of simply returning. This will result in consistent behavior.

Testing Done:

Before fix:
```
spine-1# configure
spine-1(config)# ip protocol bgp route-map rmap7

root@spine-1:mgmt:/var/home/cumulus# vtysh -c "show run" | grep rmap7
ip protocol bgp route-map rmap7
root@spine-1:mgmt:/var/home/cumulus#

spine-1(config)# do show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       Z - FRR,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 27.0.0.1/32 is directly connected, lo, 02:27:45
B>* 27.0.0.3/32 [20/0] via fe80::202:ff:fe00:21, downlink_1, weight 1, 02:27:35
B>* 27.0.0.4/32 [20/0] via fe80::202:ff:fe00:29, downlink_2, weight 1, 02:27:40
B>* 27.0.0.5/32 [20/0] via fe80::202:ff:fe00:31, downlink_3, weight 1, 02:27:40
B>* 27.0.0.6/32 [20/0] via fe80::202:ff:fe00:39, downlink_4, weight 1, 02:27:40
```

After fix:
```
spine-1(config)# ip protocol bgp route-map route-map67
spine-1(config)# do show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, A - Babel, D - SHARP, F - PBR, f - OpenFabric,
       Z - FRR,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 27.0.0.1/32 is directly connected, lo, 00:35:03
B   27.0.0.3/32 [20/0] via fe80::202:ff:fe00:21, downlink_1 inactive, weight 1, 00:34:58
B   27.0.0.4/32 [20/0] via fe80::202:ff:fe00:29, downlink_2 inactive, weight 1, 00:34:57
B   27.0.0.5/32 [20/0] via fe80::202:ff:fe00:31, downlink_3 inactive, weight 1, 00:34:57
B   27.0.0.6/32 [20/0] via fe80::202:ff:fe00:39, downlink_4 inactive, weight 1, 00:34:58
spine-1(config)#

root@spine-1:mgmt:/var/home/cumulus# ip route show
root@spine-1:mgmt:/var/home/cumulus#
```

Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
(cherry picked from commit 705e8ef78f84dea3af5943a74571f968ad076c8d)

11 months agoMerge pull request #16045 from FRRouting/mergify/bp/stable/10.0/pr-16033
Donald Sharp [Mon, 20 May 2024 19:21:12 +0000 (15:21 -0400)]
Merge pull request #16045 from FRRouting/mergify/bp/stable/10.0/pr-16033

bgpd: Fix logging message when receiving a software version capability (backport #16033)

11 months agoMerge pull request #16047 from FRRouting/mergify/bp/stable/10.0/pr-16022
Donald Sharp [Mon, 20 May 2024 19:20:12 +0000 (15:20 -0400)]
Merge pull request #16047 from FRRouting/mergify/bp/stable/10.0/pr-16022

bgpd: Fix `match peer` when switching between IPv4/IPv6/interface (backport #16022)

11 months agobgpd: Fix `match peer` when switching between IPv4/IPv6/interface 16047/head
Donatas Abraitis [Thu, 16 May 2024 17:49:56 +0000 (20:49 +0300)]
bgpd: Fix `match peer` when switching between IPv4/IPv6/interface

Without this patch we MUST follow this sequence:

```
no match peer 10.0.0.1
match peer 2a01::1
```

Otherwise, both IPv4/IPv6 values are set/compiled, thus when printing the
configuration in show running, we see the first one (IPv4).

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

11 months agobgpd: Fix logging message when receiving a software version capability 16045/head
Donatas Abraitis [Fri, 17 May 2024 19:04:40 +0000 (22:04 +0300)]
bgpd: Fix logging message when receiving a software version capability

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

11 months agoMerge pull request #16038 from FRRouting/mergify/bp/stable/10.0/pr-16019
Jafar Al-Gharaibeh [Mon, 20 May 2024 03:17:24 +0000 (22:17 -0500)]
Merge pull request #16038 from FRRouting/mergify/bp/stable/10.0/pr-16019

zebra: fix mpls command (backport #16019)

11 months agozebra: fix mpls command 16038/head
anlan_cs [Thu, 16 May 2024 08:44:45 +0000 (16:44 +0800)]
zebra: fix mpls command

Configured with "mpls label bind 1.1.1.1/32 explicit-null", the running
configuration is:
```
!
mpls label bind 1.1.1.1/32 IPv4 Explicit Null
!
```

After this commit, the running configuration is:
```
!
mpls label bind 1.1.1.1/32 explicit-null
!
```

And add the support for the "no" form:
```
anlan(config)# mpls label bind 1.1.1.1/32 explicit-null
anlan(config)# no mpls label bind 1.1.1.1/32 explicit-null
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
(cherry picked from commit 05ad3ccb034c174d2e853e88b826ca0db1e77f45)

11 months agoMerge pull request #16029 from FRRouting/mergify/bp/stable/10.0/pr-15566
Donatas Abraitis [Sat, 18 May 2024 13:10:43 +0000 (16:10 +0300)]
Merge pull request #16029 from FRRouting/mergify/bp/stable/10.0/pr-15566

lib: remove nb/yang memory cleanup when daemonizing (backport #15566)

11 months agoMerge pull request #16030 from FRRouting/mergify/bp/stable/10.0/pr-15711
Donald Sharp [Fri, 17 May 2024 15:49:00 +0000 (11:49 -0400)]
Merge pull request #16030 from FRRouting/mergify/bp/stable/10.0/pr-15711

topotests: do not check table version (backport #15711)

11 months agoMerge pull request #16025 from FRRouting/mergify/bp/stable/10.0/pr-16020
Donald Sharp [Fri, 17 May 2024 13:42:14 +0000 (09:42 -0400)]
Merge pull request #16025 from FRRouting/mergify/bp/stable/10.0/pr-16020

bgpd: fix dynamic peer graceful restart race condition (backport #16020)

11 months agotopotests: do not check table version 16030/head
Louis Scalbert [Tue, 9 Apr 2024 07:45:06 +0000 (09:45 +0200)]
topotests: do not check table version

BGP table version is variable. Don't check it.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 29f47f3debddbea7da5d39d46dbc4a659237acdc)

11 months agolib: remove nb/yang memory cleanup when daemonizing 16029/head
Igor Ryzhov [Sun, 17 Mar 2024 20:44:28 +0000 (22:44 +0200)]
lib: remove nb/yang memory cleanup when daemonizing

We're not calling any other termination functions to free allocated
memory when daemonizing except these two. There's no reason for such an
exception, and because of these calls we have the following libyang
warnings every time FRR is started:
```
MGMTD: libyang: String "15" not freed from the dictionary, refcount 2
MGMTD: libyang: String "200" not freed from the dictionary, refcount 2
MGMTD: libyang: String "mrib-then-urib" not freed from the dictionary, refcount 2
MGMTD: libyang: String "1000" not freed from the dictionary, refcount 2
MGMTD: libyang: String "10" not freed from the dictionary, refcount 2
MGMTD: libyang: String "5" not freed from the dictionary, refcount 2
```

Remove these calls to get rid of the unnecessary warnings.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit a564710c34bdae8a0f0630f50b5718f0757d8edc)

11 months agobgpd: fix dynamic peer graceful restart race condition 16025/head
Louis Scalbert [Thu, 16 May 2024 13:08:09 +0000 (15:08 +0200)]
bgpd: fix dynamic peer graceful restart race condition

bgp_llgr topotest sometimes fails at step 8:

> topo: STEP 8: 'Check if we can see 172.16.1.2/32 after R4 (dynamic peer) was killed'

R4 neighbor is deleted on R2 because it fails to re-connect:

> 14:33:40.128048 BGP: [HKWM3-ZC5QP] 192.168.3.1 fd -1 went from Established to Clearing
> 14:33:40.128154 BGP: [MJ1TJ-HEE3V] 192.168.3.1(r4) graceful restart timer expired
> 14:33:40.128158 BGP: [ZTA2J-YRKGY] 192.168.3.1(r4) graceful restart stalepath timer stopped
> 14:33:40.128162 BGP: [H917J-25EWN] 192.168.3.1(r4) Long-lived stale timer (IPv4 Unicast) started for 20 sec
> 14:33:40.128168 BGP: [H5X66-NXP9S] 192.168.3.1(r4) Long-lived set stale community (LLGR_STALE) for: 172.16.1.2/32
> 14:33:40.128220 BGP: [H5X66-NXP9S] 192.168.3.1(r4) Long-lived set stale community (LLGR_STALE) for: 192.168.3.0/24
> [...]
> 14:33:41.138869 BGP: [RGGAC-RJ6WG] 192.168.3.1 [Event] Connect failed 111(Connection refused)
> 14:33:41.138906 BGP: [ZWCSR-M7FG9] 192.168.3.1 [FSM] TCP_connection_open_failed (Connect->Active), fd 23
> 14:33:41.138912 BGP: [JA9RP-HSD1K] 192.168.3.1 (dynamic neighbor) deleted (bgp_connect_fail)
> 14:33:41.139126 BGP: [P98A2-2RDFE] 192.168.3.1(r4) graceful restart stalepath timer stopped

af8496af08 ("bgpd: Do not delete BGP dynamic peers if graceful restart
kicks in") forgot to modify bgp_connect_fail()

Do not delete the peer in bgp_connect_fail() if Non-Stop-Forwarding is
in progress.

Fixes: af8496af08 ("bgpd: Do not delete BGP dynamic peers if graceful restart kicks in")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit e446308d76b4ac8f26149db982bf5ed5ac93d5f5)

11 months agoMerge pull request #15998 from FRRouting/mergify/bp/stable/10.0/pr-15655
Donatas Abraitis [Mon, 13 May 2024 12:04:34 +0000 (15:04 +0300)]
Merge pull request #15998 from FRRouting/mergify/bp/stable/10.0/pr-15655

isisd: fix ip/ipv6 reachability tlvs (backport #15655)

11 months agoisisd: fix ip/ipv6 reachability tlvs 15998/head
Igor Ryzhov [Mon, 1 Apr 2024 21:56:17 +0000 (00:56 +0300)]
isisd: fix ip/ipv6 reachability tlvs

Don't allocate subtlvs container if there's nothing to add to it. If the
container is allocated, the "sub-TLVs presence" bit is set in the TLVs
even if there's no actual sub-TLVs, what violates the RFC.

Fixes #14514.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit c3d34b84f3e1b789b78b6ee93068f074eb884af1)

11 months agoMerge pull request #15985 from FRRouting/mergify/bp/stable/10.0/pr-15975
Donald Sharp [Thu, 9 May 2024 17:37:36 +0000 (13:37 -0400)]
Merge pull request #15985 from FRRouting/mergify/bp/stable/10.0/pr-15975

pimd: fixes split off from #15969 (backport #15975)

11 months agoMerge pull request #15978 from FRRouting/mergify/bp/stable/10.0/pr-15965
Donald Sharp [Thu, 9 May 2024 17:04:33 +0000 (13:04 -0400)]
Merge pull request #15978 from FRRouting/mergify/bp/stable/10.0/pr-15965

bgpd: Fix SRv6 memory leaks spotted by Address Sanitizer (backport #15965)

11 months agopimd: fix order of operations for evaluating join 15985/head
David Lamparter [Mon, 12 Dec 2022 16:50:59 +0000 (17:50 +0100)]
pimd: fix order of operations for evaluating join

join_desired looks at whether up->channel_oil is empty.  up->channel_oil
is updated from pim_forward_stop(), calling pim_channel_del_oif().  But
that was being called *after* updating join_desired, so join_desired saw
a non-empty OIL.  Pull up the pim_forward_stop() call to before updating
join_desired.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit fdb1a6fed5a8e42447b5b9633ad9df0f3042d0a9)

11 months agopimd: fix null register before aging out reg-stop
David Lamparter [Mon, 17 Apr 2023 09:47:08 +0000 (11:47 +0200)]
pimd: fix null register before aging out reg-stop

It looks like the code was trying to do this with the null_register
parameter on pim_upstream_start_register_stop_timer(), but that didn't
quite work right.  Restructure a bit to get it right.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit dce38da8061a7ac62c690dbb8a89cae7f9a758d6)

11 months agopimd: fix dr-priority range
David Lamparter [Fri, 14 Apr 2023 15:17:27 +0000 (17:17 +0200)]
pimd: fix dr-priority range

0 is a valid DR priority.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b564c1d890aef75067db22df09e608faf72b99f5)

11 months agobgpd: Move SRv6 cleanup functions 15978/head
Carmine Scarpitta [Wed, 8 May 2024 07:48:55 +0000 (09:48 +0200)]
bgpd: Move SRv6 cleanup functions

Move SRv6 cleanup operations to `bgp_srv6_cleanup` function.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 165caaeea8b04b6ac59c9016f1d5240238200a27)

11 months agobgpd: Fix SRv6 memory leaks spotted by ASAN
Carmine Scarpitta [Wed, 8 May 2024 07:45:56 +0000 (09:45 +0200)]
bgpd: Fix SRv6 memory leaks spotted by ASAN

Fix a couple of memory leaks spotted by Address Sanitizer:

```

=================================================================
==970960==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 592 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xfeb98ae76138 in srv6_locator_chunk_alloc lib/srv6.c:138
    #3 0xb7f3c8508fa0 in ensure_vrf_tovpn_sid_per_vrf bgpd/bgp_mplsvpn.c:831
    #4 0xb7f3c8509494 in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:866
    #5 0xb7f3c85028a8 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:289
    #6 0xb7f3c851a7c0 in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3769
    #7 0xb7f3c86f6ef0 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3378
    #8 0xfeb98afa6e14 in zclient_read lib/zclient.c:4608
    #9 0xfeb98af3d684 in event_call lib/event.c:2011
    #10 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #11 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #12 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #13 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #14 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xb7f3c8508fd8 in ensure_vrf_tovpn_sid_per_vrf bgpd/bgp_mplsvpn.c:832
    #3 0xb7f3c8509494 in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:866
    #4 0xb7f3c85028a8 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:289
    #5 0xb7f3c851a7c0 in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3769
    #6 0xb7f3c86f6ef0 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3378
    #7 0xfeb98afa6e14 in zclient_read lib/zclient.c:4608
    #8 0xfeb98af3d684 in event_call lib/event.c:2011
    #9 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #10 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #11 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #12 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #13 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0xfeb98b28a4b4 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0xfeb98ae572f8 in qcalloc lib/memory.c:105
    #2 0xb7f3c8506520 in vpn_leak_zebra_vrf_sid_update_per_vrf bgpd/bgp_mplsvpn.c:439
    #3 0xb7f3c85068d8 in vpn_leak_zebra_vrf_sid_update bgpd/bgp_mplsvpn.c:459
    #4 0xb7f3c86f6aec in bgp_ifp_create bgpd/bgp_zebra.c:3345
    #5 0xfeb98adfd3f8 in hook_call_if_real lib/if.c:48
    #6 0xfeb98adfe750 in if_new_via_zapi lib/if.c:181
    #7 0xfeb98af98084 in zclient_interface_add lib/zclient.c:2592
    #8 0xfeb98afa6d24 in zclient_read lib/zclient.c:4606
    #9 0xfeb98af3d684 in event_call lib/event.c:2011
    #10 0xfeb98ae2788c in frr_run lib/libfrr.c:1217
    #11 0xb7f3c83cbf0c in main bgpd/bgp_main.c:545
    #12 0xfeb98a8973f8 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    #13 0xfeb98a8974c8 in __libc_start_main_impl ../csu/libc-start.c:392
    #14 0xb7f3c83c832c in _start (/usr/lib/frr/bgpd+0x2d832c)

SUMMARY: AddressSanitizer: 656 byte(s) leaked in 6 allocation(s).

```

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit 65e01119be288922deeca09f53a410ecfee1e6c2)

11 months agoMerge pull request #15970 from FRRouting/mergify/bp/stable/10.0/pr-15920
Donald Sharp [Thu, 9 May 2024 11:10:36 +0000 (07:10 -0400)]
Merge pull request #15970 from FRRouting/mergify/bp/stable/10.0/pr-15920

zebra: fix EVPN svd based remote nh neigh del (backport #15920)

11 months agozebra: fix EVPN svd based remote nh neigh del 15970/head
Chirag Shah [Fri, 3 May 2024 03:58:50 +0000 (20:58 -0700)]
zebra: fix EVPN svd based remote nh neigh del

In the context of SVD (Single VxLAN Device) for L3VNI,
the remote VTEP's nexthop is programmed neighbor entry against
SVD along with neighbor entry against SVI.

However, when L3VNI is removed or the VRF is disabled, all SVI
based remote nexthop neighbors are uninstalled and deleted.
The SVD based neigh entries remains in Zebra and the Kernel.
Subsequently, when reconfiguring L3VNI and relearning the same nexthop,
the neighbor entry is not programmed is because it is not removed
from Zebra SVD neighbor hash table, leading to the failure to
reprogram the entry.

With this fix, the SVD nexthop neigh entry is uninstalled
and deleted from Zebra and Kernel.

Ticket: #3729045

Testing:

borderleaf:# ip neigh show 2.2.2.2
2.2.2.2 dev vlan2560_l3 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra
2.2.2.2 dev vxlan99 lladdr 00:01:00:00:1d:09 extern_learn NOARP proto zebra

With the fix:

Zebra log shows both enties SVD (vxlan99) and SVI (vlan2560_l3)
neighbor entries are deleted.

2024/05/03 18:41:33.527125 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vxlan99(16) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0
2024/05/03 18:41:33.527128 ZEBRA: [NH6N7-54CD1] Tx RTM_DELNEIGH family
ipv4 IF vlan2560_l3(18) Neigh 2.2.2.2 MAC  null flags 0x10 state 0x0
ext_flags 0x0

borderleaf:# ip neigh show 2.2.2.2
borderleaf:#

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit fde6dd7bb9161cf58fdd8ca066cce77bad159c9d)

11 months agoMerge pull request #15956 from FRRouting/mergify/bp/stable/10.0/pr-15895
Donald Sharp [Wed, 8 May 2024 13:57:28 +0000 (09:57 -0400)]
Merge pull request #15956 from FRRouting/mergify/bp/stable/10.0/pr-15895

bgpd: Ignore validating the attribute flags if path-attribute is configured (backport #15895)

11 months agoMerge pull request #15958 from FRRouting/mergify/bp/stable/10.0/pr-15913
Donald Sharp [Wed, 8 May 2024 13:56:49 +0000 (09:56 -0400)]
Merge pull request #15958 from FRRouting/mergify/bp/stable/10.0/pr-15913

bgpd: Fix `no set as-path prepend ASNUM...` (backport #15913)

11 months agoMerge pull request #15952 from FRRouting/mergify/bp/stable/10.0/pr-15846
Donatas Abraitis [Wed, 8 May 2024 11:47:26 +0000 (14:47 +0300)]
Merge pull request #15952 from FRRouting/mergify/bp/stable/10.0/pr-15846

ospfd: fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer (backport #15846)

11 months agoMerge pull request #15951 from FRRouting/mergify/bp/stable/10.0/pr-15883
Donatas Abraitis [Wed, 8 May 2024 03:56:24 +0000 (06:56 +0300)]
Merge pull request #15951 from FRRouting/mergify/bp/stable/10.0/pr-15883

bgpd: Apply NOOP when doing negative commands for GR operations (backport #15883)

11 months agobgpd: Allow using optional table id for negative `no set table X` command 15958/head
Donatas Abraitis [Fri, 3 May 2024 05:58:21 +0000 (08:58 +0300)]
bgpd: Allow using optional table id for negative `no set table X` command

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

11 months agobgpd: Fix `no set as-path prepend ASNUM...`
Donatas Abraitis [Thu, 2 May 2024 20:07:19 +0000 (23:07 +0300)]
bgpd: Fix `no set as-path prepend ASNUM...`

If entering `no set as-path prepend 1 2 3`, it's warned as unknown command.

Now fixed, and the following combinations work fine:

```
no set as-path prepend
no set as-path prepend last-as
no set as-path prepend last-as 1
no set as-path prepend 1
no set as-path prepend 1 2
```

Fixes: https://github.com/FRRouting/frr/issues/15912
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e069a1c8d52bb6e7808303df488d7ce912e4f652)

11 months agotests: Check if iBGP session can drop invalid AIGP attribute 15956/head
Donatas Abraitis [Wed, 1 May 2024 13:33:52 +0000 (16:33 +0300)]
tests: Check if iBGP session can drop invalid AIGP attribute

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

11 months agobgpd: Ignore validating the attribute flags if path-attribute is configured
Donatas Abraitis [Wed, 1 May 2024 13:01:38 +0000 (16:01 +0300)]
bgpd: Ignore validating the attribute flags if path-attribute is configured

E.g. Cisco sends AIGP attribute as transitive, but it's wrong. Hence, the session
is teared down, because of this bgp_attr_flag_invalid() test.

Relax this check if we have `neighbor X path-attribute <discard|treat-as-withdraw>`
configured.

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

11 months agoMerge pull request #15870 from opensourcerouting/fix/1ce626aea6f1f274da92478a8e487c22...
Russ White [Tue, 7 May 2024 14:42:11 +0000 (10:42 -0400)]
Merge pull request #15870 from opensourcerouting/fix/1ce626aea6f1f274da92478a8e487c229b08f9ce_10.0

vtysh: Show `ip ospf network ...` even if it's not the same as the interface type

11 months agoospfd:fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset... 15952/head
Bing Shui [Thu, 25 Apr 2024 16:02:26 +0000 (16:02 +0000)]
ospfd:fix the bug where ip_ospf_dead-interval_minimal_hello-multiplier did not reset hello timer

Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
(cherry picked from commit d733fe2c048cd75948d9f30ced77ed828e92ee18)

11 months agobgpd: Apply NOOP when doing negative commands for GR operations 15951/head
Donatas Abraitis [Tue, 30 Apr 2024 10:40:08 +0000 (13:40 +0300)]
bgpd: Apply NOOP when doing negative commands for GR operations

E.g.:

```
% The Graceful Restart command used is not valid at this moment.
zsh: exit 1     vtysh -c configure -c 'router bgp' -c 'no neighbor 127.0.0.1 graceful-restart
1
```

This does not make sense frr-reload to fail.

Instead, just ignore such requests if they are just NOOP.

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

11 months agobgpd: Print old/new states of graceful restart FSM
Donatas Abraitis [Tue, 30 Apr 2024 10:38:54 +0000 (13:38 +0300)]
bgpd: Print old/new states of graceful restart FSM

To better debug what's going on before/after.

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

11 months agoMerge pull request #15935 from FRRouting/mergify/bp/stable/10.0/pr-15921
Donald Sharp [Mon, 6 May 2024 14:24:02 +0000 (10:24 -0400)]
Merge pull request #15935 from FRRouting/mergify/bp/stable/10.0/pr-15921

bgpd: Fix crash when deleting the SRv6 locator (backport #15921)

11 months agobgpd: Fix the order of NULL check and ZAPI decode 15935/head
Carmine Scarpitta [Sun, 5 May 2024 05:25:57 +0000 (07:25 +0200)]
bgpd: Fix the order of NULL check and ZAPI decode

When BGP receives an SRV6_LOCATOR_ADD message from zebra, it calls the
`bgp_zebra_process_srv6_locator_add()` function to process the message.
`bgp_zebra_process_srv6_locator_add()` decodes the message first, and
then if the pointer to the default BGP instance is NULL (i.e. the
default BGP instance is not configured yet), it returns early without
doing anything and without using the decoded message information.

This commit fixes the order of the operations executed by
`bgp_zebra_process_srv6_locator_add()`. We first ensure that the default
BGP instance is ready and we return early if it is not. Then, we decode
the message and do something with the information contained in it.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit bdc2c7bc5473b5582419702211c22e5d29bf0631)

11 months agobgpd: Fix crash when deleting the SRv6 locator
Carmine Scarpitta [Fri, 3 May 2024 21:35:05 +0000 (23:35 +0200)]
bgpd: Fix crash when deleting the SRv6 locator

When BGP receives a `SRV6_LOCATOR_DEL` from zebra, it invokes
`bgp_zebra_process_srv6_locator_delete` to process the message.

`bgp_zebra_process_srv6_locator_delete` obtains a pointer to the default
BGP instance and then dereferences this pointer.

If the default BGP instance is not ready / not configured yet, this
pointer this pointer is `NULL` and dereferencing it causes BGP to crash.

This commit fix the issue by adding a a check to verify if the pointer
is `NULL` and returning early if it is.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
(cherry picked from commit ae3241b96d7be08d627f142030a41031492ffaf5)

11 months agoMerge pull request #15906 from FRRouting/mergify/bp/stable/10.0/pr-15840
Donatas Abraitis [Sun, 5 May 2024 06:15:44 +0000 (09:15 +0300)]
Merge pull request #15906 from FRRouting/mergify/bp/stable/10.0/pr-15840

ospf6d: fix interface type vs. connected routes updates (backport #15840)

11 months agoospf6d: accept CLI `no` for point-to-multipoint 15906/head
David Lamparter [Thu, 25 Apr 2024 10:20:27 +0000 (12:20 +0200)]
ospf6d: accept CLI `no` for point-to-multipoint

`point-to-multipoint` was missing on the removal variant of this CLI
command.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 52734fc8e5dad3569c3c37251f6dcc7a83c07299)

11 months agoospf6d: force recalculate on interface_up
David Lamparter [Thu, 25 Apr 2024 10:18:08 +0000 (12:18 +0200)]
ospf6d: force recalculate on interface_up

interface_up also handles changes to the interface type, i.e. broadcast
to ptp to ptmp.  Connected routes for these are different and must be
readvertised, which is done in ospf6_interface_recalculate_cost() - but
only if the cost changed.  Use the force variant here.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit d7f54c4d5692c85d0f6a5bb384b156f252b92e20)

11 months agoospf6d: fix loopback/ptp/ptmp conn. route checks
David Lamparter [Thu, 25 Apr 2024 10:16:35 +0000 (12:16 +0200)]
ospf6d: fix loopback/ptp/ptmp conn. route checks

The code emitting connected routes was checking against the interface
state (which can also be lo/ptp/ptmp) rather than the interface type.
This was causing wrong IA prefixes for connected routes getting put up
out if the interface was down intermittently.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 4aa200c7c55c84033a804d7c37847790c936e256)

11 months agoospf6d: fix DEFUN formatting wrecked by clang
David Lamparter [Thu, 25 Apr 2024 09:45:19 +0000 (11:45 +0200)]
ospf6d: fix DEFUN formatting wrecked by clang

clang-format doesn't understand `DEFUN` and formats it rather ugly.
Standard approach was to skip these in clang-format, which hasn't
happened here sadly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit b47657600b4f6975aaaadf860b233d432d325d38)

11 months agoMerge pull request #15916 from FRRouting/mergify/bp/stable/10.0/pr-15837
Donald Sharp [Sat, 4 May 2024 13:41:42 +0000 (09:41 -0400)]
Merge pull request #15916 from FRRouting/mergify/bp/stable/10.0/pr-15837

fix use of deprecated c-ares api (backport #15837)

11 months agolib: replace deprecated ares_gethostbyname 15916/head
Andrew Cooks [Thu, 25 Apr 2024 07:18:39 +0000 (17:18 +1000)]
lib: replace deprecated ares_gethostbyname

c-ares has deprecated ares_gethostbyname() in version 1.28.0
Replace it with ares_getaddrinfo().

This fixes a build error on Fedora 40.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
(cherry picked from commit 89a2e4d8257a91d115fa29e02261c33312da5cba)

11 months agolib: replace deprecated ares_process()
Andrew Cooks [Wed, 24 Apr 2024 05:01:28 +0000 (15:01 +1000)]
lib: replace deprecated ares_process()

ares_process(...) has been deprecated.
Replace it with ares_process_fd(...)

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
(cherry picked from commit 4540fa0a3e702f577d378b3fa1f5f26591a0a5ad)

11 months agoMerge pull request #15886 from FRRouting/mergify/bp/stable/10.0/pr-15851
Donatas Abraitis [Wed, 1 May 2024 09:12:28 +0000 (12:12 +0300)]
Merge pull request #15886 from FRRouting/mergify/bp/stable/10.0/pr-15851

tools: Handle seq num for BGP as-path in frr-reload.py (backport #15851)

11 months agotools: Handle seq num for BGP as-path in frr-reload.py 15886/head
Chirag Shah [Fri, 26 Apr 2024 01:52:31 +0000 (18:52 -0700)]
tools: Handle seq num for BGP as-path in frr-reload.py

If frr.conf has bgp as-path access-list clause without sequence number
then upon performing frr-rleoad, the running config clause with sequence
number will always be deleted and the new ones without sequence will
be re-added.
This could lead to blackholing until the config gets reapplied.

Testing:

frr.conf:
bgp as-path access-list important_internet_bgp_as_numbers permit _16509_

Running config:
bgp as-path access-list important_internet_bgp_as_numbers seq 5 permit
_16509_
!

Before fix
Upon frr-reload it deletes and readd line as without seq

2024-04-26 03:16:45,772  INFO: Executed "no bgp as-path access-list
important_internet_bgp_as_numbers seq 5 permit _16509_"

'bgp as-path access-list important_internet_bgp_as_numbers permit
_16509_\n'

After fix:
no form is not executed and no delta determine between frr.conf
and running-config.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 439c6f70b5bf7c8d92719458a37c9cce70b241c9)

12 months agovtysh: Show `ip ospf network ...` even if it's not the same as the interface type 15870/head
Donatas Abraitis [Tue, 23 Apr 2024 14:13:46 +0000 (17:13 +0300)]
vtysh: Show `ip ospf network ...` even if it's not the same as the interface type

ospfv3 shows this unconditionally, and ospfv2 does not show `ip ospf network ...` if the type of the interface matches the specified network.

Fixes: https://github.com/FRRouting/frr/issues/15817
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15856 from FRRouting/mergify/bp/stable/10.0/pr-15848
Donatas Abraitis [Sat, 27 Apr 2024 18:15:29 +0000 (21:15 +0300)]
Merge pull request #15856 from FRRouting/mergify/bp/stable/10.0/pr-15848

pimd: fix crash unconfiguring rp keepalive timer (backport #15848)

12 months agopimd: fix crash unconfiguring rp keepalive timer 15856/head
Vijayalaxmi Basavaraj [Mon, 22 Apr 2024 17:55:23 +0000 (10:55 -0700)]
pimd: fix crash unconfiguring rp keepalive timer

pimd crashs while unconfigure of rp ka timer as we are trying to access
a yand dnode(suppress timer) which does not exist at the moment.

User just configured rp keepalive timer and not suppress timer,
the yang dnode would not be present. Instead of directly accessing
yang_dnode_get_unit16, first check the yang node exist using
the xpath.

Ticket: #3874971

Testing:

Before:
------
tor-11(config)# no ip pim rp keep-alive-timer 3000
vtysh: error reading from pimd: Success (0)Warning: closing connection to pimd because of an I/O error!

Broadcast message from root@tor-11 (somewhere) (Mon Apr 22 17:29:12 2024):

cumulus-core: Running cl-support for core files "pimd.25467.1713806952.core"

After:
-----
tor-11(config)# no ip pim rp keep-alive-timer 3000
tor-11(config)#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Vijayalaxmi Basavaraj <vbasavaraj@nvidia.com>
(cherry picked from commit 0c4b7c1f1f359c1d7647fea34f62378af8b640a5)

12 months agoMerge pull request #15830 from FRRouting/mergify/bp/stable/10.0/pr-15819
Donatas Abraitis [Thu, 25 Apr 2024 05:01:04 +0000 (08:01 +0300)]
Merge pull request #15830 from FRRouting/mergify/bp/stable/10.0/pr-15819

bgpd, ospfd: fix non increasing SNMP OID (backport #15819)

12 months agoMerge pull request #15832 from FRRouting/mergify/bp/stable/10.0/pr-15766
Donatas Abraitis [Thu, 25 Apr 2024 05:00:46 +0000 (08:00 +0300)]
Merge pull request #15832 from FRRouting/mergify/bp/stable/10.0/pr-15766

bgpd: fix show run of network route-distinguisher (backport #15766)

12 months agoMerge pull request #15828 from opensourcerouting/fix/backport_inherit_flags
Donald Sharp [Wed, 24 Apr 2024 14:15:43 +0000 (10:15 -0400)]
Merge pull request #15828 from opensourcerouting/fix/backport_inherit_flags

bgpd: Inherit some peer flags from the peer-group

12 months agobgpd: fix show run of network route-distinguisher 15832/head
Louis Scalbert [Tue, 16 Apr 2024 14:41:51 +0000 (16:41 +0200)]
bgpd: fix show run of network route-distinguisher

Route-distinguisher (RD) is not printed properly in show run:

>  address-family ipv6 vpn
>   network ff01::/64 rd (null) label 7
>   network ff01::/64 rd (null) label 8

ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") merged
bgp_static_set_safi into bgp_static_set but inadvertently omitted the
handling of prd_pretty.

Copy the pretty RD string if available.

> address-family ipv6 vpn
>  network ff01::/64 rd 75:5 label 7
>  network ff01::/64 rd 85:5 label 8

Fixes: ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 3d3a138f5a177a2ef5996c17c76c4f7778f9c3aa)

12 months agoRevert "bgpd: fix pointer arithmetic in bgp snmp module" 15830/head
Louis Scalbert [Tue, 23 Apr 2024 09:39:29 +0000 (11:39 +0200)]
Revert "bgpd: fix pointer arithmetic in bgp snmp module"

This reverts commit d9bd9ebbf1c3ab902133e7f47c4b8c073e2df3d4.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit c1124a44c34f5fdce5fd06a6441ea78f8b5f352b)

12 months agoRevert "ospfd: fix some dicey pointer arith in snmp module"
Louis Scalbert [Tue, 23 Apr 2024 09:36:14 +0000 (11:36 +0200)]
Revert "ospfd: fix some dicey pointer arith in snmp module"

This reverts commit 438ef98701e9922e81a451f87ad053268a1a557e.

The previous code was correct even if the coverity scanner was
complaining.

Fixes: https://github.com/FRRouting/frr/issues/15680
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit c7895ba3202db2d99a3d9b688dc15424b8df35bd)

12 months agobgpd: Inherit `capability software-version` flag from the peer-group 15828/head
Donatas Abraitis [Sun, 21 Apr 2024 11:18:39 +0000 (14:18 +0300)]
bgpd: Inherit `capability software-version` flag from the peer-group

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agobgpd: Inherit `enforce-first-as` flag from the peer-group
Donatas Abraitis [Sun, 21 Apr 2024 11:16:49 +0000 (14:16 +0300)]
bgpd: Inherit `enforce-first-as` flag from the peer-group

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15820 from FRRouting/mergify/bp/stable/10.0/pr-15815
Donald Sharp [Tue, 23 Apr 2024 16:53:22 +0000 (12:53 -0400)]
Merge pull request #15820 from FRRouting/mergify/bp/stable/10.0/pr-15815

lib, zebra: Check for not being a blackhole route (backport #15815)