]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
6 months agobgpd: Actually make ` --v6-with-v4-nexthops` it work 16980/head
Donatas Abraitis [Wed, 2 Oct 2024 10:57:30 +0000 (13:57 +0300)]
bgpd: Actually make ` --v6-with-v4-nexthops` it work

It was using `-v` which is actually a _version_.

Fixes: 0435b31bb8ed55377f83d0e19bc085abc3c71b44 ("bgpd: Allow bgp to specify if it will allow v6 routing with v4 nexthops")
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0495cac837ad0f6ff1082746c37e4a48c1068035)

6 months agoMerge pull request #16973 from FRRouting/mergify/bp/stable/10.1/pr-16968
Donald Sharp [Wed, 2 Oct 2024 15:07:23 +0000 (11:07 -0400)]
Merge pull request #16973 from FRRouting/mergify/bp/stable/10.1/pr-16968

bfdd: add no variants to interval configurations (backport #16968)

6 months agobfdd: add no variants to interval configurations 16973/head
Rafael Zalamena [Tue, 1 Oct 2024 21:58:24 +0000 (18:58 -0300)]
bfdd: add no variants to interval configurations

Add missing no commands to various interval configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit b70835d690d98f1549202d89d9bab34297ba5bd0)

6 months agoMerge pull request #16964 from FRRouting/mergify/bp/stable/10.1/pr-16738
Donatas Abraitis [Tue, 1 Oct 2024 12:18:02 +0000 (15:18 +0300)]
Merge pull request #16964 from FRRouting/mergify/bp/stable/10.1/pr-16738

