]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
17 months agodocs: clean up some developer doc warnings 14700/head
Mark Stapp [Tue, 31 Oct 2023 13:57:13 +0000 (09:57 -0400)]
docs: clean up some developer doc warnings

A few fixups to clean up some dev doc warnings, in the
northbound files especially.

Signed-off-by: Mark Stapp <mjs@labn.net>
18 months agoMerge pull request #14662 from opensourcerouting/fix/drop_broken_tests
Donald Sharp [Fri, 27 Oct 2023 14:14:40 +0000 (10:14 -0400)]
Merge pull request #14662 from opensourcerouting/fix/drop_broken_tests

tests: Drop a couple unnecessary unit tests

18 months agoMerge pull request #14663 from LabNConsulting/chopps/grpc-utfix
Donatas Abraitis [Fri, 27 Oct 2023 12:36:07 +0000 (15:36 +0300)]
Merge pull request #14663 from LabNConsulting/chopps/grpc-utfix

tests: have unit-test check more paths for the grpc.so module

18 months agoMerge pull request #14664 from LabNConsulting/chopps/ly2-ld-fix
Donatas Abraitis [Fri, 27 Oct 2023 09:55:51 +0000 (12:55 +0300)]
Merge pull request #14664 from LabNConsulting/chopps/ly2-ld-fix

isisd: staticd: need to link directly against libyang

18 months agoisisd: staticd: need to link directly against libyang 14664/head
Christian Hopps [Fri, 27 Oct 2023 02:51:08 +0000 (22:51 -0400)]
isisd: staticd: need to link directly against libyang

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agotests: have unit-test check more paths for the grpc.so module 14663/head
Christian Hopps [Fri, 27 Oct 2023 01:39:13 +0000 (21:39 -0400)]
tests: have unit-test check more paths for the grpc.so module

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agobgpd: Drop unnecessary unit test for software-version capability 14662/head
Donatas Abraitis [Thu, 26 Oct 2023 14:24:42 +0000 (17:24 +0300)]
bgpd: Drop unnecessary unit test for software-version capability

It's tested above, and was just copied from extended-nexthop as an example
which is broken too.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Drop broken unit test for extended-nexthop capability
Donatas Abraitis [Thu, 26 Oct 2023 14:20:28 +0000 (17:20 +0300)]
tests: Drop broken unit test for extended-nexthop capability

extended-nexthop capability can't be unset to interface-based peers.

Anyway, this is always silently ignored:

```
✖ [test] peer\capability extended-nexthop
► prepare: initialize bgp test environment
► case 01: set peer-flag [capability extended-nexthop] on [IP-TEST]
► error: execution of command [no neighbor IP-TEST capability extended-nexthop] has failed with code [13]
failed
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14609 from idryzhov/cfg-apply-remove-batches
Christian Hopps [Wed, 25 Oct 2023 17:43:44 +0000 (13:43 -0400)]
Merge pull request #14609 from idryzhov/cfg-apply-remove-batches

mgmtd, lib: remove batch ids from cfg apply reply

18 months agoMerge pull request #14651 from opensourcerouting/fix/bgpd_coverity_fqdn_capability
Russ White [Wed, 25 Oct 2023 11:24:04 +0000 (07:24 -0400)]
Merge pull request #14651 from opensourcerouting/fix/bgpd_coverity_fqdn_capability

bgpd: Drop unnecessary null-termination for fqdn

18 months agoMerge pull request #14645 from opensourcerouting/fix/crash_mp_reach_nlri
Russ White [Wed, 25 Oct 2023 11:21:25 +0000 (07:21 -0400)]
Merge pull request #14645 from opensourcerouting/fix/crash_mp_reach_nlri

bgpd: A couple more bgpd crashes on malformed attributes

18 months agobgpd: Drop unnecessary null-termination for fqdn 14651/head
Donatas Abraitis [Wed, 25 Oct 2023 04:52:38 +0000 (07:52 +0300)]
bgpd: Drop unnecessary null-termination for fqdn

str[len] is already null terminated before:

```
if (len > BGP_MAX_HOSTNAME) {
memcpy(&str, data, BGP_MAX_HOSTNAME);
str[BGP_MAX_HOSTNAME] = '\0';
} else if (len) {
memcpy(&str, data, len);
str[len] = '\0';
}
```

CID: 1569357

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14639 from donaldsharp/zebra_nexthop_search_up
Russ White [Tue, 24 Oct 2023 20:13:20 +0000 (16:13 -0400)]
Merge pull request #14639 from donaldsharp/zebra_nexthop_search_up

zebra: Allow longer prefix matches for nexthops

18 months agoMerge pull request #14333 from fdumontet6WIND/bgp4v2_snmp
Donatas Abraitis [Tue, 24 Oct 2023 18:34:47 +0000 (21:34 +0300)]
Merge pull request #14333 from fdumontet6WIND/bgp4v2_snmp

bgpd: add support of traps for bgp4-mibv2

18 months agobgpd: fix new Formatting / Styling warning 14333/head
Francois Dumontet [Wed, 11 Oct 2023 19:31:40 +0000 (21:31 +0200)]
bgpd: fix new Formatting / Styling warning

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: add bgp4v2 MIB traps test
Francois Dumontet [Thu, 28 Sep 2023 10:06:53 +0000 (12:06 +0200)]
tests: add bgp4v2 MIB traps test

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: add bgp4 MIB traps test
Francois Dumontet [Tue, 26 Sep 2023 12:18:25 +0000 (14:18 +0200)]
tests: add bgp4 MIB traps test

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agotests: lib add support of snmptrapd daemon
Francois Dumontet [Tue, 26 Sep 2023 12:07:00 +0000 (14:07 +0200)]
tests: lib add support of snmptrapd daemon

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agodoc: [no] bgp snmp traps <rfc4273|bgp4-mibv2>
Francois Dumontet [Tue, 5 Sep 2023 12:16:20 +0000 (14:16 +0200)]
doc: [no] bgp snmp traps <rfc4273|bgp4-mibv2>

update traps documentation

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agobgpd: add [no] bgp snmp traps bgp4-mibv2 command
Francois Dumontet [Wed, 30 Aug 2023 15:35:32 +0000 (17:35 +0200)]
bgpd: add [no] bgp snmp traps bgp4-mibv2 command

There is no command to choose to send or not the bgp4-mibv2 traps.
Since the MIB bgp4-mibv2 notification are redundant with MIB RFC4273
we added a command:
- [no] bgp snmp traps bgp4-mibv2

By default, the bgp4-mibv2 traps will be disabled, to prevent from
redundancy.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: add snmp traps for bgp4-mibv2
Francois Dumontet [Wed, 23 Aug 2023 08:34:13 +0000 (10:34 +0200)]
bgpd: add snmp traps for bgp4-mibv2

This commit add the support of traps for bgp4-mibv2.
It is conformant to draft-ietf-idr-bgp4-mibv2-11.
The following traps are supported:
- bgp4V2EstablishedNotification
- bgp4V2BackwardTransitionNotification

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: add [no] bgp snmp traps rfc4273 command
Francois Dumontet [Tue, 29 Aug 2023 15:53:26 +0000 (17:53 +0200)]
bgpd: add [no] bgp snmp traps rfc4273 command

There is no cli command to prevent the router to send traps
implemented in the rfc4273. If not done, when introducing
the traps from bgp4v2mib, traps will be send for each of
the two mibs: there will be redundancy in the sent information.

Add a new command:
- [no] bgp snmp traps rfc4273

Using this command will allow or not the notification of
the following traps:
- bgpEstablishedNotification
- bgpBackwardTransNotification

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
18 months agobgpd: Check mandatory attributes more carefully for UPDATE message 14645/head
Donatas Abraitis [Mon, 23 Oct 2023 20:34:10 +0000 (23:34 +0300)]
bgpd: Check mandatory attributes more carefully for UPDATE message

If we send a crafted BGP UPDATE message without mandatory attributes, we do
not check if the length of the path attributes is zero or not. We only check
if attr->flag is at least set or not. Imagine we send only unknown transit
attribute, then attr->flag is always 0. Also, this is true only if graceful-restart
capability is received.

A crash:

```
bgpd[7834]: [TJ23Y-GY0RH] 127.0.0.1 Unknown attribute is received (type 31, length 16)
bgpd[7834]: [PCFFM-WMARW] 127.0.0.1(donatas-pc) rcvd UPDATE wlen 0 attrlen 20 alen 17
BGP[7834]: Received signal 11 at 1698089639 (si_addr 0x0, PC 0x55eefd375b4a); aborting...
BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f3205ca939d]
BGP[7834]: /usr/local/lib/libfrr.so.0(zlog_signal+0xf3) [0x7f3205ca9593]
BGP[7834]: /usr/local/lib/libfrr.so.0(+0xf5181) [0x7f3205cdd181]
BGP[7834]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f3204ff3980]
BGP[7834]: /usr/lib/frr/bgpd(+0x18ab4a) [0x55eefd375b4a]
BGP[7834]: /usr/local/lib/libfrr.so.0(route_map_apply_ext+0x310) [0x7f3205cd1290]
BGP[7834]: /usr/lib/frr/bgpd(+0x163610) [0x55eefd34e610]
BGP[7834]: /usr/lib/frr/bgpd(bgp_update+0x9a5) [0x55eefd35c1d5]
BGP[7834]: /usr/lib/frr/bgpd(bgp_nlri_parse_ip+0xb7) [0x55eefd35e867]
BGP[7834]: /usr/lib/frr/bgpd(+0x1555e6) [0x55eefd3405e6]
BGP[7834]: /usr/lib/frr/bgpd(bgp_process_packet+0x747) [0x55eefd345597]
BGP[7834]: /usr/local/lib/libfrr.so.0(event_call+0x83) [0x7f3205cef4a3]
BGP[7834]: /usr/local/lib/libfrr.so.0(frr_run+0xc0) [0x7f3205ca10a0]
BGP[7834]: /usr/lib/frr/bgpd(main+0x409) [0x55eefd2dc979]
```

Sending:

```
import socket
import time

