Commit Graph

35909 Commits

Author SHA1 Message Date
Enke Chen
4fc971a53e tests: fix and adjust topotest/bgp_aigp
Fix and adjust the topotest post the fix for route selection with
AIGP.

When there are multiple	IGP domains (OSPF in this case), the nexthop
for a BGP route with the AIGP attribute must be resolved in its own
IGP domain.

The changes in r2/bgpd.conf and r3/bgpd.conf are needed as incorrect
IGP metrics are received from NHT for the recursive nexthops. Once
the issue is resolved, the changes can be reverted.

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 1ee7e63a6c)
2024-10-15 14:25:06 +00:00
Enke Chen
3394680c23 bgpd: fix route selection with AIGP
The nexthop metric should be added to AIGP when calculating the
bestpath in bgp_path_info_cmp().

Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
(cherry picked from commit 081422e8e7)
2024-10-15 14:25:06 +00:00
Donatas Abraitis
5a48cef8f5
Merge pull request #17095 from FRRouting/mergify/bp/stable/10.1/pr-17074
bgpd: fix evpn mh esi down (backport #17074)
2024-10-15 10:50:40 +03:00
Chirag Shah
3ec60f20e2 bgpd: fix evpn mh esi flap remove local routes
In symmetric routing, when local ESI is down,
the MH peer learnt local mac-ip
prefix is installed into teannt vrf (given l3vni).

When ESI is back up and associated to evi/vni then
remove the local synced mac-ip imported routes from the
tenant vrf as local neigh/arp is present.

Ticket: #3878699
Testing:

peer advertised mac-ip route:
*> [2]:[0]:[48]:[aa:aa:aa:00:00:01]:[32]:[45.0.0.51] RD 27.0.0.4:9
                    27.0.0.4 (spine-1)
                                                           0 64435 65016 i
                    ESI:03:44:38:39:ff:ff:01:00:00:01
                    RT:65016:1000 RT:65016:4000 ET:8 Rmac:44:38:39:ff:ff:16

When local ESI is flapped
torm-11:# ip neigh show 45.0.0.51
45.0.0.51 dev vlan1000 lladdr aa:aa:aa:00:00:01 REACHABLE proto zebra

Before fix:
(The imported route remained in tenant-vrf)
torm-11:# ip route show vrf vrf1 45.0.0.51
45.0.0.51 nhid 257 proto bgp metric 20

After fix:

torm-11# ip route show vrf vrf1 45.0.0.51
torm-11#

trace:
2024/10/11 18:19:29 BGP: [JMP3T-178G8] route [2]:[0]:[48]:[00:02:00:00:00:08]:[32]:[21.1.0.5]
is matched on local esi 03:00:00:00:77:01:04:00:00:0e, uninstall from VRF tenant1 route table

Signed-off-by: Chirag Shah <chirag@nvidia.com>
(cherry picked from commit 3f00709a39)
2024-10-15 05:21:53 +00:00
Donald Sharp
02e556b6a2
Merge pull request #17067 from FRRouting/mergify/bp/stable/10.1/pr-17059
bgpd: Move some non BGP-specific route-map functions to lib (backport #17059)
2024-10-11 12:14:45 -04:00
Donatas Abraitis
6685763c08 bgpd: Move some non BGP-specific route-map functions to lib
They are managed under `frr-route-map`, not under `frr-bgp-route-map`.

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

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9a9be492e)
2024-10-11 11:16:57 +00:00
Donald Sharp
7ecf4f2245
Merge pull request #17033 from FRRouting/mergify/bp/stable/10.1/pr-17022
vrrpd: iterate over all ancillary messages (backport #17022)
2024-10-08 18:22:21 -04:00
Rafael Zalamena
12d494731c vrrpd: iterate over all ancillary messages
Assign the return of `CMSG_NXTHDR` so we can really iterate over the
ancillary data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 5e1a3cd2ad)
2024-10-08 13:32:24 +00:00
Donald Sharp
9b69084cac
Merge pull request #17026 from FRRouting/mergify/bp/stable/10.1/pr-17014
isisd: fix wrong check for MT commands (backport #17014)
2024-10-08 09:24:41 -04:00
anlan_cs
5bc541c430 isisd: fix wrong check for MT commands
```
anlan# show run
!
interface eth0
 ip router isis A
exit
!
router isis A
 metric-style narrow <- NOT wide
exit
!
end
anlan (config)# int eth0
anlan (config-if)# no isis topology ipv6-unicast
% Configuration failed.

Error type: validation
Error description: Multi topology IS-IS can only be used with wide metrics
```

The MT commands are mainly controlled by the binded area, not by interface.
Currently if there is any MT configuration in the area, `metric-style` must
be with the `wide` mode, this requirement is sufficient.  So, the
unnecessary/wrong check for MT in the interface should be removed.

Signed-off-by: anlan_cs <anlan_cs@126.com>
(cherry picked from commit 424cec61c0)
2024-10-08 05:11:10 +00:00
Donatas Abraitis
4daa9b2e3a
Merge pull request #17003 from FRRouting/mergify/bp/stable/10.1/pr-17000
zebra: Fix crash during reconnect (backport #17000)
2024-10-07 11:26:33 +03:00
Igor Zhukov
bcfd0ad4ba zebra: Fix crash during reconnect
fpm_enqueue_rmac_table expects an fpm_rmac_arg* as its argument.

The issue can be reproduced by dropping the TCP session using:

ss -K dst 127.0.0.1 dport = 2620

I used Fedora 40 and frr 9.1.2 and I got the gdb backtrace:

(gdb) bt
0  0x00007fdd7d6997ea in fpm_enqueue_rmac_table (bucket=0x2134dd0, arg=0x2132b60) at zebra/dplane_fpm_nl.c:1217
1  0x00007fdd7dd1560d in hash_iterate (hash=0x21335f0, func=0x7fdd7d6997a0 <fpm_enqueue_rmac_table>, arg=0x2132b60) at lib/hash.c:252
2  0x00007fdd7dd1560d in hash_iterate (hash=0x1e5bf10, func=func@entry=0x7fdd7d698900 <fpm_enqueue_l3vni_table>,
    arg=arg@entry=0x7ffed983bef0) at lib/hash.c:252
3  0x00007fdd7d698b5c in fpm_rmac_send (t=<optimized out>) at zebra/dplane_fpm_nl.c:1262
4  0x00007fdd7dd6ce22 in event_call (thread=thread@entry=0x7ffed983c010) at lib/event.c:1970
5  0x00007fdd7dd20758 in frr_run (master=0x1d27f10) at lib/libfrr.c:1213
6  0x0000000000425588 in main (argc=10, argv=0x7ffed983c2e8) at zebra/main.c:492

Signed-off-by: Igor Zhukov <fsb4000@yandex.ru>
(cherry picked from commit a3877e4444)
2024-10-04 11:41:59 +00:00
Jafar Al-Gharaibeh
086d067b0c
Merge pull request #16996 from FRRouting/mergify/bp/stable/10.1/pr-16934
*: Modify clang-format column limit to 100 (backport #16934)
2024-10-03 20:08:42 -05:00
Donald Sharp
c8ef27edbc *: Modify clang-format column limit to 100
A bunch of recent discussion has gone on about this.  Let's see
if we are actually interested in making a change.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit bc915893a2)
2024-10-03 19:52:13 +00:00
Donatas Abraitis
9f83571d9c
Merge pull request #16980 from FRRouting/mergify/bp/stable/10.1/pr-16971
bgpd: Actually make ` --v6-with-v4-nexthops` it work (backport #16971)
2024-10-03 11:46:00 +03:00
Donatas Abraitis
528dd95322
Merge pull request #16982 from FRRouting/mergify/bp/stable/10.1/pr-16977
bgpd: fix printfrr_bp for non initialized peers (backport #16977)
2024-10-03 11:02:08 +03:00
Louis Scalbert
54805745e2 bgpd: fix printfrr_bp for non initialized peers
Fix printfrr_bp for non initialized peers. For example:

> Sep 26 17:56:44 r1 bgpd[26295]: [GJPH1-W8PZV] Resetting peer (null)(Unknown) due to change in addpath config

Is now:

> Oct 02 14:00:59 r1 bgpd[12795]: [MNE5N-K0G4Z] Resetting peer 2.2.2.2 due to change in addpath config

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit b56cfc6c80)
2024-10-02 15:58:57 +00:00
Donatas Abraitis
73e40fc819 bgpd: Actually make --v6-with-v4-nexthops it work
It was using `-v` which is actually a _version_.

Fixes: 0435b31bb8 ("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 0495cac837)
2024-10-02 15:09:26 +00:00
Donald Sharp
4d153770a1
Merge pull request #16973 from FRRouting/mergify/bp/stable/10.1/pr-16968
bfdd: add no variants to interval configurations (backport #16968)
2024-10-02 11:07:23 -04:00
Rafael Zalamena
955cfec28b 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 b70835d690)
2024-10-02 12:41:30 +00:00
Donatas Abraitis
370ce3baef
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)
2024-10-01 15:18:02 +03:00
Vladislav Odintsov
5939b82397 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 0e3c5e8e59)
2024-10-01 07:48:43 +00:00
Donald Sharp
cf5b42e3fe
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)
2024-09-26 15:56:19 -04:00
Donatas Abraitis
c68a7fb945 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 464212db08)
2024-09-26 17:07:52 +00:00
Donald Sharp
52c9723daf
Merge pull request #16919 from FRRouting/mergify/bp/stable/10.1/pr-16918
zebra snmp fixes (backport #16918)
2024-09-25 18:06:28 -04:00
Donald Sharp
d6e4c5ef7c
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)
2024-09-25 17:56:06 -04:00
Sindhu Parvathi Gopinathan
a78f3578ad 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 ff008cee6b)
2024-09-25 18:53:54 +00:00
Donald Sharp
e3c23a1249 zebra: Add missing proto translations
Add missing isis and eigrp proto translations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit f53dde0e59)
2024-09-25 18:51:29 +00:00
Donald Sharp
b813bc0628 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 e41ae0acc1)
2024-09-25 18:51:29 +00:00
Donald Sharp
9329b38f8c 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 659cd66427)
2024-09-25 18:51:29 +00:00
Donald Sharp
b494f1a314 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 ecd9d441b0)
2024-09-25 18:51:29 +00:00
Russ White
e45891fca9
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)
2024-09-24 12:33:27 -04:00
Russ White
8543237034
Merge pull request #16897 from FRRouting/mergify/bp/stable/10.1/pr-16630
Babel metric (backport #16630)
2024-09-24 10:56:41 -04:00
Donald Sharp
1cff00a181 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 63e2c092a3)
2024-09-23 11:41:31 +00:00
Donald Sharp
679b4f07e8 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 b4c88abe9f)
2024-09-23 11:41:30 +00:00
Acee Lindem
0c8ef89d2f 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 77de5eeb80)
2024-09-23 06:20:30 +00:00
Jafar Al-Gharaibeh
a4c96c6a58
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)
2024-09-19 08:49:56 -05:00
Acee Lindem
9da029884c 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 0dc969185f)
2024-09-18 23:56:49 +00:00
Donald Sharp
a099561cb4
Merge pull request #16842 from FRRouting/mergify/bp/stable/10.1/pr-16809
isisd: fix rcap tlv double-free crash (backport #16809)
2024-09-17 13:39:37 -04:00
Louis Scalbert
33a58e9362 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 cfd050a0e5)
2024-09-17 12:35:15 +00:00
Louis Scalbert
670c4039ce 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 d61758140d)
2024-09-17 12:35:15 +00:00
Donald Sharp
9ffb74fb2f
Merge pull request #16819 from FRRouting/mergify/bp/stable/10.1/pr-16808
nhrpd: fixes duplicate auth extension (backport #16808)
2024-09-13 19:53:47 -04:00
Donald Sharp
367d7ed583
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)
2024-09-13 19:52:36 -04:00
Dmitrii Turlupov
376fd01129 ospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commands
Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
(cherry picked from commit 69e31a547f)
2024-09-13 15:58:52 +00:00
Denys Haryachyy
ebe88a053d 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 8e3c278bbc)
2024-09-13 14:52:33 +00:00
Donald Sharp
2af6e7aa0a
Merge pull request #16806 from opensourcerouting/fix/backport_ABUILD_APK_INDEX_OPTS_10.1
10.1 Backport docker ABUILD_APK_INDEX_OPTS
2024-09-12 08:22:11 -04:00
Donatas Abraitis
dbf8dac1ce 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>
2024-09-12 10:46:05 +03:00
Donatas Abraitis
fb9c18cd96 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>
2024-09-12 09:53:00 +03:00
Donatas Abraitis
371f3d3cf1 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>
2024-09-12 09:52:59 +03:00
Donald Sharp
884196eed1
Merge pull request #16794 from opensourcerouting/fix/5e1b7f5a69505c76999e610d8773f5abd63fe1a2_10.1
bgpd: fix as-path exclude modify crash
2024-09-11 15:55:09 -04:00