lib: Attach stdout to child only if --log=stdout and stdout FD is a tty (backport #16738)

6 months agolib: Attach stdout to child only if --log=stdout and stdout FD is a tty 16964/head
Vladislav Odintsov [Wed, 4 Sep 2024 11:18:35 +0000 (14:18 +0300)]
lib: Attach stdout to child only if --log=stdout and stdout FD is a tty

Prior to this commit stdout of a process started in a daemon mode was
attached to a calling process.
As a result a calling process hung for infinity.

Signed-off-by: Vladislav Odintsov <vlodintsov@k2.cloud>
(cherry picked from commit 0e3c5e8e5907321b35201f0985c1d3f4a1b0e639)

7 months agoMerge pull request #16936 from FRRouting/mergify/bp/stable/10.1/pr-16579
Donald Sharp [Thu, 26 Sep 2024 19:56:19 +0000 (15:56 -0400)]
Merge pull request #16936 from FRRouting/mergify/bp/stable/10.1/pr-16579

bgpd: Avoid use-after-free when doing `no router bgp` with auto created instances (backport #16579)

7 months agobgpd: Avoid use-after-free when doing `no router bgp` with auto created instances 16936/head
Donatas Abraitis [Wed, 14 Aug 2024 07:16:01 +0000 (10:16 +0300)]
bgpd: Avoid use-after-free when doing `no router bgp` with auto created instances

```
==1145965==ERROR: AddressSanitizer: heap-use-after-free on address 0x6030007159c0 at pc 0x55ade8d962d1 bp 0x7ffec4ce74c0 sp 0x7ffec4ce74b0
READ of size 8 at 0x6030007159c0 thread T0
    0 0x55ade8d962d0 in no_router_bgp bgpd/bgp_vty.c:1701
    1 0x7efe5aed19ed in cmd_execute_command_real lib/command.c:1002
    2 0x7efe5aed1da3 in cmd_execute_command lib/command.c:1061
    3 0x7efe5aed2303 in cmd_execute lib/command.c:1227
    4 0x7efe5af6c023 in vty_command lib/vty.c:616
    5 0x7efe5af6d2d2 in vty_execute lib/vty.c:1379
    6 0x7efe5af77df2 in vtysh_read lib/vty.c:2374
    7 0x7efe5af64c9b in event_call lib/event.c:1996
    8 0x7efe5af03887 in frr_run lib/libfrr.c:1232
    9 0x55ade8cd9850 in main bgpd/bgp_main.c:555
    10 0x7efe5aa29d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
    11 0x7efe5aa29e3f in __libc_start_main_impl ../csu/libc-start.c:392
    12 0x55ade8cdc314 in _start (/usr/lib/frr/bgpd+0x16f314)
```

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

7 months agoMerge pull request #16919 from FRRouting/mergify/bp/stable/10.1/pr-16918
Donald Sharp [Wed, 25 Sep 2024 22:06:28 +0000 (18:06 -0400)]
Merge pull request #16919 from FRRouting/mergify/bp/stable/10.1/pr-16918

zebra snmp fixes (backport #16918)

7 months agoMerge pull request #16925 from FRRouting/mergify/bp/stable/10.1/pr-16913
Donald Sharp [Wed, 25 Sep 2024 21:56:06 +0000 (17:56 -0400)]
Merge pull request #16925 from FRRouting/mergify/bp/stable/10.1/pr-16913

bgpd: EVPN fix per rd specific type-2 json output (backport #16913)

7 months agobgpd: EVPN fix per rd specific type-2 json output 16925/head
Sindhu Parvathi Gopinathan [Tue, 24 Sep 2024 17:55:09 +0000 (10:55 -0700)]
bgpd: EVPN fix per rd specific type-2 json output

Current Issue:

paths key is not there for
'show bgp l2vpn evpn route rd <rd-id> mac <mac> json' uses
evpn prefix as key for each path.
Replace the evpn prefix with "paths".
This aligned with overall EVPN RIB json output like
'show bgp l2vpn evpn route json'
'show bgp l2vpn evpn route rd <> type 2 json'

Fix:

paths key is added instead of prefix info.

Ticket:#4087461

Issue:4087461

Testing:

Before fix:

leaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "[2]:[0]:[48]:[00:02:00:00:00:12]":[ <=====  Prefix info instead of "paths" key
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Older Path"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":5,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1726803218,
          "string":"Fri Sep 20 03:33:38 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

After fix:

eaf22# show bgp l2vpn evpn route rd 6.0.0.17:2 mac 00:02:00:00:00:12 json
{
  "prefix":"[2]:[0]:[48]:[00:02:00:00:00:12]",
  "prefixLen":352,
  "rd":"6.0.0.17:2",
  "routeType":2,
  "ethTag":0,
  "macLen":48,
  "mac":"00:02:00:00:00:12",
  "advertisedTo":{
    "220.20.0.33":{
      "hostname":"spine21"
    },
    "220.21.0.33":{
      "hostname":"spine22"
    }
  },
  "paths":[
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "bestpath":{
          "bestpathFromAs":65202,
          "overall":true,
          "selectionReason":"Router ID"
        },
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine21",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.20.0.33",
          "routerId":"6.0.0.20",
          "hostname":"spine21",
          "type":"external"
        }
      }
    ],
    [
      {
        "vni":"101101",
        "aspath":{
          "string":"65202 65024",
          "segments":[
            {
              "type":"as-sequence",
              "list":[
                65202,
                65024
              ]
            }
          ],
          "length":2
        },
        "esi":"03:00:00:00:77:02:04:00:00:18",
        "es_info":{
          "localEs":true
        },
        "origin":"IGP",
        "valid":true,
        "version":3,
        "extendedCommunity":{
          "string":"RT:65024:101101 ET:8"
        },
        "lastUpdate":{
          "epoch":1727175046,
          "string":"Tue Sep 24 10:50:46 2024\n"
        },
        "nexthops":[
          {
            "ip":"6.0.0.17",
            "hostname":"spine22",
            "afi":"ipv4",
            "metric":0,
            "accessible":true,
            "used":true
          }
        ],
        "peer":{
          "peerId":"220.21.0.33",
          "routerId":"6.0.0.21",
          "hostname":"spine22",
          "type":"external"
        }
      }
    ]
  ],
  "numPaths":2
}

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
(cherry picked from commit ff008cee6b5b4945f6dd3e58b46b933d695c2865)

7 months agozebra: Add missing proto translations 16919/head
Donald Sharp [Wed, 25 Sep 2024 16:14:50 +0000 (12:14 -0400)]
zebra: Add missing proto translations

Add missing isis and eigrp proto translations.

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

7 months agozebra: Correctly report metrics
Donald Sharp [Wed, 25 Sep 2024 16:09:40 +0000 (12:09 -0400)]
zebra: Correctly report metrics

Report the routes metric in IPFORWARDMETRIC1 and return
-1 for the other metrics as required by the IP-FORWARD-MIB.

inetCidrRouteMetric2 OBJECT-TYPE
    SYNTAX     Integer32
    MAX-ACCESS read-create
    STATUS     current
    DESCRIPTION
           "An alternate routing metric for this route.  The
            semantics of this metric are determined by the routing-
            protocol specified in the route's inetCidrRouteProto
            value.  If this metric is not used, its value should be
            set to -1."
    DEFVAL { -1 }
    ::= { inetCidrRouteEntry 13 }

I've included metric2 but it's the same for all of them.

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

7 months agozebra: Let's use memset instead of walking bytes and setting to 0
Donald Sharp [Wed, 25 Sep 2024 16:08:03 +0000 (12:08 -0400)]
zebra: Let's use memset instead of walking bytes and setting to 0

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

7 months agozebra: Fix snmp walk of zebra rib
Donald Sharp [Wed, 25 Sep 2024 16:06:29 +0000 (12:06 -0400)]
zebra: Fix snmp walk of zebra rib

The snmp walk of the zebra rib was skipping entries
because in_addr_cmp was replaced with a prefix_cmp
which worked slightly differently causing parts
of the zebra rib tree to be skipped.

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

7 months agoMerge pull request #16893 from FRRouting/mergify/bp/stable/10.1/pr-16886
Russ White [Tue, 24 Sep 2024 16:33:27 +0000 (12:33 -0400)]
Merge pull request #16893 from FRRouting/mergify/bp/stable/10.1/pr-16886

ospfd: Interface 'ip ospf neighbor-filter' startup config not applied. (backport #16886)

7 months agoMerge pull request #16897 from FRRouting/mergify/bp/stable/10.1/pr-16630
Russ White [Tue, 24 Sep 2024 14:56:41 +0000 (10:56 -0400)]
Merge pull request #16897 from FRRouting/mergify/bp/stable/10.1/pr-16630

Babel metric (backport #16630)

7 months agobabeld: Do not remove route when replacing 16897/head
Donald Sharp [Thu, 22 Aug 2024 14:24:42 +0000 (10:24 -0400)]
babeld: Do not remove route when replacing

When sending down a babel route do not remove then
add it back.  Just send down the change.  This
change will not cause packets to be dropped now.

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

7 months agobabeld: Send the route's metric down to zebra.
Donald Sharp [Thu, 22 Aug 2024 14:22:58 +0000 (10:22 -0400)]
babeld: Send the route's metric down to zebra.

Babel was thinking it was talking to the kernel for
route installation instead of zebra.  Pass down the
metric instead.

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

7 months agoospfd: Interface 'ip ospf neighbor-filter' startup config not applied. 16893/head
Acee Lindem [Fri, 20 Sep 2024 20:33:43 +0000 (20:33 +0000)]
ospfd: Interface 'ip ospf neighbor-filter' startup config not applied.

When 'ip ospf neighbor-filter <filter-name>' is configured in the startup
configuration, it is in the running configuration but not applied on the
interface.

Signed-off-by: Acee Lindem <acee@lindem.com>
(cherry picked from commit 77de5eeb80e4c99e112ba934725bbb9df4b78240)

7 months agoMerge pull request #16862 from FRRouting/mergify/bp/stable/10.1/pr-16860
Jafar Al-Gharaibeh [Thu, 19 Sep 2024 13:49:56 +0000 (08:49 -0500)]
Merge pull request #16862 from FRRouting/mergify/bp/stable/10.1/pr-16860

ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV (backport #16860)

7 months agoospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV 16862/head
Acee Lindem [Wed, 18 Sep 2024 18:09:19 +0000 (18:09 +0000)]
ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLV

When parsing the SR-Algorithm TLV in the OSPF Router Information Opaque
LSA, assure that not more than the maximum number of supported
algorithms are copied from the TLV.

Signed-off-by: Acee Lindem <acee@lindem.com>
(cherry picked from commit 0dc969185fdd75fd007c9b29e11be57a078236df)

7 months agoMerge pull request #16842 from FRRouting/mergify/bp/stable/10.1/pr-16809
Donald Sharp [Tue, 17 Sep 2024 17:39:37 +0000 (13:39 -0400)]
Merge pull request #16842 from FRRouting/mergify/bp/stable/10.1/pr-16809

isisd: fix rcap tlv double-free crash (backport #16809)

7 months agotests: update isisd fuzz test 16842/head
Louis Scalbert [Mon, 16 Sep 2024 11:43:26 +0000 (13:43 +0200)]
tests: update isisd fuzz test

Since the previous commit, if a router capability subTLV is not
readable, the previously read subTLVs are kept.

Update of the ISIS fuzz test.

> $ wuschl rebuild tests/isisd/test_fuzz_isis_tlv
> $ gzip -9 tests/isisd/test_fuzz_isis_tlv_tests.h

> $ ./test_fuzz_isis_tlv 2>/dev/null | grep failed
> Test 139 failed, output differs.
> Test 150 failed, output differs.
> 2 of 405 tests failed.
>
> $ ./test_fuzz_isis_tlv 139 2>/dev/null
> Test 139 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Received output:
> Unpack log:
> Unpacking 564 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 193 and len 13.
>     Skipping unknown TLV 193 (13 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 0 and len 0.
>     Skipping unknown TLV 0 (0 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Router Capability: 253.212.128.242 , D:1, S:1
>
> $ ./test_fuzz_isis_tlv 150 2>/dev/null
> Test 150 failed, output differs.
> Expected output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Received output:
> Unpack log:
> Unpacking 403 bytes of TLVs...
>   Unpacking TLV...
>     Found TLV of type 129 and len 13.
>     Unpacking Protocols Supported TLV...
>       Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
>   Unpacking TLV...
>     Found TLV of type 11 and len 11.
>     Skipping unknown TLV 11 (11 bytes)
>   Unpacking TLV...
>     Found TLV of type 242 and len 12.
>     Unpacking Router Capability TLV...
>     WARNING: Router Capability subTLV length too large compared to expected size
> Unpacked TLVs:
> Protocols Supported: 73, 16, 255, 255, 255, 101, 10, 11, 11, 11, 11, 11, 11
> Router Capability: 253.212.128.242 , D:1, S:1

Link: https://pypi.org/project/wuschl/
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit cfd050a0e5a636efae93865d982714da9dbf06a6)

7 months agoisisd: fix rcap tlv double-free crash
Louis Scalbert [Thu, 12 Sep 2024 07:31:49 +0000 (09:31 +0200)]
isisd: fix rcap tlv double-free crash

A double-free crash happens when a subTLV of the "Router Capability"
TLV is not readable and a previous "Router Capability" TLV was read.

rcap was supposed to be freed later by isis_free_tlvs() ->
free_tlv_router_cap(). In 78774bbcd5 ("isisd: add isis flex-algo lsp
advertisement"), this was not the case because rcap was not saved to
tlvs->router_cap when the function returned early because of a subTLV
length issue.

Always set tlvs->router_cap to free the memory.

Note that this patch has the consequence that in case of subTLV error,
the previously read "Router Capability" subTLVs are kept in memory.

Fixes: 49efc80d34 ("isisd: Ensure rcap is freed in error case")
Fixes: 78774bbcd5 ("isisd: add isis flex-algo lsp advertisement")
Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit d61758140d33972c10ecbb72d0a3e528049dd8d6)

7 months agoMerge pull request #16819 from FRRouting/mergify/bp/stable/10.1/pr-16808
Donald Sharp [Fri, 13 Sep 2024 23:53:47 +0000 (19:53 -0400)]
Merge pull request #16819 from FRRouting/mergify/bp/stable/10.1/pr-16808

nhrpd: fixes duplicate auth extension (backport #16808)

7 months agoMerge pull request #16824 from FRRouting/mergify/bp/stable/10.1/pr-16818
Donald Sharp [Fri, 13 Sep 2024 23:52:36 +0000 (19:52 -0400)]
Merge pull request #16824 from FRRouting/mergify/bp/stable/10.1/pr-16818

ospfd: missing '[no]ip ospf graceful-restart hello-delay <N>' commands (backport #16818)

7 months agoospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands 16824/head
Dmitrii Turlupov [Fri, 13 Sep 2024 13:22:18 +0000 (16:22 +0300)]
ospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands

Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
(cherry picked from commit 69e31a547f8520fd967cc34dc0cd3a8f915d07f8)

7 months agonhrpd: fixes duplicate auth extension 16819/head
Denys Haryachyy [Thu, 12 Sep 2024 07:28:28 +0000 (07:28 +0000)]
nhrpd: fixes duplicate auth extension

When an NHRP peer was forwarding a message, it was copying all
extensions from the originally received packet. The authentication
extension must be regenerated hop by hop per RFC2332.
This fix checks for the auth extension when copying extensions
and omits the original packet auth and instead regenerates a new auth extension.

Fix bug #16507

Signed-off-by: Denys Haryachyy <garyachy@gmail.com>
(cherry picked from commit 8e3c278bbcd0ced1d4058cc7a2c9aebdfbc8b651)

7 months agoMerge pull request #16806 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_10.1
Donald Sharp [Thu, 12 Sep 2024 12:22:11 +0000 (08:22 -0400)]
Merge pull request #16806 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_10.1

10.1 Backport docker ABUILD_APK_INDEX_OPTS

7 months agoFRR Release 10.1.1 rc/10.1.1 docker/10.1.1 frr-10.1.1
Donatas Abraitis [Thu, 12 Sep 2024 07:46:05 +0000 (10:46 +0300)]
FRR Release 10.1.1

- bgpd
-    Fix as-path exclude modify crash
-    Fix labels static-analyser
-    Fix, do not access peer->notify.data when it is null
-    Fix crash at no rpki
-    Fix memory type for static->prd_pretty
-    Revert "topotests: add an ebgp 6vpe test"
-    Revert "topotests: add bgp_nexthop_mp_ipv4_6 test"
-    Revert "bgpd: optimize bgp_interface_address_del"
-    Revert "bgpd: fix removing ipv6 global nexhop"
-    Revert "bgpd: fix "used" json key on link-local nexthop"
-    Revert "tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6"
-    Revert "bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop"
-    Revert "bgpd: prefer link-local to a ipv4-mapped ipv6 global"
-    Revert "topotests: update bgp_vrf_leaking_5549_routes"
-    Revert "bgpd: optimize bgp_interface_address_add"
-    Revert "bgpd: reduce bgp_interface_address_add indentation"
-    Revert "bgpd: log new ipv6 global in bgp_interface_address_add"
-    Revert "bgpd: fix sending ipv6 local nexthop if global present"
- isisd
-    Fix crash when reading asla
-    Add missing `exit` statement
-    Fix update link params after circuit is up
-    Fix crash at flex-algo without mpls-te
-    Fix memory handling in isis_adj_process_threeway()
- nhrpd
-    Fix show nhrp shortcut json
-    Fix sending /32 shortcut
- pimd
-    Fix crash in pimd
- mgmtd
-    Don't add implicit state data when reading config from file
- lib
-    Fix distribute-list deletion
-    Fix crash on distribute-list delete
-    Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x
- ripd
-    Fix show run output for distribute-list
- zebra
-    Ensure non-equal id's are not same nhg's
-    Mimic GNU basename() API for non-glibc library e.g. musl

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agodocker: Set ABUILD_APK_INDEX_OPTS for frr build 16806/head
Donatas Abraitis [Fri, 14 Jun 2024 13:33:32 +0000 (16:33 +0300)]
docker: Set ABUILD_APK_INDEX_OPTS for frr build

In build() stage of abuild, it does `apk index ...` where frr* packages
are unsigned. We don't sign them here, and thus we need to specify `--allow-untrusted`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agodocker: Set ABUILD_APK_INDEX_OPTS for libyang
Donatas Abraitis [Fri, 14 Jun 2024 08:37:23 +0000 (11:37 +0300)]
docker: Set ABUILD_APK_INDEX_OPTS for libyang

In build() stage of abuild, it does `apk index ...` where libyang* packages
are unsigned. We don't sign them here, and thus we need to specify `--allow-untrusted`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
7 months agoMerge pull request #16794 from opensourcerouting/fix/5e1b7f5a69505c76999e610d8773f5ab...
Donald Sharp [Wed, 11 Sep 2024 19:55:09 +0000 (15:55 -0400)]
Merge pull request #16794 from opensourcerouting/fix/5e1b7f5a69505c76999e610d8773f5abd63fe1a2_10.1

bgpd: fix as-path exclude modify crash

7 months agobgpd: fix as-path exclude modify crash 16794/head
Louis Scalbert [Tue, 10 Sep 2024 12:06:38 +0000 (14:06 +0200)]
bgpd: fix as-path exclude modify crash

Fix a crash when modifying a route-map with set as-path exclude without
as-path-access-list:

> router(config)# route-map routemaptest deny 1
> router(config-route-map)# set as-path exclude 33 34 35
> router(config-route-map)# set as-path exclude as-path-access-list test

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007fb3959327de in core_handler (signo=11, siginfo=0x7ffd122da530, context=0x7ffd122da400) at lib/sigevent.c:258
> #2  <signal handler called>
> #3  0x000055ab2762a1bd in as_list_list_del (h=0x55ab27897680 <as_exclude_list_orphan>, item=0x55ab28204e20) at ./bgpd/bgp_aspath.h:77
> #4  0x000055ab2762d1a8 in as_exclude_remove_orphan (ase=0x55ab28204e20) at bgpd/bgp_aspath.c:1574
> #5  0x000055ab27550538 in route_aspath_exclude_free (rule=0x55ab28204e20) at bgpd/bgp_routemap.c:2366
> #6  0x00007fb39591f00c in route_map_rule_delete (list=0x55ab28203498, rule=0x55ab28204170) at lib/routemap.c:1357
> #7  0x00007fb39591f87c in route_map_add_set (index=0x55ab28203460, set_name=0x55ab276ad2aa "as-path exclude", set_arg=0x55ab281e4f70 "as-path-access-list test") at lib/routemap.c:1674
> #8  0x00007fb39591d3f3 in generic_set_add (index=0x55ab28203460, command=0x55ab276ad2aa "as-path exclude", arg=0x55ab281e4f70 "as-path-access-list test", errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/routemap.c:533
> #9  0x000055ab2755e78e in lib_route_map_entry_set_action_rmap_set_action_exclude_as_path_modify (args=0x7ffd122db290) at bgpd/bgp_routemap_nb_config.c:2427
> #10 0x00007fb3958fe417 in nb_callback_modify (context=0x55ab28205aa0, nb_node=0x55ab27cb31e0, event=NB_EV_APPLY, dnode=0x55ab28202690, resource=0x55ab27c32148, errmsg=0x7ffd122db870 "",
>     errmsg_len=8192) at lib/northbound.c:1538
> #11 0x00007fb3958ff0ab in nb_callback_configuration (context=0x55ab28205aa0, event=NB_EV_APPLY, change=0x55ab27c32110, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:1888
> #12 0x00007fb3958ff5e4 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55ab28205aa0, errmsg=0x7ffd122db870 "", errmsg_len=8192) at lib/northbound.c:2016
> #13 0x00007fb3958fddba in nb_candidate_commit_apply (transaction=0x55ab28205aa0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1356
> #14 0x00007fb3958fdef0 in nb_candidate_commit (context=..., candidate=0x55ab27c2c9a0, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd122db870 "", errmsg_len=8192)
>     at lib/northbound.c:1389
> #15 0x00007fb3959045ba in nb_cli_classic_commit (vty=0x55ab281f6680) at lib/northbound_cli.c:57
> #16 0x00007fb395904b5a in nb_cli_apply_changes_internal (vty=0x55ab281f6680, xpath_base=0x7ffd122dfd10 "/frr-route-map:lib/route-map[name='routemaptest']/entry[sequence='1']",
>     clear_pending=false) at lib/northbound_cli.c:184
> #17 0x00007fb395904ebf in nb_cli_apply_changes (vty=0x55ab281f6680, xpath_base_fmt=0x0) at lib/northbound_cli.c:240
> --Type <RET> for more, q to quit, c to continue without paging--
> #18 0x000055ab27557d2e in set_aspath_exclude_access_list_magic (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80,
>     as_path_filter_name=0x55ab28202040 "test") at bgpd/bgp_routemap.c:6397
> #19 0x000055ab2754bdea in set_aspath_exclude_access_list (self=0x55ab2775c300 <set_aspath_exclude_access_list_cmd>, vty=0x55ab281f6680, argc=5, argv=0x55ab28204c80)
>     at ./bgpd/bgp_routemap_clippy.c:856
> #20 0x00007fb39589435d in cmd_execute_command_real (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, up_level=0) at lib/command.c:1003
> #21 0x00007fb3958944be in cmd_execute_command (vline=0x55ab281e61f0, vty=0x55ab281f6680, cmd=0x0, vtysh=0) at lib/command.c:1062
> #22 0x00007fb395894a0c in cmd_execute (vty=0x55ab281f6680, cmd=0x55ab28200f20 "set as-path exclude as-path-access-list test", matched=0x0, vtysh=0) at lib/command.c:1228
> #23 0x00007fb39595242c in vty_command (vty=0x55ab281f6680, buf=0x55ab28200f20 "set as-path exclude as-path-access-list test") at lib/vty.c:625
> #24 0x00007fb3959541c5 in vty_execute (vty=0x55ab281f6680) at lib/vty.c:1388
> #25 0x00007fb3959563db in vtysh_read (thread=0x7ffd122e2bb0) at lib/vty.c:2400
> #26 0x00007fb39594b785 in event_call (thread=0x7ffd122e2bb0) at lib/event.c:1996
> #27 0x00007fb3958d1365 in frr_run (master=0x55ab27b56d70) at lib/libfrr.c:1231
> #28 0x000055ab2747f1cc in main (argc=3, argv=0x7ffd122e2e08) at bgpd/bgp_main.c:555

Fixes: 094dcc3cda ("bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agoMerge pull request #16783 from FRRouting/mergify/bp/stable/10.1/pr-16718
Jafar Al-Gharaibeh [Wed, 11 Sep 2024 04:03:00 +0000 (00:03 -0400)]
Merge pull request #16783 from FRRouting/mergify/bp/stable/10.1/pr-16718

isisd: fix crash when reading asla (backport #16718)

7 months agoisisd: fix crash when reading asla 16783/head
Louis Scalbert [Mon, 2 Sep 2024 08:26:57 +0000 (10:26 +0200)]
isisd: fix crash when reading asla

isisd is crashing when reading a ASLA sub-TLV with Application
Identifier Bit Mask length greater than 1 octet.

Set a limit of 8 bytes in accordance with RFC9479 and check that the
received value does not exceed the limit.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Link: https://www.rfc-editor.org/rfc/rfc9479.html#name-application-identifier-bit-
Fixes: 5749ac83a8 ("isisd: add ASLA support")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit f1bc6c5d81e8cc0d31ee61abb295193f30db4f5a)

7 months agoMerge pull request #16776 from FRRouting/mergify/bp/stable/10.1/pr-16511
Donatas Abraitis [Tue, 10 Sep 2024 08:26:21 +0000 (11:26 +0300)]
Merge pull request #16776 from FRRouting/mergify/bp/stable/10.1/pr-16511

Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x (backport #16511)

7 months agolib: Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x 16776/head
Lu.Mao [Thu, 1 Aug 2024 01:54:14 +0000 (09:54 +0800)]
lib: Fix LYD_NEW_PATH_OUTPUT issue to support libyang v3.x

Fix the LYD_NEW_PATH_OUTPUT undeclared error to support the latest libyang v3.x version,
and also compatible with old version.

Signed-off-by: Lu Mao <lu.mao@molex.com>
(cherry picked from commit 87c9060f90b6b9b5a69ad1e6ba6e8ebc58d94374)

7 months agoMerge pull request #16739 from FRRouting/mergify/bp/stable/10.1/pr-16724
Donald Sharp [Wed, 4 Sep 2024 13:31:23 +0000 (09:31 -0400)]
Merge pull request #16739 from FRRouting/mergify/bp/stable/10.1/pr-16724

isisd: Add missing `exit` statement to `show running-config` output (backport #16724)

7 months agoisisd: Add missing `exit` statement 16739/head
Carmine Scarpitta [Mon, 2 Sep 2024 21:57:53 +0000 (23:57 +0200)]
isisd: Add missing `exit` statement

Add missing `exit` statement to `show running-config` output.

```
router isis ISIS_CORE
 is-type level-2-only
 net 49.0001.0000.0000.0004.00
 lsp-mtu 1300
 topology ipv6-unicast
 log-adjacency-changes
 segment-routing srv6
  locator ISIS_LOC
 exit   <<<<<<<<<<<<<<<<<<<<<<<<
exit
```

Fixes https://github.com/FRRouting/frr/issues/16694

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

7 months agoMerge pull request #16728 from FRRouting/mergify/bp/stable/10.1/pr-16667
Donald Sharp [Tue, 3 Sep 2024 20:22:13 +0000 (16:22 -0400)]
Merge pull request #16728 from FRRouting/mergify/bp/stable/10.1/pr-16667

isisd: fix update link params after circuit is up (backport #16667)

7 months agoisisd: fix update link params after circuit is up 16728/head
Louis Scalbert [Tue, 27 Aug 2024 16:22:27 +0000 (18:22 +0200)]
isisd: fix update link params after circuit is up

If the link-params are set when the circuit not yet up, the link-params
are never updated.

isis_link_params_update() is called from isis_circuit_up() but returns
immediately because circuit->state != C_STATE_UP. circuit->state is
updated in isis_csm_state_change after isis_circuit_up().

> struct isis_circuit *isis_csm_state_change(enum isis_circuit_event event,
>     struct isis_circuit *circuit,
>     void *arg)
> {
> [...]
>  if (isis_circuit_up(circuit) != ISIS_OK) {
>  isis_circuit_deconfigure(circuit, area);
>  break;
>  }
>  circuit->state = C_STATE_UP;
>  isis_event_circuit_state_change(circuit, circuit->area,
>  1);

Do not return isis_link_params_update() if circuit->state != C_STATE_UP.

Fixes: 0fdd8b2b11 ("isisd: update link params after circuit is up")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 6ce6b7a8564f661495fec17f3ea33eeaf9e2f48c)

7 months agoMerge pull request #16699 from louis-6wind/fix-nhrp-redundancy-10.1
Donatas Abraitis [Mon, 2 Sep 2024 11:17:16 +0000 (14:17 +0300)]
Merge pull request #16699 from louis-6wind/fix-nhrp-redundancy-10.1

nhrpd, test: fix nhrp_redundancy topotest (backport #16698)

7 months agoMerge pull request #16708 from FRRouting/mergify/bp/stable/10.1/pr-16673
Jafar Al-Gharaibeh [Sat, 31 Aug 2024 05:16:47 +0000 (01:16 -0400)]
Merge pull request #16708 from FRRouting/mergify/bp/stable/10.1/pr-16673

tests: Fix bgp_default_originate_topo1_3 (backport #16673)

7 months agoMerge pull request #16702 from FRRouting/mergify/bp/stable/10.1/pr-16687
Donald Sharp [Fri, 30 Aug 2024 23:36:50 +0000 (19:36 -0400)]
Merge pull request #16702 from FRRouting/mergify/bp/stable/10.1/pr-16687

tests: increase the timeout for packet padding check (backport #16687)

7 months agoMerge pull request #16706 from FRRouting/mergify/bp/stable/10.1/pr-16683
Donald Sharp [Fri, 30 Aug 2024 23:36:14 +0000 (19:36 -0400)]
Merge pull request #16706 from FRRouting/mergify/bp/stable/10.1/pr-16683

tests: ospf_netns_vrf should give more time for coming up (backport #16683)

7 months agoMerge pull request #16704 from FRRouting/mergify/bp/stable/10.1/pr-16682
Donald Sharp [Fri, 30 Aug 2024 23:35:40 +0000 (19:35 -0400)]
Merge pull request #16704 from FRRouting/mergify/bp/stable/10.1/pr-16682

tests: Ensure bgp suppress fib has a chance to transmit data to peer (backport #16682)

7 months agotests: Fix bgp_default_originate_topo1_3 16708/head
Donald Sharp [Tue, 27 Aug 2024 21:08:38 +0000 (17:08 -0400)]
tests: Fix bgp_default_originate_topo1_3

This test was killing bgp on r1 and r2
and then immediately testing that the
default route transitioned.  Unfortunately
the test was written that under load the
system might be in a bad state.  Let's
modify the code to check for a bgp version
change and then that the bgp state has
come back up

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

7 months agotests: ospf_netns_vrf should give more time for coming up 16706/head
Donald Sharp [Wed, 28 Aug 2024 19:10:04 +0000 (15:10 -0400)]
tests: ospf_netns_vrf should give more time for coming up

Test fails:

            test_func = partial(
                topotest.router_json_cmp,
                router,
                "show ip ospf vrf {0}-ospf-cust1 json".format(rname),
                expected,
            )
            _, diff = topotest.run_and_expect(test_func, None, count=10, wait=0.5)
            assertmsg = '"{}" JSON output mismatches'.format(rname)
>           assert diff is None, assertmsg
E           AssertionError: "r1" JSON output mismatches
E           assert Generated JSON diff error report:
E
E             > $->r1-ospf-cust1->areas->0.0.0.0->nbrFullAdjacentCounter: output has element with value '1' but in expected it has value '2'

/home/sharpd/frr2/tests/topotests/ospf_netns_vrf/test_ospf_netns_vrf.py:239: AssertionError

Support bundle has this data:
r1# show ip ospf vrf all neighbor
% 2024/08/28 14:55:54.763

VRF Name: r1-ospf-cust1

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
10.0.255.3        1 Full/DR         10.547s           39.456s 10.0.3.1        r1-eth1:10.0.3.2                     0     0     0
10.0.255.2        1 Full/Backup     0.543s            38.378s 10.0.3.3        r1-eth1:10.0.3.2                     1     0     0

So immediately after the test fails this test, the neighbor comes up.
Let's give the test a bit more time for failure to not happen

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

7 months agotests: Ensure bgp suppress fib has a chance to transmit data to peer 16704/head
Donald Sharp [Wed, 28 Aug 2024 19:05:40 +0000 (15:05 -0400)]
tests: Ensure bgp suppress fib has a chance to transmit data to peer

Giving only 5 seconds to pass bgp data to peers on a heavily
loaded system is a recipe for not having fun.  Add more time.

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

7 months agotests: increase the timeout for packet padding check 16702/head
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 16:40:50 +0000 (11:40 -0500)]
tests: increase the timeout for packet padding check

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
(cherry picked from commit 5752fc86ee878417584664a7e90eb2eb74c92fe9)

7 months agotests: use private addresses in nhrp_redundancy 16699/head
Louis Scalbert [Fri, 30 Aug 2024 12:52:49 +0000 (14:52 +0200)]
tests: use private addresses in nhrp_redundancy

Use private addresses in nhrp_redundancy.

> cd tests/topotests/nhrp_redundancy
> git grep 176.16  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|176.16|172.16|g' -i
> git grep 5.5.5.  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|5.5.5.|10.5.5.|g' -i
> git grep 4.4.4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|4.4.4.|10.4.4.|g' -i

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: check show ip nhrp shorcut in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:41:08 +0000 (14:41 +0200)]
tests: check show ip nhrp shorcut in nhrp_redundancy

Check show ip nhrp shorcut in nhrp_redundancy

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agonhrpd: fix show nhrp shortcut json
Louis Scalbert [Fri, 30 Aug 2024 12:35:58 +0000 (14:35 +0200)]
nhrpd: fix show nhrp shortcut json

Fix show nhrp shortcut json

Fixes: 87b9e98203 ("nhrpd: add json support to show nhrp vty commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix iptables command in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:22:45 +0000 (14:22 +0200)]
tests: fix iptables command in nhrp_redundancy

Replace --nflog-range argument by --nflog-range due to:

> 2024-08-30 10:44:54,816 INFO: topo: input: iptables -A FORWARD -i nhs3-gre0 -o nhs3-gre0 -m hashlimit --hashlimit-upto 4/minute --hashlimit-burst 1 --hashlimit-mode srcip,dstip --hashlimit-srcmask 24 --hashlimit-dstmask 24 --hashlimit-name loglimit-0 -j NFLOG --nflog-group 1 --nflog-range 128
> 2024-08-30 10:44:54,819 INFO: topo: output: warn: --nflog-range has never worked and is no longer supported, please use --nflog-size insted

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix nhs1 down check in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 12:12:27 +0000 (14:12 +0200)]
tests: fix nhs1 down check in nhrp_redundancy

Fully check the NHRP convergence after setting nhs1 down. Otherwise the
ping may pass because the previous shortcut is still present.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix nhc1 route check after nhs1 down
Louis Scalbert [Fri, 30 Aug 2024 12:08:51 +0000 (14:08 +0200)]
tests: fix nhc1 route check after nhs1 down

After setting down nhs1, the test is checking that nhc1 routing table
matches routes in nhc1/nhrp_route.json. It is incorrect because it
checks that the NHRP route to nhs1 is still present but it should have
disappeared.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: simplify nhrp_redundancy convergence
Louis Scalbert [Fri, 30 Aug 2024 12:14:17 +0000 (14:14 +0200)]
tests: simplify nhrp_redundancy convergence

Simplify nhrp_redundancy convergence code. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: rename router variables in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 09:23:42 +0000 (11:23 +0200)]
tests: rename router variables in nhrp_redundancy

Rename router variables in nhrp_redundancy to match the actual name.
Cosmetic change to help debugging.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: rename routers in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 09:16:44 +0000 (11:16 +0200)]
tests: rename routers in nhrp_redundancy

Rename routers in nhrp_redundancy to match the diagram. Cosmetic change.

> cd tests/topotests/nhrp_redundancy
> git grep r1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r1|nhs1|g' -i
> git grep r2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r2|nhs2|g' -i
> git grep r3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r3|nhs3|g' -i
> git grep r4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r4|nhc1|g' -i
> git grep r5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r5|nhc2|g' -i
> git grep r6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r6|router|g' -i
> git grep r7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|r7|host|g' -i
>
> git grep R1  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R1|nhs1|g' -i
> git grep R2  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R2|nhs2|g' -i
> git grep R3  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R3|nhs3|g' -i
> git grep R4  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R4|nhc1|g' -i
> git grep R5  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R5|nhc2|g' -i
> git grep R6  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R6|router|g' -i
> git grep R7  | cut -f1 -d: | uniq | xargs -L1 sed -e 's|R7|host|g' -i
>
> mv r1 nhs1
> mv r2 nhs2
> mv r3 nhs3
> mv r4 nhc1
> mv r5 nhc2
> mv r6 router
> mv r7 host

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
7 months agotests: fix prefix length in nhrp_redundancy
Louis Scalbert [Fri, 30 Aug 2024 11:54:36 +0000 (13:54 +0200)]
tests: fix prefix length in nhrp_redundancy

The expected prefix should be 5.5.5.0/24 otherwise the hosts behind NHRP
client 1 nhc1 (aka. r5) are not reachable via NHRP.

The issue was not seen in the FRR official CI because the tests were
skipped because iptables were missing in CI machines.

It solves the 16690 issue.

Fixes: https://github.com/FRRouting/frr/issues/16690
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agoMerge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1
Jafar Al-Gharaibeh [Thu, 29 Aug 2024 15:42:10 +0000 (11:42 -0400)]
Merge pull request #16587 from opensourcerouting/fix/revert_ipv4_mapped_ipv6_stuff_10.1

Revert IPv4 mapped IPv6 stuff for 10.1

8 months agoMerge pull request #16671 from opensourcerouting/fix/a152692f5ac207b5f55104b18ddc3146...
Jafar Al-Gharaibeh [Tue, 27 Aug 2024 21:49:55 +0000 (17:49 -0400)]
Merge pull request #16671 from opensourcerouting/fix/a152692f5ac207b5f55104b18ddc3146089db474_10.1

bgpd: fix labels static-analyser (backport #16655)

8 months agoMerge pull request #16669 from FRRouting/mergify/bp/stable/10.1/pr-16665
Jafar Al-Gharaibeh [Tue, 27 Aug 2024 21:49:40 +0000 (17:49 -0400)]
Merge pull request #16669 from FRRouting/mergify/bp/stable/10.1/pr-16665

isisd: fix crash at flex-algo without mpls-te (backport #16665)

8 months agobgpd: fix labels static-analyser 16671/head
Louis Scalbert [Mon, 26 Aug 2024 08:23:12 +0000 (10:23 +0200)]
bgpd: fix labels static-analyser

Fix static-analyser warnings with BGP labels:

> $ scan-build make -j12
> bgpd/bgp_updgrp_packet.c:819:10: warning: Access to field 'extra' results in a dereference of a null pointer (loaded from variable 'path') [core.NullDereference]
>                                                 ? &path->extra->labels->label[0]
>                                                    ^~~~~~~~~

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
8 months agoisisd: fix crash at flex-algo without mpls-te 16669/head
Louis Scalbert [Tue, 27 Aug 2024 13:45:38 +0000 (15:45 +0200)]
isisd: fix crash at flex-algo without mpls-te

Fix crash when flex-algo is configured and mpls-te is disabled.

> interface eth0
>  ip router isis 1
> !
> router isis 1
>  flex-algo 129
>   dataplane sr-mpls
>   advertise-definition

> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140486233631168) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140486233631168, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fc5802e9476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fc58076021f in core_handler (signo=11, siginfo=0x7ffd38d42470, context=0x7ffd38d42340) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> #7  0x000055c527fb29da in isis_instance_flex_algo_create (args=0x7ffd38d43120) at isisd/isis_nb_config.c:2875
> #8  0x00007fc58072655b in nb_callback_create (context=0x55c52ab1d2f0, nb_node=0x55c529f72950, event=NB_EV_APPLY, dnode=0x55c52ab06230, resource=0x55c52ab189f8, errmsg=0x7ffd38d43750 "",
>     errmsg_len=8192) at lib/northbound.c:1262
> #9  0x00007fc580727625 in nb_callback_configuration (context=0x55c52ab1d2f0, event=NB_EV_APPLY, change=0x55c52ab189c0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1662
> #10 0x00007fc580727c39 in nb_transaction_process (event=NB_EV_APPLY, transaction=0x55c52ab1d2f0, errmsg=0x7ffd38d43750 "", errmsg_len=8192) at lib/northbound.c:1794
> #11 0x00007fc580725f77 in nb_candidate_commit_apply (transaction=0x55c52ab1d2f0, save_transaction=true, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1131
> #12 0x00007fc5807260d1 in nb_candidate_commit (context=..., candidate=0x55c529f0a730, save_transaction=true, comment=0x0, transaction_id=0x0, errmsg=0x7ffd38d43750 "", errmsg_len=8192)
>     at lib/northbound.c:1164
> #13 0x00007fc58072d220 in nb_cli_classic_commit (vty=0x55c52a0fc6b0) at lib/northbound_cli.c:51
> #14 0x00007fc58072d839 in nb_cli_apply_changes_internal (vty=0x55c52a0fc6b0,
>     xpath_base=0x7ffd38d477f0 "/frr-isisd:isis/instance[area-tag='1'][vrf='default']/flex-algos/flex-algo[flex-algo='129']", clear_pending=false) at lib/northbound_cli.c:178
> #15 0x00007fc58072dbcf in nb_cli_apply_changes (vty=0x55c52a0fc6b0, xpath_base_fmt=0x55c528014de0 "./flex-algos/flex-algo[flex-algo='%ld']") at lib/northbound_cli.c:234
> #16 0x000055c527fd3403 in flex_algo_magic (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0, algorithm=129, algorithm_str=0x55c52ab120d0 "129")
>     at isisd/isis_cli.c:3752
> #17 0x000055c527fc97cb in flex_algo (self=0x55c52804f1a0 <flex_algo_cmd>, vty=0x55c52a0fc6b0, argc=2, argv=0x55c52ab00ec0) at ./isisd/isis_cli_clippy.c:6445
> #18 0x00007fc5806b9abc in cmd_execute_command_real (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, up_level=0) at lib/command.c:984
> #19 0x00007fc5806b9c35 in cmd_execute_command (vline=0x55c52aaf78f0, vty=0x55c52a0fc6b0, cmd=0x0, vtysh=0) at lib/command.c:1043
> #20 0x00007fc5806ba1e5 in cmd_execute (vty=0x55c52a0fc6b0, cmd=0x55c52aae6bd0 "flex-algo 129\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #21 0x00007fc580782ae1 in vty_command (vty=0x55c52a0fc6b0, buf=0x55c52aae6bd0 "flex-algo 129\n") at lib/vty.c:615
> #22 0x00007fc580784a05 in vty_execute (vty=0x55c52a0fc6b0) at lib/vty.c:1378
> #23 0x00007fc580787131 in vtysh_read (thread=0x7ffd38d4ab10) at lib/vty.c:2373
> #24 0x00007fc58077b605 in event_call (thread=0x7ffd38d4ab10) at lib/event.c:2011
> #25 0x00007fc5806f8976 in frr_run (master=0x55c529df9b30) at lib/libfrr.c:1212
> #26 0x000055c527f301bc in main (argc=5, argv=0x7ffd38d4ad58, envp=0x7ffd38d4ad88) at isisd/isis_main.c:350
> (gdb) f 6
> #6  0x000055c527f798c9 in isis_link_params_update_asla (circuit=0x55c52aaed3c0, ifp=0x55c52a1044e0) at isisd/isis_te.c:176
> 176                     list_delete_all_node(ext->aslas);
> (gdb) p ext
> $1 = (struct isis_ext_subtlvs *) 0x0

Fixes: ae27101e6f ("isisd: fix building asla at first flex-algo config")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit cd81d28ae253e64665ce7c45e18e479e3fc2f90d)

8 months agoMerge pull request #16660 from Jafaral/ospfv3-10.1-text-fix
Russ White [Tue, 27 Aug 2024 15:02:52 +0000 (11:02 -0400)]
Merge pull request #16660 from Jafaral/ospfv3-10.1-text-fix

tests: Fix ospfv3 basic functionality test (backport #16657)

8 months agotests: Fix ospfv3 basic functionality test (backport #16657) 16660/head
Jafar Al-Gharaibeh [Tue, 27 Aug 2024 03:40:20 +0000 (22:40 -0500)]
tests: Fix ospfv3 basic functionality test (backport #16657)

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
8 months agoMerge pull request #16647 from FRRouting/mergify/bp/stable/10.1/pr-16646
Jafar Al-Gharaibeh [Sat, 24 Aug 2024 21:39:36 +0000 (17:39 -0400)]
Merge pull request #16647 from FRRouting/mergify/bp/stable/10.1/pr-16646

pimd: Fix crash in pimd (backport #16646)

8 months agopimd: Fix crash in pimd 16647/head
Corey Siltala [Fri, 23 Aug 2024 18:04:26 +0000 (18:04 +0000)]
pimd: Fix crash in pimd

ifp->info is not always set in PIM. So add a guard here to stop
it from crashing when addresses are added to a non-PIM enabled interface
and PIM zebra debugging is enabled.

Signed-off-by: Corey Siltala <csiltala@atcorp.com>
(cherry picked from commit 12a783d313fccb0a2793f32be57b687dba736e0d)

8 months agoMerge pull request #16644 from FRRouting/mergify/bp/stable/10.1/pr-16640
Donatas Abraitis [Sat, 24 Aug 2024 06:29:47 +0000 (09:29 +0300)]
Merge pull request #16644 from FRRouting/mergify/bp/stable/10.1/pr-16640

nhrpd: fix sending /32 shortcut (backport #16640)

8 months agonhrpd: fix sending /32 shortcut 16644/head
Louis Scalbert [Fri, 23 Aug 2024 14:05:45 +0000 (16:05 +0200)]
nhrpd: fix sending /32 shortcut

The remote spoke always sends a 32 prefix length to a shortcut request.
In the example, the remote spoke as the IP address 192.168.2.1/24.

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.1/32           10.255.255.2

Do not deal with local routes in nhrpd. Now:

spoke1# sh ip nhrp shortcut
Type     Prefix                   Via                      Identity
dynamic  192.168.2.0/24           10.255.255.2

Fixes: d4aa24ba7d ("*: Introduce Local Host Routes to FRR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit af54901405474b0623bda1899424ec18a3240c71)

8 months agoMerge pull request #16642 from FRRouting/mergify/bp/stable/10.1/pr-15561
Donald Sharp [Fri, 23 Aug 2024 18:44:13 +0000 (14:44 -0400)]
Merge pull request #16642 from FRRouting/mergify/bp/stable/10.1/pr-15561

Mimic GNU basename() API for non-glibc library e.g. musl (backport #15561)

8 months agozebra: Mimic GNU basename() API for non-glibc library e.g. musl 16642/head
Khem Raj [Fri, 15 Mar 2024 21:34:06 +0000 (14:34 -0700)]
zebra: Mimic GNU basename() API for non-glibc library e.g. musl

musl only provides POSIX version of basename and it has also removed
providing it via string.h header [1] which now results in compile errors
with newer compilers e.g. clang-18

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 0ef71391f0fb15039550a09c218977fa3e1abaf1)

8 months agoMerge pull request #16622 from FRRouting/mergify/bp/stable/10.1/pr-16546
Donatas Abraitis [Thu, 22 Aug 2024 09:28:55 +0000 (12:28 +0300)]
Merge pull request #16622 from FRRouting/mergify/bp/stable/10.1/pr-16546

bgpd: fix, do not access peer->notify.data when it is null (backport #16546)

8 months agoMerge pull request #16617 from FRRouting/mergify/bp/stable/10.1/pr-16608
Donatas Abraitis [Thu, 22 Aug 2024 07:41:17 +0000 (09:41 +0200)]
Merge pull request #16617 from FRRouting/mergify/bp/stable/10.1/pr-16608

bgpd: fix crash at no rpki (backport #16608)

8 months agotopotest: test_bgp_snmp_bgpv4v2_notification 16622/head
Dmytro Shytyi [Thu, 8 Aug 2024 13:42:40 +0000 (15:42 +0200)]
topotest: test_bgp_snmp_bgpv4v2_notification

This test checks the bgp crash on rt2 when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password 8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: test if rt2 bgp is crashed.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
(cherry picked from commit e23005f407be4c284aaafa4c379d54581b7a8e78)

8 months agobgpd: fix, do not access peer->notify.data when it is null
Dmytro Shytyi [Thu, 8 Aug 2024 13:53:11 +0000 (15:53 +0200)]
bgpd: fix, do not access peer->notify.data when it is null

bgp crash on rt2 spotted when 2 commands
launched consequently:
T0: rr, config -> router bgp 65004 -> neighbor 192.168.12.2 password
8888
T1: rt2, snmpwalk -v 2c -c public 127.0.0.1 .1.3.6.1.4.1.7336.4.2.1
T2: rt2 bgp is crashed.

config rt2-bgp:
---------------

!
debug bgp updates
!
router bgp 65002
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.4 remote-as external
 neighbor 192.168.12.4 timers 1 3
 neighbor 192.168.12.4 timers connect 1
 neighbor 2001:db8::12:4 remote-as external
 neighbor 2001:db8::12:4 timers 1 3
 neighbor 2001:db8::12:4 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.4 activate
  neighbor 192.168.12.4 addpath-tx-all-paths

 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:4 activate
 exit-address-family
!
agentx
!

config rt2-snmpd:
agentAddress 127.0.0.1,[::1]

group public_group v1 public
group public_group v2c public
access public_group "" any noauth prefix all all none

rocommunity public default

view all included .1

iquerySecName frr
rouser frr

master agentx

agentXSocket /etc/frr/agentx
agentXPerms 777 755 root frr

config rt2-zebra:
-----------------

!
interface r2-eth0
 ip address 192.168.12.2/24
 ipv6 address 2001:db8::12:2/64
!

config rr-bgpd:
---------------

!
debug bgp updates
!
router bgp 65004
 no bgp ebgp-requires-policy
 no bgp network import-check
 no bgp default ipv4-unicast
 neighbor 192.168.12.1 remote-as external
 neighbor 192.168.12.1 timers 1 3
 neighbor 192.168.12.1 timers connect 1
 neighbor 192.168.12.2 remote-as external
 neighbor 192.168.12.2 timers 1 3
 neighbor 192.168.12.2 timers connect 1
 neighbor 192.168.12.3 remote-as external
 neighbor 192.168.12.3 timers 1 3
 neighbor 192.168.12.3 timers connect 1
 neighbor 2001:db8::12:1 remote-as external
 neighbor 2001:db8::12:1 timers 1 3
 neighbor 2001:db8::12:1 timers connect 1
 neighbor 2001:db8::12:2 remote-as external
 neighbor 2001:db8::12:2 timers 1 3
 neighbor 2001:db8::12:2 timers connect 1
 neighbor 2001:db8::12:3 remote-as external
 neighbor 2001:db8::12:3 timers 1 3
 neighbor 2001:db8::12:3 timers connect 1
 !
 address-family ipv4 unicast
  neighbor 192.168.12.1 activate
  neighbor 192.168.12.1 addpath-tx-all-paths
  neighbor 192.168.12.1 route-server-client
  neighbor 192.168.12.2 activate
  neighbor 192.168.12.2 addpath-tx-all-paths
  neighbor 192.168.12.2 route-server-client
  neighbor 192.168.12.3 activate
  neighbor 192.168.12.3 addpath-tx-all-paths
  neighbor 192.168.12.3 route-server-client
 exit-address-family
 address-family ipv6 unicast
  neighbor 2001:db8::12:1 activate
  neighbor 2001:db8::12:1 route-server-client
  neighbor 2001:db8::12:2 activate
  neighbor 2001:db8::12:2 route-server-client
  neighbor 2001:db8::12:3 activate
  neighbor 2001:db8::12:3 route-server-client
 exit-address-family
!
agentx
!

config rr-zebra:
----------------
!
interface rr-eth0
 ip address 192.168.12.4/24
 ipv6 address 2001:db8::12:4/64
!

Fixes: 2d8fff6b81bb ("bgpd: Implement BGP4V2-MIB(bgp4V2PeerErrorsTable)")
Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
(cherry picked from commit d53460554552c288831524c60dd98c303cba7c26)

8 months agobgpd: fix crash at no rpki 16617/head
Louis Scalbert [Tue, 20 Aug 2024 08:33:30 +0000 (10:33 +0200)]
bgpd: fix crash at no rpki

When 'no rpki' is requested and the rtrlib RPKI object was freed, bgpd
is crashing.

RPKI is configured in VRF red.

> ip l set red down
> ip l del red
> printf 'conf\n vrf red\n no rpki' | vtysh

> Core was generated by `/usr/bin/bgpd -A 127.0.0.1 -M snmp -M rpki -M bmp'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> 44 ./nptl/pthread_kill.c: No such file or directory.
> [Current thread is 1 (Thread 0x7fb401f419c0 (LWP 190226))]
> (gdb) bt
> #0  __pthread_kill_implementation (no_tid=0, signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:44
> #1  __pthread_kill_internal (signo=11, threadid=140411103615424) at ./nptl/pthread_kill.c:78
> #2  __GI___pthread_kill (threadid=140411103615424, signo=signo@entry=11) at ./nptl/pthread_kill.c:89
> #3  0x00007fb4021ad476 in __GI_raise (sig=11) at ../sysdeps/posix/raise.c:26
> #4  0x00007fb4025ce22b in core_handler (signo=11, siginfo=0x7fff831b2d70, context=0x7fff831b2c40) at lib/sigevent.c:248
> #5  <signal handler called>
> #6  rtr_mgr_remove_group (config=0x55fe8789f750, preference=11) at /build/make-pkg/output/source/DIST_RTRLIB/rtrlib/rtrlib/rtr_mgr.c:607
> #7  0x00007fb40145f518 in rpki_delete_all_cache_nodes (rpki_vrf=0x55fe8789f4f0) at bgpd/bgp_rpki.c:442
> #8  0x00007fb401463098 in no_rpki_magic (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at bgpd/bgp_rpki.c:1732
> #9  0x00007fb40145c09a in no_rpki (self=0x7fb40146bba0 <no_rpki_cmd>, vty=0x55fe877f5130, argc=2, argv=0x55fe877fccd0) at ./bgpd/bgp_rpki_clippy.c:37
> #10 0x00007fb402527abc in cmd_execute_command_real (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, up_level=0) at lib/command.c:984
> #11 0x00007fb402527c35 in cmd_execute_command (vline=0x55fe877fd150, vty=0x55fe877f5130, cmd=0x0, vtysh=0) at lib/command.c:1043
> #12 0x00007fb4025281e5 in cmd_execute (vty=0x55fe877f5130, cmd=0x55fe877fb8c0 "no rpki\n", matched=0x0, vtysh=0) at lib/command.c:1209
> #13 0x00007fb4025f0aed in vty_command (vty=0x55fe877f5130, buf=0x55fe877fb8c0 "no rpki\n") at lib/vty.c:615
> #14 0x00007fb4025f2a11 in vty_execute (vty=0x55fe877f5130) at lib/vty.c:1378
> #15 0x00007fb4025f513d in vtysh_read (thread=0x7fff831b5fa0) at lib/vty.c:2373
> #16 0x00007fb4025e9611 in event_call (thread=0x7fff831b5fa0) at lib/event.c:2011
> #17 0x00007fb402566976 in frr_run (master=0x55fe871a14a0) at lib/libfrr.c:1212
> #18 0x000055fe857829fa in main (argc=9, argv=0x7fff831b6218) at bgpd/bgp_main.c:549

Fixes: 8156765abe ("bgpd: Add `no rpki` command")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 4e053d65f1c7edbcc3391026300388513d4c31b0)

8 months agoMerge pull request #16591 from FRRouting/mergify/bp/stable/10.1/pr-16585
Donald Sharp [Thu, 15 Aug 2024 12:21:56 +0000 (08:21 -0400)]
Merge pull request #16591 from FRRouting/mergify/bp/stable/10.1/pr-16585

bgpd: fix memory type for static->prd_pretty (backport #16585)

8 months agobgpd: fix memory type for static->prd_pretty 16591/head
Philippe Guibert [Wed, 14 Aug 2024 13:36:36 +0000 (15:36 +0200)]
bgpd: fix memory type for static->prd_pretty

A crash happens when executing the following command:

> ubuntu2204hwe# conf
> ubuntu2204hwe(config)# router bgp 65500
> ubuntu2204hwe(config-router)#  !
> ubuntu2204hwe(config-router)#  address-family ipv4 unicast
> ubuntu2204hwe(config-router-af)#   sid vpn export auto
> ubuntu2204hwe(config-router-af)#  exit-address-family
> ubuntu2204hwe(config-router)#  !
> ubuntu2204hwe(config-router)#  address-family ipv4 vpn
> ubuntu2204hwe(config-router-af)#   network 4.4.4.4/32 rd 55:55 label 556
> ubuntu2204hwe(config-router-af)#   network 5.5.5.5/32 rd 662:33 label 232
> ubuntu2204hwe(config-router-af)#  exit-address-family
> ubuntu2204hwe(config-router)# exit
> ubuntu2204hwe(config)# !
> ubuntu2204hwe(config)# no router bgp

The crash analysis indicates a memory item has been freed.

> #6  0x000076066a629c15 in mt_count_free (mt=0x56b57be85e00 <MTYPE_BGP_NAME>, ptr=0x60200038b4f0)
>     at lib/memory.c:73
> #7  mt_count_free (ptr=0x60200038b4f0, mt=0x56b57be85e00 <MTYPE_BGP_NAME>) at lib/memory.c:69
> #8  qfree (mt=mt@entry=0x56b57be85e00 <MTYPE_BGP_NAME>, ptr=0x60200038b4f0) at lib/memory.c:129
> #9  0x000056b57bb09ce9 in bgp_free (bgp=<optimized out>) at bgpd/bgpd.c:4120
> #10 0x000056b57bb0aa73 in bgp_unlock (bgp=<optimized out>) at ./bgpd/bgpd.h:2513
> #11 peer_free (peer=0x62a000000200) at bgpd/bgpd.c:1313
> #12 0x000056b57bb0aca8 in peer_unlock_with_caller (name=<optimized out>, peer=<optimized out>)
>     at bgpd/bgpd.c:1344
> #13 0x000076066a6dbb2c in event_call (thread=thread@entry=0x7ffc8cae1d60) at lib/event.c:2011
> #14 0x000076066a60aa88 in frr_run (master=0x613000000040) at lib/libfrr.c:1214
> #15 0x000056b57b8b2c44 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:543

Actually, the BGP_NAME item has not been used at allocation for
static->prd_pretty, and this results in reaching 0 quicker at bgp
deletion.

Fix this by reassigning MTYPE_BGP_NAME to prd_pretty.

Fixes: 16600df2c4f4 ("bgpd: fix show run of network route-distinguisher")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 64594f8a6830eec5cc20b9c8a8676d1f62a16bcd)

8 months agoRevert "topotests: add an ebgp 6vpe test" 16587/head
Donatas Abraitis [Wed, 14 Aug 2024 19:51:45 +0000 (22:51 +0300)]
Revert "topotests: add an ebgp 6vpe test"

This reverts commit 4d7df91752d7414d9719a361a2fd4cc30943dc96.

8 months agoRevert "topotests: add bgp_nexthop_mp_ipv4_6 test"
Donatas Abraitis [Wed, 14 Aug 2024 17:28:13 +0000 (20:28 +0300)]
Revert "topotests: add bgp_nexthop_mp_ipv4_6 test"

This reverts commit 62913cb15d8195c41229c2f6090d7e189e04646e.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
8 months agoRevert "bgpd: optimize bgp_interface_address_del"
Donatas Abraitis [Wed, 14 Aug 2024 17:15:22 +0000 (20:15 +0300)]
Revert "bgpd: optimize bgp_interface_address_del"

This reverts commit fc1dd2e5060b6e470daa203080bdb9473a637407.

8 months agoRevert "bgpd: fix removing ipv6 global nexhop"
Donatas Abraitis [Wed, 14 Aug 2024 17:15:18 +0000 (20:15 +0300)]
Revert "bgpd: fix removing ipv6 global nexhop"

This reverts commit ee0378cdbb458f9d3710f1fb557368ace8d72477.

8 months agoRevert "bgpd: fix "used" json key on link-local nexthop"
Donatas Abraitis [Wed, 14 Aug 2024 17:15:13 +0000 (20:15 +0300)]
Revert "bgpd: fix "used" json key on link-local nexthop"

This reverts commit 2de4dfc97adfec788e45e148b4204196d612c81c.

8 months agoRevert "tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6"
Donatas Abraitis [Wed, 14 Aug 2024 17:15:08 +0000 (20:15 +0300)]
Revert "tests: ipv6 global removal in bgp_nexthop_mp_ipv4_6"

This reverts commit 04c220bedb63334a65677a46ef84938cc812221f.

8 months agoRevert "bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop"
Donatas Abraitis [Wed, 14 Aug 2024 17:15:04 +0000 (20:15 +0300)]
Revert "bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop"

This reverts commit fc5a738409eac9ca938cbb398872ea77d9cc5023.

8 months agoRevert "bgpd: prefer link-local to a ipv4-mapped ipv6 global"
Donatas Abraitis [Wed, 14 Aug 2024 17:14:59 +0000 (20:14 +0300)]
Revert "bgpd: prefer link-local to a ipv4-mapped ipv6 global"

This reverts commit 5dd731af8421e8b3070eec0b3af4ad234c95c6bb.

8 months agoRevert "topotests: update bgp_vrf_leaking_5549_routes"
Donatas Abraitis [Wed, 14 Aug 2024 17:14:55 +0000 (20:14 +0300)]
Revert "topotests: update bgp_vrf_leaking_5549_routes"

This reverts commit f1b8364ab3784cebfc0689883efdb21ac7d06213.

8 months agoRevert "bgpd: optimize bgp_interface_address_add"
Donatas Abraitis [Wed, 14 Aug 2024 17:14:20 +0000 (20:14 +0300)]
Revert "bgpd: optimize bgp_interface_address_add"

This reverts commit 8599fe2b5e34b2ac1a46a14983ddcc2336e9116d.

8 months agoRevert "bgpd: reduce bgp_interface_address_add indentation"
Donatas Abraitis [Wed, 14 Aug 2024 17:14:16 +0000 (20:14 +0300)]
Revert "bgpd: reduce bgp_interface_address_add indentation"

This reverts commit 778e0df87b7a846f46d84f61ea889a32fe578e49.

8 months agoRevert "bgpd: log new ipv6 global in bgp_interface_address_add"
Donatas Abraitis [Wed, 14 Aug 2024 17:14:12 +0000 (20:14 +0300)]
Revert "bgpd: log new ipv6 global in bgp_interface_address_add"

This reverts commit b083885198157555bbb916ecae9809c5d67a567b.

8 months agoRevert "bgpd: fix sending ipv6 local nexthop if global present"
Donatas Abraitis [Wed, 14 Aug 2024 17:13:44 +0000 (20:13 +0300)]
Revert "bgpd: fix sending ipv6 local nexthop if global present"

This reverts commit 424fe0bf809c1d84f16aba3f5e5f8249af29083b.

8 months agoMerge pull request #16560 from FRRouting/mergify/bp/stable/10.1/pr-16554
Donald Sharp [Tue, 13 Aug 2024 12:45:54 +0000 (08:45 -0400)]
Merge pull request #16560 from FRRouting/mergify/bp/stable/10.1/pr-16554

zebra: Ensure non-equal id's are not same nhg's (backport #16554)

8 months agoMerge pull request #16564 from FRRouting/mergify/bp/stable/10.1/pr-16545
Donald Sharp [Tue, 13 Aug 2024 12:45:09 +0000 (08:45 -0400)]
Merge pull request #16564 from FRRouting/mergify/bp/stable/10.1/pr-16545

isisd: fix memory handling in isis_adj_process_threeway() (backport #16545)

8 months agoMerge pull request #16568 from FRRouting/mergify/bp/stable/10.1/pr-16551
Donald Sharp [Tue, 13 Aug 2024 12:44:39 +0000 (08:44 -0400)]
Merge pull request #16568 from FRRouting/mergify/bp/stable/10.1/pr-16551

lib: fix distribute-list deletion (backport #16551)

8 months agolib: fix distribute-list deletion 16568/head
Igor Ryzhov [Fri, 9 Aug 2024 22:32:55 +0000 (01:32 +0300)]
lib: fix distribute-list deletion

When a whole distribute-list is deleted (can be done only using API),
all its children must be cleaned up manually.

Fixes #16538

Signed-off-by: Igor Ryzhov <idryzhov@gmail.com>
(cherry picked from commit 8fad4f317ebd3de7677d7600e7a024f713b20d70)

8 months agoisisd: fix memory handling in isis_adj_process_threeway() 16564/head
Mark Stapp [Fri, 9 Aug 2024 14:08:21 +0000 (10:08 -0400)]
isisd: fix memory handling in isis_adj_process_threeway()

The adj_process_threeway() api may call the adj_state_change()
api, which may delete the adj struct being examined. Change the
signature so that callers pass a ptr-to-ptr so that they will
see that deletion.

Signed-off-by: Mark Stapp <mjs@cisco.com>
(cherry picked from commit 3eb7d1641166872591554519607483f6d77657f5)

8 months agozebra: Ensure non-equal id's are not same nhg's 16560/head
Donald Sharp [Sat, 10 Aug 2024 23:43:08 +0000 (19:43 -0400)]
zebra: Ensure non-equal id's are not same nhg's

The function zebra_nhg_hash_equal is only used
as a hash function for storage of NHG's and retrieval.
If you have say two nhg's:

31 (25/26)
32 (25/26)

This function would return them as being equal.  Which
of course leads to the problem when you attempt to
hash_release 32 but release 31 from the hash.  Then later
when you attempt to do hash comparisons 32 has actually
been freed leaving to use after free situations and shit
goes down hill fast.

This hash is only used as part of the hash comparison
function for nexthop group storage.  Since this is so
let's always return the 31/32 nhg's are not equal at all.

We possibly have a different problem where we are creating
31 and 32 ( when 31 should have just been used instead of 32 )
but we need to prevent any type of hash release problem at all.
This supercedes any other issue( that should be tracked down
on it's own ).  Since you can have use after free situation
that leads to a crash -vs- some possible nexthop group duplication
which is very minor in comparison.

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