OPEN = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\x00\x62\x01\x04\xfd\xea\x00\x5a\x0a\x00\x00\x01\x45\x02"
b"\x06\x01\x04\x00\x01\x00\x01\x02\x02\x02\x00\x02\x02\x46\x00\x02"
b"\x06\x41\x04\x00\x00\xfd\xea\x02\x02\x06\x00\x02\x06\x45\x04\x00"
b"\x01\x01\x03\x02\x0e\x49\x0c\x0a\x64\x6f\x6e\x61\x74\x61\x73\x2d"
b"\x70\x63\x00\x02\x04\x40\x02\x00\x78\x02\x09\x47\x07\x00\x01\x01"
b"\x80\x00\x00\x00")

KEEPALIVE = (b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
b"\xff\xff\xff\xff\xff\xff\x00\x13\x04")

UPDATE = bytearray.fromhex("ffffffffffffffffffffffffffffffff003c0200000014ff1f001000040146464646460004464646464646664646f50d05800100010200ffff000000")

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.2', 179))
s.send(OPEN)
data = s.recv(1024)
s.send(KEEPALIVE)
data = s.recv(1024)
s.send(UPDATE)
data = s.recv(1024)
time.sleep(1000)
s.close()
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Handle MP_REACH_NLRI malformed packets with session reset
Donatas Abraitis [Fri, 20 Oct 2023 14:49:18 +0000 (17:49 +0300)]
bgpd: Handle MP_REACH_NLRI malformed packets with session reset

Avoid crashing bgpd.

```
(gdb)
bgp_mp_reach_parse (args=<optimized out>, mp_update=0x7fffffffe140) at bgpd/bgp_attr.c:2341
2341 stream_get(&attr->mp_nexthop_global, s, IPV6_MAX_BYTELEN);
(gdb)
stream_get (dst=0x7fffffffe1ac, s=0x7ffff0006e80, size=16) at lib/stream.c:320
320 {
(gdb)
321 STREAM_VERIFY_SANE(s);
(gdb)
323 if (STREAM_READABLE(s) < size) {
(gdb)
34   return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
(gdb)

Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault.
0x00005555556e37be in route_set_aspath_prepend (rule=0x555555aac0d0, prefix=0x7fffffffe050,
    object=0x7fffffffdb00) at bgpd/bgp_routemap.c:2282
2282 if (path->attr->aspath->refcnt)
(gdb)
```

With the configuration:

```
 neighbor 127.0.0.1 remote-as external
 neighbor 127.0.0.1 passive
 neighbor 127.0.0.1 ebgp-multihop
 neighbor 127.0.0.1 disable-connected-check
 neighbor 127.0.0.1 update-source 127.0.0.2
 neighbor 127.0.0.1 timers 3 90
 neighbor 127.0.0.1 timers connect 1
 address-family ipv4 unicast
  redistribute connected
  neighbor 127.0.0.1 default-originate
  neighbor 127.0.0.1 route-map RM_IN in
 exit-address-family
!
route-map RM_IN permit 10
 set as-path prepend 200
exit
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14540 from opensourcerouting/feature/bgpd_handle_fqdn_capability_...
Russ White [Tue, 24 Oct 2023 10:23:32 +0000 (06:23 -0400)]
Merge pull request #14540 from opensourcerouting/feature/bgpd_handle_fqdn_capability_via_dynamic_capability

bgpd: Handle FQDN capability using dynamic capabilities

18 months agoMerge pull request #13979 from gpnaveen/bgp_unique_rid
Russ White [Tue, 24 Oct 2023 10:09:58 +0000 (06:09 -0400)]
Merge pull request #13979 from gpnaveen/bgp_unique_rid

tests: Adding a bgp router id chaos test case.

18 months agoMerge pull request #14629 from mjstapp/zebra_debug_netlink_ifname
Donatas Abraitis [Tue, 24 Oct 2023 07:09:45 +0000 (10:09 +0300)]
Merge pull request #14629 from mjstapp/zebra_debug_netlink_ifname

zebra: debug ifname in netlink link debugs

18 months agoMerge pull request #14634 from LabNConsulting/chopps/gdb-use-emacs
Donatas Abraitis [Tue, 24 Oct 2023 05:58:40 +0000 (08:58 +0300)]
Merge pull request #14634 from LabNConsulting/chopps/gdb-use-emacs

tests: add --gdb-use-emacs option

18 months agozebra: Allow longer prefix matches for nexthops 14639/head
Donald Sharp [Thu, 19 Oct 2023 20:38:12 +0000 (16:38 -0400)]
zebra: Allow longer prefix matches for nexthops

Zebra currently does a shortest prefix match for
resolving nexthops for a prefix.  This is typically
an ok thing to do but fails in several specific scenarios.
If a nexthop matches to a route that is not usable, nexthop
resolution just gives up and refuses to use that particular
route.  For example if zebra currently has a covering prefix
say a 10.0.0.0/8.  And about the same time it receives a
10.1.0.0/16 ( a more specific than the /8 ) and another
route A, who's nexthop is 10.1.1.1.  Imagine the 10.1.0.0/16
is processed enough to know we want to install it and the
prefix is sent to the dataplane for installation( it is queued )
and then route A is processed, nexthop resolution will fail
and the route A will be left in limbo as uninstallable.

Let's modify the nexthop resolution code in zebra such that
if a nexthop's most specific match is unusable, continue looking
up the table till we get to the 0.0.0.0/0 route( if it's even
installed ).  If we find a usable route for the nexthop accept
it and use it.

The bgp_default_originate topology test is frequently failing
with this exact problem:

B>* 0.0.0.0/0 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
B   1.0.1.17/32 [200/0] via 192.168.0.1 inactive, weight 1, 00:00:21
B>* 1.0.2.17/32 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
C>* 1.0.3.17/32 is directly connected, lo, 00:02:00
B>* 1.0.5.17/32 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32
B>* 192.168.0.0/24 [200/0] via 192.168.1.1, r2-r1-eth0, weight 1, 00:00:21
B   192.168.1.0/24 [200/0] via 192.168.1.1 inactive, weight 1, 00:00:21
C>* 192.168.1.0/24 is directly connected, r2-r1-eth0, 00:02:00
C>* 192.168.2.0/24 is directly connected, r2-r3-eth1, 00:02:00
B>* 192.168.3.0/24 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32
B   198.51.1.1/32 [200/0] via 192.168.0.1 inactive, weight 1, 00:00:21
B>* 198.51.1.2/32 [20/0] via 192.168.2.2, r2-r3-eth1, weight 1, 00:00:32

Notice that the 1.0.1.17/32 route is inactive but the nexthop
192.168.0.1 is covered by both the 192.168.0.0/24 prefix( shortest match )
*and* the 0.0.0.0/0 route ( longest match ).  When looking at the logs
the 1.0.1.17/32 route was not being installed because the matching
route was not in a usable state, which is because the 192.168.0.0/24
route was in the process of being installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #14628 from opensourcerouting/fix/bgpd_conditional_advertisement_s...
Donald Sharp [Mon, 23 Oct 2023 11:41:07 +0000 (07:41 -0400)]
Merge pull request #14628 from opensourcerouting/fix/bgpd_conditional_advertisement_static_routes_withdrawn

bgpd: Do not suppress conditional advertisement updates if triggered

18 months agotests: add --gdb-use-emacs option 14634/head
Christian Hopps [Mon, 23 Oct 2023 09:10:50 +0000 (05:10 -0400)]
tests: add --gdb-use-emacs option

When specified `--gdb-use-emacs` will launch the daemon with gdb inside a
running emacs server using `emacsclient --eval` commands.

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agoMerge pull request #14631 from idryzhov/nb-remove-comment
Donatas Abraitis [Sun, 22 Oct 2023 08:21:40 +0000 (11:21 +0300)]
Merge pull request #14631 from idryzhov/nb-remove-comment

lib: remove incorrect comment from northbound

18 months agolib: remove incorrect comment from northbound 14631/head
Igor Ryzhov [Sat, 21 Oct 2023 09:56:49 +0000 (12:56 +0300)]
lib: remove incorrect comment from northbound

This was true when we had only a CLI for configuration. Now mgmtd has a
public frontend interface that can be used by external applications, and
they can send invalid requests that lead to errors.

This is still true for CLI though, so the same comment still stays in
`nb_cli_apply_changes_internal`.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
18 months agozebra: debug ifname in netlink link debugs 14629/head
Mark Stapp [Fri, 20 Oct 2023 15:20:25 +0000 (11:20 -0400)]
zebra: debug ifname in netlink link debugs

Print the ifname with netlink LINK debug output.

Signed-off-by: Mark Stapp <mjs@labn.net>
18 months agotests: Check if BGP conditional advertisement works fine with static routes 14628/head
Donatas Abraitis [Thu, 19 Oct 2023 17:25:23 +0000 (20:25 +0300)]
tests: Check if BGP conditional advertisement works fine with static routes

If we modify the prefix-list that is used to define the routes to be
advertised, all of them MUST be advertised.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Do not suppress conditional advertisement updates if triggered
Donatas Abraitis [Fri, 20 Oct 2023 08:59:59 +0000 (11:59 +0300)]
bgpd: Do not suppress conditional advertisement updates if triggered

If we have a prefix-list with one entry, and after some time we append a prefix-list
with some more additional entries, conditional advertisement is triggered, and the
old entries are suppressed (because they look identical as sent before).

Hence, the old entries are sent as withdrawals and only new entries sent as updates.

Force re-sending all BGP updates for conditional advertisement. The same is done
for route-refresh, and/or soft clear operations.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agodoc: Add a new command to resend dynamic capabilities 14540/head
Donatas Abraitis [Fri, 6 Oct 2023 14:56:36 +0000 (17:56 +0300)]
doc: Add a new command to resend dynamic capabilities

For now it includes only FQDN capability, because other capabilities can be
resend using specific knobs.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Add `clear bgp capabilities` command to resend some dynamic capabilities
Donatas Abraitis [Fri, 6 Oct 2023 14:41:18 +0000 (17:41 +0300)]
bgpd: Add `clear bgp capabilities` command to resend some dynamic capabilities

For instance, it's not possible to resend FQDN capability without resetting
the session, so let's create some more elegant way to do that.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agobgpd: Handle FQDN capability using dynamic capabilities
Donatas Abraitis [Fri, 29 Sep 2023 07:21:34 +0000 (10:21 +0300)]
bgpd: Handle FQDN capability using dynamic capabilities

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14614 from opensourcerouting/feature/bgpd_handle_orf_capability_v...
Donald Sharp [Thu, 19 Oct 2023 20:01:24 +0000 (16:01 -0400)]
Merge pull request #14614 from opensourcerouting/feature/bgpd_handle_orf_capability_via_dynamic_capability

bgpd: Handle ORF capability using dynamic capabilities

18 months agoMerge pull request #14618 from donaldsharp/watchfrr_extend
Donatas Abraitis [Thu, 19 Oct 2023 15:48:37 +0000 (18:48 +0300)]
Merge pull request #14618 from donaldsharp/watchfrr_extend

watchfrr: Extend ignore option to daemon being killed

18 months agoMerge pull request #14615 from opensourcerouting/fix/rename_test_function_for_bgp_dyn...
Donald Sharp [Thu, 19 Oct 2023 12:15:15 +0000 (08:15 -0400)]
Merge pull request #14615 from opensourcerouting/fix/rename_test_function_for_bgp_dynamic_capability

tests: Rename test_bgp_dynamic_capability_role

18 months agoMerge pull request #14616 from subsecond/patch-5
Donald Sharp [Thu, 19 Oct 2023 12:14:53 +0000 (08:14 -0400)]
Merge pull request #14616 from subsecond/patch-5

doc: add "enforce-first-as" to BGP documentation

18 months agowatchfrr: Extend ignore option to daemon being killed 14618/head
Donald Sharp [Wed, 18 Oct 2023 18:30:03 +0000 (14:30 -0400)]
watchfrr: Extend ignore option to daemon being killed

When testing GR features, it is desired to kill bgp
(or really any daemon )and not immediately have bgp start up again.
Modify the code to not attempt to restart the daemon
by hand to let us developers work when the `watchfrr ignore XXX`
command is issued.

Testing:
watchfrr ignore bgpd
kill -9 bgpd
start bgp by `/usr/lib/frr/watchfrr.sh start bgpd` at some point in time
in the future

leaf-1# show watchfrr
watchfrr global phase: Idle
 Restart Command: "/usr/lib/frr/watchfrr.sh restart %s"
 Start Command: "/usr/lib/frr/watchfrr.sh start %s"
 Stop Command: "/usr/lib/frr/watchfrr.sh stop %s"
 Min Restart Interval: 60
 Max Restart Interval: 600
 Restart Timeout: 90
  zebra                Up
  bgpd                 Up/Ignoring Timeout
  staticd              Up
leaf-1#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agodoc: add "enforce-first-as" to BGP doc 14616/head
Manuel Schweizer [Wed, 18 Oct 2023 15:11:22 +0000 (17:11 +0200)]
doc: add "enforce-first-as" to BGP doc

With the deprecation of the global "bgp enforce-first-as" command back
in https://github.com/FRRouting/frr/pull/2259 the newly introduced
option to enable that setting on a specific peer was not documented.

This commit adds the necessary documentation and states the command's
default.

Signed-off-by: Manuel Schweizer <manuel.schweizer@cloudscale.ch>
18 months agobgpd: Handle ORF capability using dynamic capabilities 14614/head
Donatas Abraitis [Tue, 17 Oct 2023 13:01:33 +0000 (16:01 +0300)]
bgpd: Handle ORF capability using dynamic capabilities

Add an ability to enable/disable ORF capability dynamically without tearing
down the session.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Rename test_bgp_dynamic_capability_role 14615/head
Donatas Abraitis [Wed, 18 Oct 2023 09:31:22 +0000 (12:31 +0300)]
tests: Rename test_bgp_dynamic_capability_role

Was copied, but forgot to rename accordingly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14607 from mobash-rasool/fixes2
Donatas Abraitis [Tue, 17 Oct 2023 14:34:11 +0000 (17:34 +0300)]
Merge pull request #14607 from mobash-rasool/fixes2

pim6d: valgrind issue fixes

18 months agobgpd: Reuse orf_type_str/orf_mode_str for dynamic capabilities code
Donatas Abraitis [Tue, 17 Oct 2023 13:01:00 +0000 (16:01 +0300)]
bgpd: Reuse orf_type_str/orf_mode_str for dynamic capabilities code

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agotests: Check if ORF capability works with BGP dynamic capabilities
Donatas Abraitis [Tue, 17 Oct 2023 13:00:00 +0000 (16:00 +0300)]
tests: Check if ORF capability works with BGP dynamic capabilities

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agomgmtd, lib: remove batch ids from cfg apply reply 14609/head
Igor Ryzhov [Tue, 17 Oct 2023 12:02:57 +0000 (15:02 +0300)]
mgmtd, lib: remove batch ids from cfg apply reply

The config is always applied fully, all batches are included. There's no
need to pass a list of applied batches as it always contains all of
them.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
18 months agopim6d: valgrind issue fixes 14607/head
Mobashshera Rasool [Tue, 17 Oct 2023 04:40:05 +0000 (21:40 -0700)]
pim6d: valgrind issue fixes

Problem Statement:
===================
Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s)
at 0x4975157: sendmsg (sendmsg.c:28)
==2263111==    by 0x1413BE: pim_msg_send_frame (pim_pim.c:629)
==2263111==    by 0x1413BE: pim_msg_send (pim_pim.c:743)
==2263111==    by 0x1425DC: pim_register_send (pim_register.c:332)
==2263111==    by 0x1427EE: pim_null_register_send (pim_register.c:443)
==2263111==    by 0x14D228: pim_upstream_register_stop_timer (pim_upstream.c:1608)
==2263111==    by 0x48CE6DF: thread_call (thread.c:1693)
==2263111==    by 0x4899EFF: frr_run (libfrr.c:1068)
==2263111==    by 0x11D035: main (pim6_main.c:190)
==2263111==  Address 0x1ffeffdcb1 is on thread 1's stack
==2263111==  in frame #2, created by pim_register_send (pim_register.c:273)
==2263111==  Uninitialised value was created by a stack allocation
==2263111==    at 0x142690: pim_null_register_send (pim_register.c:389)

RCA:
====================
1. All members of struct pim_msg_header were not initiliased while sending
null register packet. Therefore when the pointers are assigned while
sending the msg via sendmsg, it complains the pointer points to
uninitialised byte.
2. struct ipv6_ph ph was also not initialised.

Fix:
====================
Initialised all the members using memset.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
18 months agoMerge pull request #14599 from opensourcerouting/fix/issue_14419
Donald Sharp [Mon, 16 Oct 2023 14:20:23 +0000 (10:20 -0400)]
Merge pull request #14599 from opensourcerouting/fix/issue_14419

tests: Check if evpn route-map match by route type works

18 months agotests: Check if evpn route-map match by route type works 14599/head
Donatas Abraitis [Sat, 14 Oct 2023 08:45:56 +0000 (11:45 +0300)]
tests: Check if evpn route-map match by route type works

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14585 from donaldsharp/send_capability
Donatas Abraitis [Sat, 14 Oct 2023 17:22:37 +0000 (20:22 +0300)]
Merge pull request #14585 from donaldsharp/send_capability

ldpd: Clarify error situation for different problems

18 months agoMerge pull request #14582 from cloudscale-ch/denis/topotest-for-14488
Donald Sharp [Sat, 14 Oct 2023 13:42:49 +0000 (09:42 -0400)]
Merge pull request #14582 from cloudscale-ch/denis/topotest-for-14488

tests: Add OSPF test for issue 14488

18 months agoMerge pull request #14590 from opensourcerouting/ospf6d-fwd-addr
Donald Sharp [Fri, 13 Oct 2023 20:27:30 +0000 (16:27 -0400)]
Merge pull request #14590 from opensourcerouting/ospf6d-fwd-addr

ospf6d: fix setting of the forwarding address in AS-External LSAs

18 months agoMerge pull request #14553 from donaldsharp/zebra_weighted_ecmp
Donatas Abraitis [Fri, 13 Oct 2023 20:09:18 +0000 (23:09 +0300)]
Merge pull request #14553 from donaldsharp/zebra_weighted_ecmp

Zebra weighted ecmp

18 months agoldpd: Clarify error situation for different problems 14585/head
Donald Sharp [Fri, 13 Oct 2023 11:17:17 +0000 (07:17 -0400)]
ldpd: Clarify error situation for different problems

Clarify the fatal error message recorded when an error situation
happens.  Disambiguating the default case from the TLV_TYPE_DYNAMIC_CAP
case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #14561 from idryzhov/implicit-fallthrough
Donald Sharp [Fri, 13 Oct 2023 15:51:11 +0000 (11:51 -0400)]
Merge pull request #14561 from idryzhov/implicit-fallthrough

build: add -Wimplicit-fallthrough

18 months agoMerge pull request #14584 from pguibert6WIND/lmc_log_display_chunk
Donald Sharp [Fri, 13 Oct 2023 15:49:48 +0000 (11:49 -0400)]
Merge pull request #14584 from pguibert6WIND/lmc_log_display_chunk

zebra: add label chunk range in log when label manager request fails

18 months agoMerge pull request #14583 from ryndia/ecom_dup_fix
Donald Sharp [Fri, 13 Oct 2023 15:47:29 +0000 (11:47 -0400)]
Merge pull request #14583 from ryndia/ecom_dup_fix

bgpd: ecommunity_dup memory leak fix

18 months agoospf6d: fix setting of the forwarding address in AS-External LSAs 14590/head
Renato Westphal [Fri, 13 Oct 2023 13:55:39 +0000 (10:55 -0300)]
ospf6d: fix setting of the forwarding address in AS-External LSAs

When redistributing a local route, ensure the forwarding address field
of AS-External LSAs is only set when the associated nexthop interface
is OSPF-enabled. This is necessary because the OSPF RFC requires that
the AS-External LSA forwarding address should be resolvable using an
intra-area or inter-area path.

Fixes #14462.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
18 months agotests: Add OSPF test for issue 14488 14582/head
Denis Krienbühl [Tue, 10 Oct 2023 20:23:18 +0000 (22:23 +0200)]
tests: Add OSPF test for issue 14488

OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with https://github.com/FRRouting/frr/pull/13340
and the latest master (d2324b7b4a02e9ef6a219578567932addeb7f593).

See https://github.com/FRRouting/frr/issues/14488

Signed-off-by: Denis Krienbühl <denis.krienbuehl@cloudscale.ch>
18 months agoMerge pull request #13340 from leonshaw/fix/rib-del-connected
Donald Sharp [Fri, 13 Oct 2023 12:53:43 +0000 (08:53 -0400)]
Merge pull request #13340 from leonshaw/fix/rib-del-connected

zebra: Fix connected route deletion when multiple entry exists

18 months agozebra: add label chunk range in log when label manager request fails 14584/head
Philippe Guibert [Thu, 12 Oct 2023 15:44:47 +0000 (17:44 +0200)]
zebra: add label chunk range in log when label manager request fails

When the label manager is unable to provide a label chunk to
a routing service, an error message is displayed:

> Oct 11 11:47:27 vsr zebra[163745]: [YMY6E-K9JYD][EC 4043309085] Unable to assign Label Chunk to bgp instance 0

There is missing information on the range that was requested.
Add this information in the log message.

> Oct 11 11:47:27 vsr zebra[163745]: [YMY6E-K9JYD][EC 4043309085] Unable to assign Label Chunk 60 - 60 to bgp instance 0

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agozebra: merge lm_get_chunk_response() function
Philippe Guibert [Fri, 13 Oct 2023 08:20:30 +0000 (10:20 +0200)]
zebra: merge lm_get_chunk_response() function

This function lm_get_chunk_response() is only called
by label_manager_get_chunk(). Let us move the code of
the function in the caller.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
18 months agoMerge pull request #14580 from donaldsharp/chain_ignore
mobash-rasool [Fri, 13 Oct 2023 10:19:31 +0000 (15:49 +0530)]
Merge pull request #14580 from donaldsharp/chain_ignore

Chain ignore

18 months agoMerge pull request #14576 from LabNConsulting/chopps/short-circuit-guarantee
Igor Ryzhov [Fri, 13 Oct 2023 09:13:20 +0000 (12:13 +0300)]
Merge pull request #14576 from LabNConsulting/chopps/short-circuit-guarantee

lib: msg: make short-circuit connections guaranteed

18 months agobgpd: Ecommunity_dup memory leak fix 14583/head
ryndia [Thu, 12 Oct 2023 22:04:30 +0000 (02:04 +0400)]
bgpd: Ecommunity_dup memory leak fix

The shallow copy of attr wasn't freed when there was no valid label for the momentand the function return therefore creating leaks. The leak below are solved by flushing the shallow copy of attr.

Address Sanitizer Error detected in bgp_vpnv6_per_nexthop_label.test_bgp_vpnv6_per_nexthop_label/r1.asan.bgpd.13409
=================================================================
==13409==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88c13b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x5623b89beabc in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x5623b89beabc in af_label_vpn_export_allocation_mode_magic bgpd/bgp_vty.c:9464
    #7 0x5623b89beabc in af_label_vpn_export_allocation_mode bgpd/bgp_vty_clippy.c:2809
    #8 0x7f62cca45511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f62cca459d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f62cca45e54 in cmd_execute lib/command.c:1203
    #11 0x7f62ccb6ee20 in vty_command lib/vty.c:591
    #12 0x7f62ccb6f2cb in vty_execute lib/vty.c:1354
    #13 0x7f62ccb77b95 in vtysh_read lib/vty.c:2362
    #14 0x7f62ccb62b8f in event_call lib/event.c:1969
    #15 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #16 0x5623b87e054b in main bgpd/bgp_main.c:510
    #17 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b892e86d in bgp_update bgpd/bgp_route.c:4969
    #5 0x5623b893134d in bgp_nlri_parse_ip bgpd/bgp_route.c:6213
    #6 0x5623b88e2a0e in bgp_nlri_parse bgpd/bgp_packet.c:341
    #7 0x5623b88e4f7c in bgp_update_receive bgpd/bgp_packet.c:2220
    #8 0x5623b88f0474 in bgp_process_packet bgpd/bgp_packet.c:3386
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88c13b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x5623b89bdebb in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x5623b89bdebb in af_label_vpn_export_magic bgpd/bgp_vty.c:9547
    #7 0x5623b89bdebb in af_label_vpn_export bgpd/bgp_vty_clippy.c:2868
    #8 0x7f62cca45511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f62cca459d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f62cca45e54 in cmd_execute lib/command.c:1203
    #11 0x7f62ccb6ee20 in vty_command lib/vty.c:591
    #12 0x7f62ccb6f2cb in vty_execute lib/vty.c:1354
    #13 0x7f62ccb77b95 in vtysh_read lib/vty.c:2362
    #14 0x7f62ccb62b8f in event_call lib/event.c:1969
    #15 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #16 0x5623b87e054b in main bgpd/bgp_main.c:510
    #17 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 240 byte(s) in 6 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88dc289 in evaluate_paths bgpd/bgp_nht.c:1384
    #5 0x5623b88ddb0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x5623b88de027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x5623b8a03163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 120 byte(s) in 3 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b893a406 in bgp_redistribute_add bgpd/bgp_route.c:8692
    #5 0x5623b8a02b3b in zebra_read_route bgpd/bgp_zebra.c:595
    #6 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #7 0x7f62ccb62b8f in event_call lib/event.c:1969
    #8 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #9 0x5623b87e054b in main bgpd/bgp_main.c:510
    #10 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7f62cd0c9d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f62ccac21c3 in qcalloc lib/memory.c:105
    #2 0x5623b8810dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88dc188 in evaluate_paths bgpd/bgp_nht.c:1348
    #5 0x5623b88ddb0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x5623b88de027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x5623b8a03163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88c13b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x5623b89beabc in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x5623b89beabc in af_label_vpn_export_allocation_mode_magic bgpd/bgp_vty.c:9464
    #7 0x5623b89beabc in af_label_vpn_export_allocation_mode bgpd/bgp_vty_clippy.c:2809
    #8 0x7f62cca45511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f62cca459d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f62cca45e54 in cmd_execute lib/command.c:1203
    #11 0x7f62ccb6ee20 in vty_command lib/vty.c:591
    #12 0x7f62ccb6f2cb in vty_execute lib/vty.c:1354
    #13 0x7f62ccb77b95 in vtysh_read lib/vty.c:2362
    #14 0x7f62ccb62b8f in event_call lib/event.c:1969
    #15 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #16 0x5623b87e054b in main bgpd/bgp_main.c:510
    #17 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b892e86d in bgp_update bgpd/bgp_route.c:4969
    #5 0x5623b893134d in bgp_nlri_parse_ip bgpd/bgp_route.c:6213
    #6 0x5623b88e2a0e in bgp_nlri_parse bgpd/bgp_packet.c:341
    #7 0x5623b88e4f7c in bgp_update_receive bgpd/bgp_packet.c:2220
    #8 0x5623b88f0474 in bgp_process_packet bgpd/bgp_packet.c:3386
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88c13b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x5623b89bdebb in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x5623b89bdebb in af_label_vpn_export_magic bgpd/bgp_vty.c:9547
    #7 0x5623b89bdebb in af_label_vpn_export bgpd/bgp_vty_clippy.c:2868
    #8 0x7f62cca45511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f62cca459d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f62cca45e54 in cmd_execute lib/command.c:1203
    #11 0x7f62ccb6ee20 in vty_command lib/vty.c:591
    #12 0x7f62ccb6f2cb in vty_execute lib/vty.c:1354
    #13 0x7f62ccb77b95 in vtysh_read lib/vty.c:2362
    #14 0x7f62ccb62b8f in event_call lib/event.c:1969
    #15 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #16 0x5623b87e054b in main bgpd/bgp_main.c:510
    #17 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 6 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88dc289 in evaluate_paths bgpd/bgp_nht.c:1384
    #5 0x5623b88ddb0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x5623b88de027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x5623b8a03163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 24 byte(s) in 3 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b893a406 in bgp_redistribute_add bgpd/bgp_route.c:8692
    #5 0x5623b8a02b3b in zebra_read_route bgpd/bgp_zebra.c:595
    #6 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #7 0x7f62ccb62b8f in event_call lib/event.c:1969
    #8 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #9 0x5623b87e054b in main bgpd/bgp_main.c:510
    #10 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x7f62cd0c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f62ccac1ee3 in qmalloc lib/memory.c:100
    #2 0x5623b8810eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x5623b88be8eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x5623b88dc188 in evaluate_paths bgpd/bgp_nht.c:1348
    #5 0x5623b88ddb0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x5623b88de027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x5623b8a03163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f62ccb92d8a in zclient_read lib/zclient.c:4425
    #9 0x7f62ccb62b8f in event_call lib/event.c:1969
    #10 0x7f62ccaa5462 in frr_run lib/libfrr.c:1213
    #11 0x5623b87e054b in main bgpd/bgp_main.c:510
    #12 0x7f62cbae7c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 1536 byte(s) leaked in 64 allocation(s).
***********************************************************************************

Address Sanitizer Error detected in bgp_vpnv4_per_nexthop_label.test_bgp_vpnv4_per_nexthop_label/r1.asan.bgpd.10610

=================================================================
==10610==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9c4686d in bgp_update bgpd/bgp_route.c:4969
    #5 0x55cdc9c4934d in bgp_nlri_parse_ip bgpd/bgp_route.c:6213
    #6 0x55cdc9bfaa0e in bgp_nlri_parse bgpd/bgp_packet.c:341
    #7 0x55cdc9bfcf7c in bgp_update_receive bgpd/bgp_packet.c:2220
    #8 0x55cdc9c08474 in bgp_process_packet bgpd/bgp_packet.c:3386
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9cd6abc in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9cd6abc in af_label_vpn_export_allocation_mode_magic bgpd/bgp_vty.c:9464
    #7 0x55cdc9cd6abc in af_label_vpn_export_allocation_mode bgpd/bgp_vty_clippy.c:2809
    #8 0x7f81fbede511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f81fbede9d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f81fbedee54 in cmd_execute lib/command.c:1203
    #11 0x7f81fc007e20 in vty_command lib/vty.c:591
    #12 0x7f81fc0082cb in vty_execute lib/vty.c:1354
    #13 0x7f81fc010b95 in vtysh_read lib/vty.c:2362
    #14 0x7f81fbffbb8f in event_call lib/event.c:1969
    #15 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #16 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #17 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 280 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9cd5ebb in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9cd5ebb in af_label_vpn_export_magic bgpd/bgp_vty.c:9547
    #7 0x55cdc9cd5ebb in af_label_vpn_export bgpd/bgp_vty_clippy.c:2868
    #8 0x7f81fbede511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f81fbede9d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f81fbedee54 in cmd_execute lib/command.c:1203
    #11 0x7f81fc007e20 in vty_command lib/vty.c:591
    #12 0x7f81fc0082cb in vty_execute lib/vty.c:1354
    #13 0x7f81fc010b95 in vtysh_read lib/vty.c:2362
    #14 0x7f81fbffbb8f in event_call lib/event.c:1969
    #15 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #16 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #17 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 240 byte(s) in 6 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bf4289 in evaluate_paths bgpd/bgp_nht.c:1384
    #5 0x55cdc9bf5b0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x55cdc9bf6027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x55cdc9d1b163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bf4188 in evaluate_paths bgpd/bgp_nht.c:1348
    #5 0x55cdc9bf5b0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x55cdc9bf6027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x55cdc9d1b163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9bdafd5 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9bdafd5 in vpn_leak_label_callback bgpd/bgp_mplsvpn.c:581
    #7 0x55cdc9bb2606 in lp_cbq_docallback bgpd/bgp_labelpool.c:118
    #8 0x7f81fc0164b5 in work_queue_run lib/workqueue.c:266
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7f81fc562d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f81fbf5b1c3 in qcalloc lib/memory.c:105
    #2 0x55cdc9b28dc8 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9c52406 in bgp_redistribute_add bgpd/bgp_route.c:8692
    #5 0x55cdc9d1ab3b in zebra_read_route bgpd/bgp_zebra.c:595
    #6 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #7 0x7f81fbffbb8f in event_call lib/event.c:1969
    #8 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #9 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #10 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9cd6abc in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9cd6abc in af_label_vpn_export_allocation_mode_magic bgpd/bgp_vty.c:9464
    #7 0x55cdc9cd6abc in af_label_vpn_export_allocation_mode bgpd/bgp_vty_clippy.c:2809
    #8 0x7f81fbede511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f81fbede9d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f81fbedee54 in cmd_execute lib/command.c:1203
    #11 0x7f81fc007e20 in vty_command lib/vty.c:591
    #12 0x7f81fc0082cb in vty_execute lib/vty.c:1354
    #13 0x7f81fc010b95 in vtysh_read lib/vty.c:2362
    #14 0x7f81fbffbb8f in event_call lib/event.c:1969
    #15 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #16 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #17 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9cd5ebb in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9cd5ebb in af_label_vpn_export_magic bgpd/bgp_vty.c:9547
    #7 0x55cdc9cd5ebb in af_label_vpn_export bgpd/bgp_vty_clippy.c:2868
    #8 0x7f81fbede511 in cmd_execute_command_real lib/command.c:978
    #9 0x7f81fbede9d5 in cmd_execute_command lib/command.c:1036
    #10 0x7f81fbedee54 in cmd_execute lib/command.c:1203
    #11 0x7f81fc007e20 in vty_command lib/vty.c:591
    #12 0x7f81fc0082cb in vty_execute lib/vty.c:1354
    #13 0x7f81fc010b95 in vtysh_read lib/vty.c:2362
    #14 0x7f81fbffbb8f in event_call lib/event.c:1969
    #15 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #16 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #17 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 56 byte(s) in 7 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9c4686d in bgp_update bgpd/bgp_route.c:4969
    #5 0x55cdc9c4934d in bgp_nlri_parse_ip bgpd/bgp_route.c:6213
    #6 0x55cdc9bfaa0e in bgp_nlri_parse bgpd/bgp_packet.c:341
    #7 0x55cdc9bfcf7c in bgp_update_receive bgpd/bgp_packet.c:2220
    #8 0x55cdc9c08474 in bgp_process_packet bgpd/bgp_packet.c:3386
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 48 byte(s) in 6 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bf4289 in evaluate_paths bgpd/bgp_nht.c:1384
    #5 0x55cdc9bf5b0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x55cdc9bf6027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x55cdc9d1b163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bf4188 in evaluate_paths bgpd/bgp_nht.c:1348
    #5 0x55cdc9bf5b0b in bgp_process_nexthop_update bgpd/bgp_nht.c:733
    #6 0x55cdc9bf6027 in bgp_parse_nexthop_update bgpd/bgp_nht.c:934
    #7 0x55cdc9d1b163 in bgp_read_nexthop_update bgpd/bgp_zebra.c:104
    #8 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9bd93b3 in vpn_leak_from_vrf_update_all bgpd/bgp_mplsvpn.c:2005
    #5 0x55cdc9bdafd5 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:287
    #6 0x55cdc9bdafd5 in vpn_leak_label_callback bgpd/bgp_mplsvpn.c:581
    #7 0x55cdc9bb2606 in lp_cbq_docallback bgpd/bgp_labelpool.c:118
    #8 0x7f81fc0164b5 in work_queue_run lib/workqueue.c:266
    #9 0x7f81fbffbb8f in event_call lib/event.c:1969
    #10 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #11 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #12 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7f81fc562b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f81fbf5aee3 in qmalloc lib/memory.c:100
    #2 0x55cdc9b28eb8 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    #3 0x55cdc9bd68eb in vpn_leak_from_vrf_update bgpd/bgp_mplsvpn.c:1628
    #4 0x55cdc9c52406 in bgp_redistribute_add bgpd/bgp_route.c:8692
    #5 0x55cdc9d1ab3b in zebra_read_route bgpd/bgp_zebra.c:595
    #6 0x7f81fc02bd8a in zclient_read lib/zclient.c:4425
    #7 0x7f81fbffbb8f in event_call lib/event.c:1969
    #8 0x7f81fbf3e462 in frr_run lib/libfrr.c:1213
    #9 0x55cdc9af854b in main bgpd/bgp_main.c:510
    #10 0x7f81faf80c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 1536 byte(s) leaked in 64 allocation(s).
***********************************************************************************

Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
18 months agoMerge pull request #14577 from mjstapp/fix_zebra_nlmsg_unknown
Donald Sharp [Thu, 12 Oct 2023 19:58:22 +0000 (15:58 -0400)]
Merge pull request #14577 from mjstapp/fix_zebra_nlmsg_unknown

zebra: add xxxCHAIN netlink messages to handler, ignore

18 months agoMerge pull request #14578 from opensourcerouting/fix/coverity_1566808
Donald Sharp [Thu, 12 Oct 2023 19:58:08 +0000 (15:58 -0400)]
Merge pull request #14578 from opensourcerouting/fix/coverity_1566808

bgpd: Remove redundant check for bgp against NULL

18 months agomgmtd: clarify the startup dance in comments 14576/head
Christian Hopps [Thu, 12 Oct 2023 18:38:39 +0000 (14:38 -0400)]
mgmtd: clarify the startup dance in comments

Also retry the config read vs. aborting if we haven't got a FE
client connection yet.

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agobuild: add -Wimplicit-fallthrough 14561/head
Igor Ryzhov [Tue, 10 Oct 2023 21:15:32 +0000 (00:15 +0300)]
build: add -Wimplicit-fallthrough

Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
18 months agotests: Fixup bgp_link_bw_ip test to new behavior 14553/head
Donald Sharp [Thu, 12 Oct 2023 16:00:07 +0000 (12:00 -0400)]
tests: Fixup bgp_link_bw_ip test to new behavior

Old behavior was metric values between 1-100,
now we have metric values between 1-255.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agobgpd: Remove unused cumulative bandwidth variable
Donald Sharp [Fri, 29 Sep 2023 19:19:54 +0000 (15:19 -0400)]
bgpd: Remove unused cumulative bandwidth variable

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agobgpd: Just pass down the Bandwidth unmodified so that Zebra can use it
Donald Sharp [Fri, 29 Sep 2023 19:17:14 +0000 (15:17 -0400)]
bgpd: Just pass down the Bandwidth unmodified so that Zebra can use it

Instead of scaling the bandwith to something between 1 and 100, just
send down the bandwidth Available for the link.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agozebra: Make ucmp scale value owned by zrouter
Donald Sharp [Thu, 28 Sep 2023 16:44:31 +0000 (12:44 -0400)]
zebra: Make ucmp scale value owned by zrouter

The weight scale value might be useful to have it
change it's behavior at a later time or controlled
by something depending on how FRR is compiled/ran.
Let's start that process

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agozebra: Score weighted values of ecmp to a number between 1-255
Donald Sharp [Thu, 28 Sep 2023 16:27:31 +0000 (12:27 -0400)]
zebra: Score weighted values of ecmp to a number between 1-255

Currently underlying asics get into a bit of trouble when the
nexthop weight passed down varies wildly between the different
numbers.  Let's normalize the weight values between 1 and 255

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agoMerge pull request #14579 from Keelan10/fix-nhrpd-leak
Donald Sharp [Thu, 12 Oct 2023 14:59:44 +0000 (10:59 -0400)]
Merge pull request #14579 from Keelan10/fix-nhrpd-leak

nhrpd: Fix nhrp_peer leak

18 months agozebra: Cleanup string generation via clang 14580/head
Donald Sharp [Thu, 12 Oct 2023 14:35:01 +0000 (10:35 -0400)]
zebra: Cleanup string generation via clang

Separate commit for clang-format cleanup of string
messages because I felt it would hide the actual
changes being made to the system.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agozebra: Add RTM_XXXCHAIN to string outputs
Donald Sharp [Thu, 12 Oct 2023 14:34:21 +0000 (10:34 -0400)]
zebra: Add RTM_XXXCHAIN to string outputs

Let's get some meaningful string output for when FRR receives
these messages.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
18 months agolib: msg: make short-circuit connections guaranteed
Christian Hopps [Thu, 12 Oct 2023 12:34:20 +0000 (08:34 -0400)]
lib: msg: make short-circuit connections guaranteed

When short circuiting is requested the caller can count on that
being the connection type they get.

Signed-off-by: Christian Hopps <chopps@labn.net>
18 months agonhrpd: Fix nhrp_peer leak 14579/head
Keelan10 [Thu, 12 Oct 2023 14:04:52 +0000 (18:04 +0400)]
nhrpd: Fix nhrp_peer leak

- Addressed memory leak by removing `&c->peer_notifier` from the notifier list on termination. Retaining it caused the notifier list to stay active, preventing the deletion of `c->cur.peer`
  thereby causing a memory leak.

- Reordered termination steps to call `vrf_terminate` before `nhrp_vc_terminate`, preventing a heap-use-after-free issue when `nhrp_vc_notify_del` is invoked in `nhrp_peer_check_delete`.

- Added an if statement to avoid passing NULL as hash to `hash_release`, which leads to a SIGSEGV.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in nhrp_topo.test_nhrp_topo/r1.asan.nhrpd.20265

=================================================================
==20265==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f80270c9b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f8026ac1eb8 in qmalloc lib/memory.c:100
    #2 0x560fd648f0a6 in nhrp_peer_create nhrpd/nhrp_peer.c:175
    #3 0x7f8026a88d3f in hash_get lib/hash.c:147
    #4 0x560fd6490a5d in nhrp_peer_get nhrpd/nhrp_peer.c:228
    #5 0x560fd648a51a in nhrp_nhs_resolve_cb nhrpd/nhrp_nhs.c:297
    #6 0x7f80266b000f in resolver_cb_literal lib/resolver.c:234
    #7 0x7f8026b62e0e in event_call lib/event.c:1969
    #8 0x7f8026aa5437 in frr_run lib/libfrr.c:1213
    #9 0x560fd6488b4f in main nhrpd/nhrp_main.c:166
    #10 0x7f8025eb2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 112 byte(s) leaked in 1 allocation(s).
***********************************************************************************

***********************************************************************************
Address Sanitizer Error detected in nhrp_topo.test_nhrp_topo/r2.asan.nhrpd.20400

=================================================================
==20400==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7fb6e3ca5b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7fb6e369deb8 in qmalloc lib/memory.c:100
    #2 0x562652de40a6 in nhrp_peer_create nhrpd/nhrp_peer.c:175
    #3 0x7fb6e3664d3f in hash_get lib/hash.c:147
    #4 0x562652de5a5d in nhrp_peer_get nhrpd/nhrp_peer.c:228
    #5 0x562652de1e8e in nhrp_packet_recvraw nhrpd/nhrp_packet.c:325
    #6 0x7fb6e373ee0e in event_call lib/event.c:1969
    #7 0x7fb6e3681437 in frr_run lib/libfrr.c:1213
    #8 0x562652dddb4f in main nhrpd/nhrp_main.c:166
    #9 0x7fb6e2a8ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 112 byte(s) leaked in 1 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
18 months agozebra: add RTM_xxxCHAIN message codes, ignore 14577/head
Mark Stapp [Thu, 12 Oct 2023 13:59:44 +0000 (09:59 -0400)]
zebra: add RTM_xxxCHAIN message codes, ignore

We may receive some xxxCHAIN netlink messages, but we ignore
them (currently). Add them to the basic handler callback so
that we don't log errors about them.

Signed-off-by: Mark Stapp <mjs@labn.net>
18 months agobgpd: Remove redundant check for bgp against NULL 14578/head
Donatas Abraitis [Thu, 12 Oct 2023 13:36:45 +0000 (16:36 +0300)]
bgpd: Remove redundant check for bgp against NULL

bgp_orig is never NULL in the code path, and coverity is angry on this.

Let's remove this test at all.

Coverity 1566808

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14559 from opensourcerouting/feature/update_dev_versions_for_packages
Donald Sharp [Wed, 11 Oct 2023 15:34:57 +0000 (11:34 -0400)]
Merge pull request #14559 from opensourcerouting/feature/update_dev_versions_for_packages

packaging: Increase development version for debian/redhat stuff

18 months agoMerge pull request #14564 from opensourcerouting/fix/mgmtd_vty_port
Donald Sharp [Wed, 11 Oct 2023 15:33:50 +0000 (11:33 -0400)]
Merge pull request #14564 from opensourcerouting/fix/mgmtd_vty_port

mgmtd: Change MGMTD_VTY_PORT to 2623

18 months agoMerge pull request #14537 from opensourcerouting/feature/bgpd_aod
Russ White [Wed, 11 Oct 2023 14:22:26 +0000 (10:22 -0400)]
Merge pull request #14537 from opensourcerouting/feature/bgpd_aod

bgpd: Implement EBGP-OAD peering type

18 months agoMerge pull request #14557 from volodymyrhuti/EIGRP_IF_DELETE_CRASH
Russ White [Wed, 11 Oct 2023 14:17:54 +0000 (10:17 -0400)]
Merge pull request #14557 from volodymyrhuti/EIGRP_IF_DELETE_CRASH

eigrp: use correct memory pool on interface deletion

18 months agoMerge pull request #14528 from opensourcerouting/feature/bgpd_handle_addpath_capabili...
Russ White [Wed, 11 Oct 2023 14:16:18 +0000 (10:16 -0400)]
Merge pull request #14528 from opensourcerouting/feature/bgpd_handle_addpath_capability_via_dynamic_capability

bgpd: Handle Addpath capability using dynamic capabilities

18 months agoMerge pull request #14437 from opensourcerouting/issue/14004
Mark Stapp [Wed, 11 Oct 2023 11:23:41 +0000 (07:23 -0400)]
Merge pull request #14437 from opensourcerouting/issue/14004

vtysh freezed on ospf 'no network' command when there are multiple networks and interfaces

18 months agoMerge pull request #14563 from opensourcerouting/fix/cpuwarning_starvation
Donald Sharp [Wed, 11 Oct 2023 11:21:43 +0000 (07:21 -0400)]
Merge pull request #14563 from opensourcerouting/fix/cpuwarning_starvation

lib: Suppress HOB/STARVATION warnings when running in vtysh

18 months agoMerge pull request #14554 from donaldsharp/bgp_fifo
Donatas Abraitis [Wed, 11 Oct 2023 10:31:04 +0000 (13:31 +0300)]
Merge pull request #14554 from donaldsharp/bgp_fifo

bgpd: Convert the bgp_advertise_attr->adv to a fifo

18 months agomgmtd: Change MGMTD_VTY_PORT to 2623 14564/head
Donatas Abraitis [Wed, 11 Oct 2023 10:27:28 +0000 (13:27 +0300)]
mgmtd: Change MGMTD_VTY_PORT to 2623

This is clashing with PIMv6 (2622).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agolib: Suppress HOB/STARVATION warnings when running in vtysh 14563/head
Donatas Abraitis [Mon, 9 Oct 2023 09:03:50 +0000 (12:03 +0300)]
lib: Suppress HOB/STARVATION warnings when running in vtysh

Running ping/traceroute/etc. (any kind of commands that use execute_command()
suffer with this kind of warnings.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoMerge pull request #14560 from donaldsharp/linkstate_reversal
Donatas Abraitis [Wed, 11 Oct 2023 05:01:46 +0000 (08:01 +0300)]
Merge pull request #14560 from donaldsharp/linkstate_reversal

Linkstate reversal

18 months agodebian: Increase version for development version to be 9.2 14559/head
Donatas Abraitis [Tue, 10 Oct 2023 16:53:50 +0000 (19:53 +0300)]
debian: Increase version for development version to be 9.2

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoredhat: Update frr.spec file with older releases and increase current version
Donatas Abraitis [Tue, 10 Oct 2023 16:50:10 +0000 (19:50 +0300)]
redhat: Update frr.spec file with older releases and increase current version

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
18 months agoRevert "lib: register bgp link-state afi/safi" 14560/head
Donald Sharp [Tue, 10 Oct 2023 20:45:57 +0000 (16:45 -0400)]
Revert "lib: register bgp link-state afi/safi"

This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3.