]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
21 months agoMerge pull request #13937 from donaldsharp/ospf6_lsa_unlock_fix
mobash-rasool [Thu, 13 Jul 2023 03:42:37 +0000 (09:12 +0530)]
Merge pull request #13937 from donaldsharp/ospf6_lsa_unlock_fix

ospf6d: Convert ospf6_lsa_unlock to a better api

21 months agoospf6d: Convert ospf6_lsa_unlock to a better api
Donald Sharp [Wed, 5 Jul 2023 13:28:50 +0000 (09:28 -0400)]
ospf6d: Convert ospf6_lsa_unlock to a better api

Make the ospf6_lsa_unlock take the same parameters
that the ospf_lsa_unlock does to make it consistent
and to also ensure that no-one can make the mistake
of getting the pointer cleared up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #13891 from opensourcerouting/fix/ignore_errors_from_frr-reload.py
Donald Sharp [Wed, 12 Jul 2023 19:11:58 +0000 (15:11 -0400)]
Merge pull request #13891 from opensourcerouting/fix/ignore_errors_from_frr-reload.py

tools: Ignore errors for frr reload stuff

21 months agoMerge pull request #13977 from anlancs/fix/mgmt-bool-change
Donald Sharp [Wed, 12 Jul 2023 18:45:58 +0000 (14:45 -0400)]
Merge pull request #13977 from anlancs/fix/mgmt-bool-change

mgmtd: adjust one unnecessary bool convert

21 months agoMerge pull request #13983 from WiMoVE-OSS/bgpd-memory-leak-table-stats-single
Donald Sharp [Wed, 12 Jul 2023 18:45:09 +0000 (14:45 -0400)]
Merge pull request #13983 from WiMoVE-OSS/bgpd-memory-leak-table-stats-single

bgpd: Fix memory leak by moving allocation of json object

21 months agomgmtd: adjust one unnecessary bool convert
anlan_cs [Mon, 10 Jul 2023 05:36:24 +0000 (13:36 +0800)]
mgmtd: adjust one unnecessary bool convert

It is unnecessary to do the bool calculation for expression.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agoMerge pull request #13968 from zhengxiang311019/patch-1
Donald Sharp [Tue, 11 Jul 2023 16:25:40 +0000 (12:25 -0400)]
Merge pull request #13968 from zhengxiang311019/patch-1

doc: fix the error path.

21 months agoMerge pull request #13963 from chiragshah6/fdev4
Russ White [Tue, 11 Jul 2023 15:52:02 +0000 (11:52 -0400)]
Merge pull request #13963 from chiragshah6/fdev4

tools: fix ospf area stub summary in frr-reload

21 months agoMerge pull request #13885 from donaldsharp/tests_need_to_be_stricter
Russ White [Tue, 11 Jul 2023 15:49:38 +0000 (11:49 -0400)]
Merge pull request #13885 from donaldsharp/tests_need_to_be_stricter

Tests need to be stricter

21 months agoMerge pull request #13876 from LabNConsulting/mjs/nhrp_resolving
Russ White [Tue, 11 Jul 2023 15:48:16 +0000 (11:48 -0400)]
Merge pull request #13876 from LabNConsulting/mjs/nhrp_resolving

Allow NHRP routes to validate incoming nexthops

21 months agoMerge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable
Russ White [Tue, 11 Jul 2023 15:47:32 +0000 (11:47 -0400)]
Merge pull request #13691 from LabNConsulting/aceelindem/ospf-opaque-interface-disable

ospfd: Configurable interface-level 'capability opaque' support

21 months agoMerge pull request #13958 from opensourcerouting/fix/coverity
Donald Sharp [Tue, 11 Jul 2023 15:26:47 +0000 (11:26 -0400)]
Merge pull request #13958 from opensourcerouting/fix/coverity

Coverity fixes

21 months agoMerge pull request #13880 from mjstapp/fix_ospf_intf_socket
Russ White [Tue, 11 Jul 2023 14:23:37 +0000 (10:23 -0400)]
Merge pull request #13880 from mjstapp/fix_ospf_intf_socket

ospfd: fix per-interface sockets

21 months agoMerge pull request #13936 from ryndia/fix_ospf_lsa_leak
Russ White [Tue, 11 Jul 2023 14:22:22 +0000 (10:22 -0400)]
Merge pull request #13936 from ryndia/fix_ospf_lsa_leak

ospfd: fix lsa leak

21 months agobgpd: Fix memory leak by moving allocation of json object
Alexander Sohn [Tue, 11 Jul 2023 14:21:57 +0000 (16:21 +0200)]
bgpd: Fix memory leak by moving allocation of json object

Signed-off-by: Alexander Sohn <github@asohn.de>
21 months agoMerge pull request #13947 from opensourcerouting/feature/bgpd_show_version_if_descrip...
Russ White [Tue, 11 Jul 2023 14:20:04 +0000 (10:20 -0400)]
Merge pull request #13947 from opensourcerouting/feature/bgpd_show_version_if_description_is_not_defined

bgpd: Show neighbors software version if description is not set

21 months agoMerge pull request #13948 from opensourcerouting/fix/bgpd_rfc7606_adjustments
Russ White [Tue, 11 Jul 2023 14:19:30 +0000 (10:19 -0400)]
Merge pull request #13948 from opensourcerouting/fix/bgpd_rfc7606_adjustments

bgpd: Some rfc7606 adjustments

21 months agoMerge pull request #13955 from opensourcerouting/fix/deprecate_orf_bgpd_130
Russ White [Tue, 11 Jul 2023 14:18:19 +0000 (10:18 -0400)]
Merge pull request #13955 from opensourcerouting/fix/deprecate_orf_bgpd_130

bgpd: Deprecate Prestandard Outbound Route Filtering capability

21 months agoMerge pull request #13956 from chiragshah6/fdev2
Russ White [Tue, 11 Jul 2023 14:16:55 +0000 (10:16 -0400)]
Merge pull request #13956 from chiragshah6/fdev2

bgpd: fix evpn zclient_send_messge return code

21 months agoMerge pull request #13964 from pguibert6WIND/mpls_again
Russ White [Tue, 11 Jul 2023 14:12:04 +0000 (10:12 -0400)]
Merge pull request #13964 from pguibert6WIND/mpls_again

zebra: fix mpls config on ifaces created post frr

21 months agoMerge pull request #13970 from ton31337/fix/bgpd_tunnel_encap_attr
Russ White [Tue, 11 Jul 2023 14:09:25 +0000 (10:09 -0400)]
Merge pull request #13970 from ton31337/fix/bgpd_tunnel_encap_attr

bgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)

21 months agoMerge pull request #13971 from opensourcerouting/fix-bgp-delayopen-expire-test
Russ White [Tue, 11 Jul 2023 14:09:01 +0000 (10:09 -0400)]
Merge pull request #13971 from opensourcerouting/fix-bgp-delayopen-expire-test

tests: fix BGP delayopen timer expiration test

21 months agoMerge pull request #13975 from mjstapp/fix_isis_gmtime
Russ White [Tue, 11 Jul 2023 14:05:43 +0000 (10:05 -0400)]
Merge pull request #13975 from mjstapp/fix_isis_gmtime

isisd: replace gmtime with gmtime_r

21 months agoMerge pull request #13976 from anlancs/fix/cleanup-23
Donatas Abraitis [Tue, 11 Jul 2023 10:21:09 +0000 (13:21 +0300)]
Merge pull request #13976 from anlancs/fix/cleanup-23

zebra: adjust one debug info

21 months agoMerge pull request #13972 from donaldsharp/bgp_sync_issue
Donatas Abraitis [Tue, 11 Jul 2023 09:53:44 +0000 (12:53 +0300)]
Merge pull request #13972 from donaldsharp/bgp_sync_issue

bgpd: Fix table manager to use the synchronous client

21 months agoMerge pull request #13715 from patrasar/pim_nexthop
Donatas Abraitis [Tue, 11 Jul 2023 08:25:18 +0000 (11:25 +0300)]
Merge pull request #13715 from patrasar/pim_nexthop

pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli

21 months agozebra: adjust one debug info
anlan_cs [Mon, 10 Jul 2023 13:42:14 +0000 (21:42 +0800)]
zebra: adjust one debug info

Adjust one debug info, separate the ip address from it. Just like it is processed
in `redistribute_update()`.

Before:
```
34:1375.75.75.75/32: Redist del: re 0x55c1112067e0 (0:static), new re 0x55c1112de7c0 (0:static)
```

After:
```
(34:13):75.75.75.75/32: Redist del: re 0x55c1112067e0 (0:static), new re 0x55c1112de7c0 (0:static)
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
21 months agodoc: fix the error path
xzheng [Mon, 10 Jul 2023 09:32:45 +0000 (17:32 +0800)]
doc: fix the error path

fix the error path.

Signed-off-by: xzheng <zhengxiang311019@163.com>
21 months agoisisd: replace gmtime with gmtime_r
Mark Stapp [Mon, 10 Jul 2023 21:06:17 +0000 (17:06 -0400)]
isisd: replace gmtime with gmtime_r

No gmtime() allowed - use gmtime_r()

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agotests: add route-install test using NHRP tunnel
Mark Stapp [Wed, 28 Jun 2023 19:33:57 +0000 (15:33 -0400)]
tests: add route-install test using NHRP tunnel

Add a test-case to the NHRP test that installs routes over the
NHRP tunnel endpoint routes. This confirms that zebra will use
NHRP routes when validating incoming routes from other daemons
(sharpd in this test).

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agosharpd: allow sharpd to install non-recursive routes
Mark Stapp [Wed, 28 Jun 2023 19:31:23 +0000 (15:31 -0400)]
sharpd: allow sharpd to install non-recursive routes

Add a config option so that sharpd can install routes without
the ALLOW_RECURSION flag, matching IGP behavior.
The default remains 'recursion'.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agozebra: use NHRP routes as valid in nexthop check
Mark Stapp [Wed, 28 Jun 2023 12:11:41 +0000 (08:11 -0400)]
zebra: use NHRP routes as valid in nexthop check

Treat NHRP-installed routes as valid, as if they were
CONNECTED routes, when checking candidate routes'
nexthops for validity. This allows use of NHRP by an
IGP, for example, that doesn't normally want recursive
nexthop resolution.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agonhrpd: clean up locals in route zapi api
Mark Stapp [Wed, 28 Jun 2023 12:10:40 +0000 (08:10 -0400)]
nhrpd: clean up locals in route zapi api

Clean up use of a nexthop pointer - seemed inconsistent.

Signed-off-by: Mark Stapp <mjs@labn.net>
21 months agozebra: Guard printing an error by checking if VRF is not NULL
Donatas Abraitis [Sat, 8 Jul 2023 08:26:03 +0000 (11:26 +0300)]
zebra: Guard printing an error by checking if VRF is not NULL

Check if vrf_lookup_by_id() didn't return a NULL before dereferencing in
flor_err().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Check if ifp is not NULL in zebra_if_update_ctx()
Donatas Abraitis [Sat, 8 Jul 2023 08:23:51 +0000 (11:23 +0300)]
zebra: Check if ifp is not NULL in zebra_if_update_ctx()

Use the same logic as zebra_if_netconf_update_ctx().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Do not check ifp for NULL
Donatas Abraitis [Sat, 8 Jul 2023 08:20:14 +0000 (11:20 +0300)]
zebra: Do not check ifp for NULL

It's already checked at the bottom of the function.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Fix table manager to use the synchronous client
Donald Sharp [Mon, 10 Jul 2023 14:40:38 +0000 (10:40 -0400)]
bgpd: Fix table manager to use the synchronous client

bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient.  Which of course still had
us exposing the global zclient to read and drop important
data from zebra.  This fixes commit 787c61e03c760ffdb422bfc44c72d83fb451e0c8

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Fix table manager to use the synchronous client
Donald Sharp [Mon, 10 Jul 2023 14:40:38 +0000 (10:40 -0400)]
bgpd: Fix table manager to use the synchronous client

bgp_zebra_tm_connect calls bgp_zebra_get_table_range which
just used the global zclient.  Which of course still had
us exposing the global zclient to read and drop important
data from zebra.  This fixes commit 787c61e03c760ffdb422bfc44c72d83fb451e0c8

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: fix BGP delayopen timer expiration test
David Schweizer [Mon, 10 Jul 2023 13:46:05 +0000 (15:46 +0200)]
tests: fix BGP delayopen timer expiration test

The changes allow the test to correctly pass in case the connection
between two peers is be established in less than 0.5 seconds after the
delayopen timer expires.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
21 months agozebra: Lookup up nlsock * one time in call tree
Donald Sharp [Mon, 3 Jul 2023 20:49:34 +0000 (16:49 -0400)]
zebra: Lookup up nlsock * one time in call tree

Code is looking up the nlsock to generate the batch messages
and then looking it up again to get the response.  Let's
just look it up one time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: bgp_flowspec expand timings
Donald Sharp [Mon, 3 Jul 2023 20:12:16 +0000 (16:12 -0400)]
tests: bgp_flowspec expand timings

Attempt to set the hold time in the bgp flowspec exabgp
config.  In addition it was noticed that upstream bgp_flowspec
tests are still not negotiating peering within the time frame
specified.  This is because the first tcp packet is missed
and no keepalive/hold time are negotiated and exabgp will
not attempt a reconnect for quite some time.  Make this
test slower when things go south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: Fix wrong config line in bgp_l3vpn_to_bgp_vrf
Donald Sharp [Mon, 3 Jul 2023 12:18:00 +0000 (08:18 -0400)]
tests: Fix wrong config line in bgp_l3vpn_to_bgp_vrf

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: isis_tilfa_topo1 fails sometimes due to insufficient time
Donald Sharp [Sat, 1 Jul 2023 17:30:12 +0000 (13:30 -0400)]
tests: isis_tilfa_topo1 fails sometimes due to insufficient time

The isis_tilfa_topo1 test is failing because insufficient time was
given for isis to converge on the system under system load.  Extend
the time and decrease the hello-interval timers to give it more
of a chance to converge.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: bgp_vpnv4_per_nexthop_label is failing
Donald Sharp [Sat, 1 Jul 2023 17:29:27 +0000 (13:29 -0400)]
tests: bgp_vpnv4_per_nexthop_label is failing

The test is failing because it assumes a json key
is always present when it is not.  Test for it
before having the test fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: zebra_rib route-map run times fixup
Donald Sharp [Sat, 1 Jul 2023 17:27:52 +0000 (13:27 -0400)]
tests: zebra_rib route-map run times fixup

I have a local test run where the sharp route-map usage
was being checked for 5 seconds.  I saw usages going up
for each 1 second check and the 5th one was at 497 out
of 500.  Looks like the system was really loaded.  Let's
give it more time to coalesce under heavy load.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: Do not remove core files
Donald Sharp [Sat, 1 Jul 2023 15:26:37 +0000 (11:26 -0400)]
tests: Do not remove core files

Tests are removing core files and we are missing some
of them because of this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: If a core file is generated fail the test
Donald Sharp [Thu, 29 Jun 2023 19:43:47 +0000 (15:43 -0400)]
tests: If a core file is generated fail the test

If a .dmp file is found in the test log directories
fail the test.

Issue: #13788
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: Look for zlog_backtrace in ci system
Donald Sharp [Thu, 29 Jun 2023 19:12:57 +0000 (15:12 -0400)]
tests: Look for zlog_backtrace in ci system

There are parts of our daemons that upon certain types
of errors that a zlog_backtrace is auto-generated.
It is desirable for this to be caught and have the
test auto-failed.

Issue: #13787
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #13962 from opensourcerouting/fix/ignore_tests/lib/test_darr
Donald Sharp [Mon, 10 Jul 2023 13:06:29 +0000 (09:06 -0400)]
Merge pull request #13962 from opensourcerouting/fix/ignore_tests/lib/test_darr

tests: Ignore test_darr for git

21 months agobgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)
Donatas Abraitis [Mon, 10 Jul 2023 11:40:24 +0000 (14:40 +0300)]
bgpd: Get 1 or 2 octets for Sub-TLV length (Tunnel Encap attr)

The total number of octets of the Sub-TLV Value field. The Sub-TLV Length field
contains 1 octet if the Sub-TLV Type field contains a value in the range from
0-127. The Sub-TLV Length field contains two octets if the Sub-TLV Type field
contains a value in the range from 128-255.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agopimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli
Sarita Patra [Wed, 7 Jun 2023 11:10:52 +0000 (04:10 -0700)]
pimd, pim6d: Added pimEnabled field in "show ip pim nexthop json" cli

The cli "show ip pim nexthop json" gives the RPF information.
However it doesn't give PIM enable status on the nexthop interface.

Added pimEnabled field in this clis,
this will tell if PIM is enabled or not on the nexthop interface.

Example:

frr# show ip pim nexthop
Number of registered addresses: 1
 Address    Interface  Nexthop
 108.0.0.2  ens224     108.0.0.2

frr# show ip pim nexthop json
{
  "108.0.0.2":{
    "address":"108.0.0.2",
    "nexthops":[
      {
        "interface":"ens224",
        "pimEnabled":true,
        "nexthop":"108.0.0.2"
      }
    ]
  }
}

frr# configure terminal
frr(config)# int ens224
frr(config-if)# no ip pim
frr(config-if)# end

frr# show ip pim nexthop json
{
  "108.0.0.2":{
    "address":"108.0.0.2",
    "nexthops":[
      {
        "interface":"ens224",
        "pimEnabled":false,
        "nexthop":"108.0.0.2"
      }
    ]
  }
}

Signed-off-by: Sarita Patra <saritap@vmware.com>
21 months agozebra: fix mpls config on ifaces created post frr
Philippe Guibert [Sun, 9 Jul 2023 19:45:51 +0000 (21:45 +0200)]
zebra: fix mpls config on ifaces created post frr

The mpls configuration does not work when an interface is
created after having applied the frr configuration. The
below scenario illustrates:

> root@dut:~# modprobe mpls
> root@dut:~# zebra &
> [..]
> dut(config)# interface ifacenotcreated
> dut(config-if)# mpls enable
> dut(config-if)# Ctrl-D
> root@dut:~# ip li show ifacenotcreated
> Device "ifacenotcreated" does not exist.
> root@dut:~# ip li add ifacenotcreated type dummy
> 0

Fix this by forcing the mpls flag when the interface is detected.

> root@dut:~# cat /proc/sys/net/mpls/conf/ifacenotcreat/input
> 1

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
21 months agotools: fix ospf area stub summary in frr-reload
Chirag Shah [Sat, 8 Jul 2023 20:17:12 +0000 (13:17 -0700)]
tools: fix ospf area stub summary in frr-reload

OSPFv2 no area x stub no-summary only resets
'no-summary' config. From frr-reload if the config
line 'area x stub no-summary' is removed then
it needs to remove completely. Before this change
it took two frr-roload to remove the config which is
inconsistent behavior.
Fix is to frr-reload to add extra line to delete
'no area x stub'.

Ticket:#3514775
Testing Done:

Running config:

router ospf
 ospf router-id 6.6.6.6
 area 0.0.0.1 stub no-summary
 area 0.0.0.2 stub
exit
!
router ospf vrf sym_1
 area 0.0.1.1 range 24.1.1.0/24
 area 0.0.1.2 stub no-summary
exit

changed frr.conf:
router ospf
 ospf router-id 6.6.6.6
 area 0.0.0.2 stub
exit
!
router ospf vrf sym_1
 area 0.0.1.1 range 24.1.1.0/24
exit

Lines To Delete
===============
router ospf
 no area 0.0.0.1 stub  <<<< newly added
router ospf vrf sym_1
 no area 0.0.1.2 stub  <<<< newly added
router ospf
 no area 0.0.0.1 stub no-summary
router ospf vrf sym_1
 no area 0.0.1.2 stub no-summary

After fix new running-config post reload:
i
router ospf
 ospf router-id 6.6.6.6
 area 0.0.0.2 stub
exit
!
router ospf vrf sym_1
 area 0.0.1.1 range 24.1.1.0/24
exit

Before fix running-config post 1st reload:

router ospf
 ospf router-id 6.6.6.6
 area 0.0.0.1 stub
 area 0.0.0.2 stub
exit
!
router ospf vrf sym_1
 area 0.0.1.1 range 24.1.1.0/24
 area 0.0.1.2 stub
exit

Signed-off-by: Chirag Shah <chirag@nvidia.com>
21 months agotests: Ignore test_darr for git
Donatas Abraitis [Sat, 8 Jul 2023 19:41:34 +0000 (22:41 +0300)]
tests: Ignore test_darr for git

This file is generated after `make check`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: fix evpn zclient_send_message return code
Chirag Shah [Sat, 8 Jul 2023 01:19:54 +0000 (18:19 -0700)]
bgpd: fix evpn zclient_send_message return code

In scaled EVPN route sync from bgp to zebra, return
code can be ZCLIENT_SEND_BUFFERED which was treated
as error and leads to route install/uninstall failure.

Following error logs were seen:
2023-07-07T17:05:59.640899+03:00 vtep12 bgpd[15305]: [WYBZ0-MM8F1][EC
33554471] 0: Failed to uninstall EVPN IMET route in VNI 478
2023-07-07T17:05:59.640913+03:00 vtep12 bgpd[15305]: [Y5VKN-9BV7H][EC
33554471] default (0): Failed to uninstall EVPN [3]:[0]:[32]:[27.0.0.5]
route from VNI 465 IP table
2023-07-07T17:05:59.640927+03:00 vtep12 bgpd[15305]: [WYBZ0-MM8F1][EC
33554471] 0: Failed to uninstall EVPN IMET route in VNI 465
2023-07-07T17:05:59.640940+03:00 vtep12 bgpd[15305]: [Y5VKN-9BV7H][EC
33554471] default (0): Failed to uninstall EVPN [3]:[0]:[32]:[27.0.0.5]
route from VNI 173 IP table

Ticket:#3499957
Testing Done:

Before fix:

root@vtep12:mgmt:/home/cumulus# bridge -d -s fdb show | grep  27.0.0.5 |
wc -l
16010

Once source VTEP withdraws, DUT VTEP still has stale entries
root@vtep12:mgmt:~# bridge -d -s fdb show | grep  27.0.0.5 | wc -l
12990

After fix:

Once source VTEP withdraws, DUT VTEP still is able to delete entries
root@vtep12:mgmt:/home/cumulus# bridge -d -s fdb show | grep  27.0.0.5 |
wc -l
0

Zapi stats:

Client: bgp
[32/133]
------------------------
FD: 76
Connect Time: 00:26:17
Nexthop Registry Time: 00:26:11
Nexthop Last Update Time: 00:23:31
Client will Not be notified about it's routes status
Last Msg Rx Time: 00:21:33
Last Msg Tx Time: 00:23:31
Last Rcvd Cmd: ZEBRA_REMOTE_MACIP_ADD
Last Sent Cmd: ZEBRA_NEXTHOP_UPDATE

Type        Add         Update      Del
==================================================
IPv4        7           0           1
IPv6        0           0           0
Redist:v4   22          0           0
Redist:v6   0           0           0
VRF         2           0           0
Connected   4170        0           0
Interface   9           0           4
Intf Addr   2166        0           0
BFD peer    0           0           0
NHT v4      2           0           1
NHT v6      4           0           0
VxLAN SG    0           0           0
VNI         1010        0           0
L3-VNI      0           0           0
MAC-IP      46010       0           0
ES          2024        0           0
ES-EVI      0           0           0
Errors: 0

Signed-off-by: Chirag Shah <chirag@nvidai.com>
21 months agobgpd: Deprecate Prestandard Outbound Route Filtering capability
Donatas Abraitis [Fri, 7 Jul 2023 20:39:44 +0000 (23:39 +0300)]
bgpd: Deprecate Prestandard Outbound Route Filtering capability

https://www.rfc-editor.org/rfc/rfc8810.html

Not relevant anymore. Use RFC'd version of ORF.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Check if cluster list attribute is not received via eBGP session
Donatas Abraitis [Fri, 7 Jul 2023 12:07:11 +0000 (15:07 +0300)]
bgpd: Check if cluster list attribute is not received via eBGP session

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Check if originator-id attribute is not received via eBGP session
Donatas Abraitis [Fri, 7 Jul 2023 12:03:07 +0000 (15:03 +0300)]
bgpd: Check if originator-id attribute is not received via eBGP session

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #13949 from opensourcerouting/fix/bgpd_deprecations
Mark Stapp [Fri, 7 Jul 2023 19:25:31 +0000 (15:25 -0400)]
Merge pull request #13949 from opensourcerouting/fix/bgpd_deprecations

bgpd: rfc8810 deprecations

21 months agoMerge pull request #13757 from cscarpitta/bugfix/fix-fpm-read-crash
Mark Stapp [Fri, 7 Jul 2023 16:15:31 +0000 (12:15 -0400)]
Merge pull request #13757 from cscarpitta/bugfix/fix-fpm-read-crash

zebra: Fix crash when `dplane_fpm_nl` fails to process received routes

21 months agobgpd: Deprecate Prestandard Route Refresh capability (128)
Donatas Abraitis [Fri, 7 Jul 2023 13:01:19 +0000 (16:01 +0300)]
bgpd: Deprecate Prestandard Route Refresh capability (128)

More details: https://www.rfc-editor.org/rfc/rfc8810.html

Not sure if we want to maintain the old code more.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Drop deprecated capability (dynamic 66)
Donatas Abraitis [Fri, 7 Jul 2023 12:51:32 +0000 (15:51 +0300)]
bgpd: Drop deprecated capability (dynamic 66)

Already deprecated since two decades.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agozebra: Fix crash when `dplane_fpm_nl` fails to process received routes
Carmine Scarpitta [Fri, 7 Jul 2023 00:57:07 +0000 (02:57 +0200)]
zebra: Fix crash when `dplane_fpm_nl` fails to process received routes

When `dplane_fpm_nl` receives a route, it allocates memory for a dplane
context and calls `netlink_route_change_read_unicast_internal` without
initializing the `intf_extra_list` contained in the dplane context. If
`netlink_route_change_read_unicast_internal` is not able to process the
route, we call `dplane_ctx_fini` to free the dplane context. This causes
a crash because `dplane_ctx_fini` attempts to access the intf_extra_list
which is not initialized.

To solve this issue, we can call `dplane_ctx_route_init`to initialize
the dplane route context properly, just after the dplane context
allocation.

(gdb) bt
#0 0x0000555dd5ceae80 in dplane_intf_extra_list_pop (h=0x7fae1c007e68) at ../zebra/zebra_dplane.c:427
#1 dplane_ctx_free_internal (ctx=0x7fae1c0074b0) at ../zebra/zebra_dplane.c:724
#2 0x0000555dd5cebc99 in dplane_ctx_free (pctx=0x7fae2aa88c98) at ../zebra/zebra_dplane.c:869
#3 dplane_ctx_free (pctx=0x7fae2aa88c98, pctx@entry=0x7fae2aa78c28) at ../zebra/zebra_dplane.c:855
#4 dplane_ctx_fini (pctx=pctx@entry=0x7fae2aa88c98) at ../zebra/zebra_dplane.c:890
#5 0x00007fae31e93f29 in fpm_read (t=) at ../zebra/dplane_fpm_nl.c:605
#6 0x00007fae325191dd in thread_call (thread=thread@entry=0x7fae2aa98da0) at ../lib/thread.c:2006
#7 0x00007fae324c42b8 in fpt_run (arg=0x555dd74777c0) at ../lib/frr_pthread.c:309
#8 0x00007fae32405ea7 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#9 0x00007fae32325a2f in clone () from /lib/x86_64-linux-gnu/libc.so.6

Fixes: #13754
Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
21 months agozebra: Abstract `dplane_ctx_route_init` to init route without copying
Carmine Scarpitta [Fri, 7 Jul 2023 00:55:18 +0000 (02:55 +0200)]
zebra: Abstract `dplane_ctx_route_init` to init route without copying

The function `dplane_ctx_route_init` initializes a dplane route context
from the route object passed as an argument. Let's abstract this
function to allow initializing the dplane route context without actually
copying a route object.

This allows us to use this function for initializing a dplane route
context when we don't have any route to copy in it.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
21 months agoospf: fix lsa leak
ryndia [Wed, 5 Jul 2023 10:52:16 +0000 (14:52 +0400)]
ospf: fix lsa leak

In the function ospf_lsa_translated_nssa_new the newly created lsa is lock however, the return lsa from ospf_lsa_new already has a lock. Therefore removing the addition lock resolve the leak below.

ospf_basic_functionality.test_ospf_nssa#r3.asan.ospfd.5456

=================================================================
==5456==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 640 byte(s) in 5 object(s) allocated from:
    #0 0x7f294f354a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f294eeed562 in qcalloc ../lib/memory.c:105
    #2 0x561a16004f60 in ospf_lsa_new ../ospfd/ospf_lsa.c:186
    #3 0x561a160051a1 in ospf_lsa_new_and_data ../ospfd/ospf_lsa.c:205
    #4 0x561a1600f21d in ospf_exnl_lsa_prepare_and_flood ../ospfd/ospf_lsa.c:1762
    #5 0x561a1600fd71 in ospf_external_lsa_new ../ospfd/ospf_lsa.c:1863
    #6 0x561a160107d7 in ospf_lsa_translated_nssa_new ../ospfd/ospf_lsa.c:1985
    #7 0x561a16011cfb in ospf_translated_nssa_refresh ../ospfd/ospf_lsa.c:2152
    #8 0x561a16014bb2 in ospf_external_lsa_install ../ospfd/ospf_lsa.c:2871
    #9 0x561a1601596b in ospf_lsa_install ../ospfd/ospf_lsa.c:3076
    #10 0x561a16168b3c in ospf_flood ../ospfd/ospf_flood.c:482
    #11 0x561a160462f8 in ospf_ls_upd ../ospfd/ospf_packet.c:2115
    #12 0x561a1604c66c in ospf_read_helper ../ospfd/ospf_packet.c:3198
    #13 0x561a1604c88e in ospf_read ../ospfd/ospf_packet.c:3229
    #14 0x7f294efd6c33 in event_call ../lib/event.c:1995
    #15 0x7f294eec134a in frr_run ../lib/libfrr.c:1213
    #16 0x561a15fd3b6d in main ../ospfd/ospf_main.c:249
    #17 0x7f294e998d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Objects leaked above:
0x60c000062800 (128 bytes)
0x60c000062c80 (128 bytes)
0x60c0000631c0 (128 bytes)
0x60c000063700 (128 bytes)
0x60c000063d00 (128 bytes)

Direct leak of 640 byte(s) in 5 object(s) allocated from:
    #0 0x7f294f354a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f294eeed562 in qcalloc ../lib/memory.c:105
    #2 0x561a16004f60 in ospf_lsa_new ../ospfd/ospf_lsa.c:186
    #3 0x561a160051a1 in ospf_lsa_new_and_data ../ospfd/ospf_lsa.c:205
    #4 0x561a1600f21d in ospf_exnl_lsa_prepare_and_flood ../ospfd/ospf_lsa.c:1762
    #5 0x561a1600fd71 in ospf_external_lsa_new ../ospfd/ospf_lsa.c:1863
    #6 0x561a160107d7 in ospf_lsa_translated_nssa_new ../ospfd/ospf_lsa.c:1985
    #7 0x561a16010e10 in ospf_translated_nssa_originate ../ospfd/ospf_lsa.c:2034
    #8 0x561a16136559 in ospf_abr_translate_nssa ../ospfd/ospf_abr.c:668
    #9 0x561a161383da in ospf_abr_process_nssa_translates ../ospfd/ospf_abr.c:968
    #10 0x561a1613f9b8 in ospf_abr_nssa_task ../ospfd/ospf_abr.c:2054
    #11 0x561a161402e5 in ospf_abr_task_timer ../ospfd/ospf_abr.c:2168
    #12 0x7f294efd6c33 in event_call ../lib/event.c:1995
    #13 0x7f294eec134a in frr_run ../lib/libfrr.c:1213
    #14 0x561a15fd3b6d in main ../ospfd/ospf_main.c:249
    #15 0x7f294e998d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Objects leaked above:
0x60c00003e380 (128 bytes)
0x60c00003e740 (128 bytes)
0x60c00003eb00 (128 bytes)
0x60c00005fd40 (128 bytes)
0x60c00005ff80 (128 bytes)

Indirect leak of 180 byte(s) in 5 object(s) allocated from:
    #0 0x7f294f354a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f294eeed562 in qcalloc ../lib/memory.c:105
    #2 0x561a16005a43 in ospf_lsa_data_new ../ospfd/ospf_lsa.c:296
    #3 0x561a160051b1 in ospf_lsa_new_and_data ../ospfd/ospf_lsa.c:206
    #4 0x561a1600f21d in ospf_exnl_lsa_prepare_and_flood ../ospfd/ospf_lsa.c:1762
    #5 0x561a1600fd71 in ospf_external_lsa_new ../ospfd/ospf_lsa.c:1863
    #6 0x561a160107d7 in ospf_lsa_translated_nssa_new ../ospfd/ospf_lsa.c:1985
    #7 0x561a16011cfb in ospf_translated_nssa_refresh ../ospfd/ospf_lsa.c:2152
    #8 0x561a16014bb2 in ospf_external_lsa_install ../ospfd/ospf_lsa.c:2871
    #9 0x561a1601596b in ospf_lsa_install ../ospfd/ospf_lsa.c:3076
    #10 0x561a16168b3c in ospf_flood ../ospfd/ospf_flood.c:482
    #11 0x561a160462f8 in ospf_ls_upd ../ospfd/ospf_packet.c:2115
    #12 0x561a1604c66c in ospf_read_helper ../ospfd/ospf_packet.c:3198
   #13 0x561a1604c88e in ospf_read ../ospfd/ospf_packet.c:3229
    #14 0x7f294efd6c33 in event_call ../lib/event.c:1995
    #15 0x7f294eec134a in frr_run ../lib/libfrr.c:1213
    #16 0x561a15fd3b6d in main ../ospfd/ospf_main.c:249
    #17 0x7f294e998d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Objects leaked above:
0x60400003f890 (36 bytes)
0x60400003f990 (36 bytes)
0x60400003fa50 (36 bytes)
0x60400003fb10 (36 bytes)
0x60400003fbd0 (36 bytes)

Indirect leak of 180 byte(s) in 5 object(s) allocated from:
    #0 0x7f294f354a37 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
    #1 0x7f294eeed562 in qcalloc ../lib/memory.c:105
    #2 0x561a16005a43 in ospf_lsa_data_new ../ospfd/ospf_lsa.c:296
    #3 0x561a160051b1 in ospf_lsa_new_and_data ../ospfd/ospf_lsa.c:206
    #4 0x561a1600f21d in ospf_exnl_lsa_prepare_and_flood ../ospfd/ospf_lsa.c:1762
    #5 0x561a1600fd71 in ospf_external_lsa_new ../ospfd/ospf_lsa.c:1863
    #6 0x561a160107d7 in ospf_lsa_translated_nssa_new ../ospfd/ospf_lsa.c:1985
    #7 0x561a16010e10 in ospf_translated_nssa_originate ../ospfd/ospf_lsa.c:2034
    #8 0x561a16136559 in ospf_abr_translate_nssa ../ospfd/ospf_abr.c:668
    #9 0x561a161383da in ospf_abr_process_nssa_translates ../ospfd/ospf_abr.c:968
    #10 0x561a1613f9b8 in ospf_abr_nssa_task ../ospfd/ospf_abr.c:2054
    #11 0x561a161402e5 in ospf_abr_task_timer ../ospfd/ospf_abr.c:2168
    #12 0x7f294efd6c33 in event_call ../lib/event.c:1995
    #13 0x7f294eec134a in frr_run ../lib/libfrr.c:1213
    #14 0x561a15fd3b6d in main ../ospfd/ospf_main.c:249
    #15 0x7f294e998d8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

Objects leaked above:
0x60400003c6d0 (36 bytes)
0x60400003c790 (36 bytes)
0x60400003c810 (36 bytes)
0x60400003c890 (36 bytes)
0x60400003c910 (36 bytes)

SUMMARY: AddressSanitizer: 1640 byte(s) leaked in 20 allocation(s).
Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
21 months agobgpd: Fix `show bgp summary wide` alignment
Donatas Abraitis [Fri, 7 Jul 2023 07:23:39 +0000 (10:23 +0300)]
bgpd: Fix `show bgp summary wide` alignment

Before:

```
r1# show ip bgp summary wide

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.1.1, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 725 KiB of memory

Neighbor        V         AS    LocalAS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002     65001         8         8        0    0    0 00:00:05            0        0 FRRouting/9.1-dev-MyOwnFRRVersion-gc5fc0beb46

Total number of neighbors 1
r1#
```

After:

```
r1# show ip bgp summary wide

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.1.1, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 725 KiB of memory

Neighbor        V         AS    LocalAS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002      65001        10        10        0    0    0 00:00:08            0        0 FRRouting/9.1-dev-MyOwnFRRVersion-g4be13ec347

Total number of neighbors 1
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Show neighbors software version if description is not set
Donatas Abraitis [Fri, 7 Jul 2023 07:14:51 +0000 (10:14 +0300)]
bgpd: Show neighbors software version if description is not set

Also, this is visible only if `capability software-version` is enabled.

Example:

```
r1# show ip bgp summary

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.1.1, local AS number 65001 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 725 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.1.2     4      65002        54        54        0    0    0 00:00:52            0        0 FRRouting/9.1-dev-My

Total number of neighbors 1
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #13946 from LabNConsulting/chopps/doc-sqlite3-depend
Donatas Abraitis [Fri, 7 Jul 2023 06:53:57 +0000 (09:53 +0300)]
Merge pull request #13946 from LabNConsulting/chopps/doc-sqlite3-depend

doc sqlite3 depend

21 months agodoc: document sqlite3 depend and add to docker build
Christian Hopps [Thu, 6 Jul 2023 21:57:48 +0000 (17:57 -0400)]
doc: document sqlite3 depend and add to docker build

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agobuild: disable warning for m$ extension use
Christian Hopps [Thu, 6 Jul 2023 21:41:40 +0000 (17:41 -0400)]
build: disable warning for m$ extension use

This is adding a "disable warning" to ccls convenience config.

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agoMerge pull request #13925 from Keelan10/bgpd-leak
Donald Sharp [Thu, 6 Jul 2023 20:24:05 +0000 (16:24 -0400)]
Merge pull request #13925 from Keelan10/bgpd-leak

bgpd: Fix memory leak

21 months agoMerge pull request #13926 from SaiGomathiN/querinterval
Donald Sharp [Thu, 6 Jul 2023 20:22:15 +0000 (16:22 -0400)]
Merge pull request #13926 from SaiGomathiN/querinterval

pimd,pim6d: Query-interval should be greater than query max response time

21 months agoMerge pull request #13915 from pguibert6WIND/bgp_vpnv6_per_nexthop_better_test
Donald Sharp [Thu, 6 Jul 2023 20:21:19 +0000 (16:21 -0400)]
Merge pull request #13915 from pguibert6WIND/bgp_vpnv6_per_nexthop_better_test

topotests: label per nexthop ipv6 test adds add a while loop for mpls…

21 months agoMerge pull request #13932 from opensourcerouting/redhat-libyang-update
Donald Sharp [Thu, 6 Jul 2023 15:21:54 +0000 (11:21 -0400)]
Merge pull request #13932 from opensourcerouting/redhat-libyang-update

redhat: Change libyang dependency to libyang > 2

21 months agoMerge pull request #13396 from donaldsharp/interface_is_interface
Russ White [Thu, 6 Jul 2023 12:31:16 +0000 (08:31 -0400)]
Merge pull request #13396 from donaldsharp/interface_is_interface

move interface ( LINK and ADDR ) events to the dplane

21 months agoMerge pull request #13808 from anlancs/fix/zebra-kernel-route-reserved
Donatas Abraitis [Thu, 6 Jul 2023 06:01:21 +0000 (09:01 +0300)]
Merge pull request #13808 from anlancs/fix/zebra-kernel-route-reserved

zebra: fix wrong nexthop check for kernel routes

21 months agoMerge pull request #13837 from mobash-rasool/fixes2
Donatas Abraitis [Thu, 6 Jul 2023 05:57:47 +0000 (08:57 +0300)]
Merge pull request #13837 from mobash-rasool/fixes2

pim6d: MLD conformance querier-non-querier transition fix

21 months agoMerge pull request #13927 from Keelan10/bgpd-nexthop-leak
Donatas Abraitis [Thu, 6 Jul 2023 05:56:49 +0000 (08:56 +0300)]
Merge pull request #13927 from Keelan10/bgpd-nexthop-leak

bgpd: Free nexthop in bgp_mplsvpn_nh_label_bind_free

21 months agotopotests: label per nexthop ipv6 test adds add a while loop for mpls table
Philippe Guibert [Mon, 3 Jul 2023 08:06:08 +0000 (10:06 +0200)]
topotests: label per nexthop ipv6 test adds add a while loop for mpls table

The bgp_vpnv6_per_nexthop_label tests only check to see if the mpls labels
are installed one time. Test runs show that all but one label is installed.
More than likely the test has asked for data while zebra is still installing
it. the mpls_label_check functions must check this result multiple times as
that system may be under heavy load.

A loop is introduced in order to let zebra check the mpls table.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
21 months agobgpd: Free nexthop in bgp_mplsvpn_nh_label_bind_free
Keelan10 [Tue, 4 Jul 2023 10:13:15 +0000 (14:13 +0400)]
bgpd: Free nexthop in bgp_mplsvpn_nh_label_bind_free

`bmnc->nh` was not properly freed, leading to a memory leak.
The commit adds a check to ensure that the `bmnc->nh` member variable is freed if it exists.

The ASan leak log for reference:
```
***********************************************************************************
Address Sanitizer Error detected in bgp_vpnv4_asbr.test_bgp_vpnv4_asbr/r2.asan.bgpd.6382

=================================================================
==6382==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 720 byte(s) in 5 object(s) allocated from:
    #0 0x7f6a80d02d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x55c9afd7c81c in qcalloc lib/memory.c:105
    #2 0x55c9afd9166b in nexthop_new lib/nexthop.c:358
    #3 0x55c9afd93aaa in nexthop_dup lib/nexthop.c:843
    #4 0x55c9afad39bb in bgp_mplsvpn_nh_label_bind_register_local_label bgpd/bgp_mplsvpn.c:4259
    #5 0x55c9afb1c5e9 in bgp_mplsvpn_handle_label_allocation bgpd/bgp_route.c:3239
    #6 0x55c9afb1c5e9 in bgp_process_main_one bgpd/bgp_route.c:3339
    #7 0x55c9afb1d2c1 in bgp_process_wq bgpd/bgp_route.c:3591
    #8 0x55c9afe33df9 in work_queue_run lib/workqueue.c:266
    #9 0x55c9afe198e2 in event_call lib/event.c:1995
    #10 0x55c9afd5fc6f in frr_run lib/libfrr.c:1213
    #11 0x55c9af9f6f00 in main bgpd/bgp_main.c:505
    #12 0x7f6a7f55ec86 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 0x7f6a80d02d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x55c9afd7c81c in qcalloc lib/memory.c:105
    #2 0x55c9afd91ce8 in nexthop_add_labels lib/nexthop.c:536
    #3 0x55c9afd93754 in nexthop_copy_no_recurse lib/nexthop.c:802
    #4 0x55c9afd939fb in nexthop_copy lib/nexthop.c:821
    #5 0x55c9afd93abb in nexthop_dup lib/nexthop.c:845
    #6 0x55c9afad39bb in bgp_mplsvpn_nh_label_bind_register_local_label bgpd/bgp_mplsvpn.c:4259
    #7 0x55c9afb1c5e9 in bgp_mplsvpn_handle_label_allocation bgpd/bgp_route.c:3239
    #8 0x55c9afb1c5e9 in bgp_process_main_one bgpd/bgp_route.c:3339
    #9 0x55c9afb1d2c1 in bgp_process_wq bgpd/bgp_route.c:3591
    #10 0x55c9afe33df9 in work_queue_run lib/workqueue.c:266
    #11 0x55c9afe198e2 in event_call lib/event.c:1995
    #12 0x55c9afd5fc6f in frr_run lib/libfrr.c:1213
    #13 0x55c9af9f6f00 in main bgpd/bgp_main.c:505
    #14 0x7f6a7f55ec86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 736 byte(s) leaked in 7 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
21 months agobgpd: Fix memory leak
Keelan10 [Tue, 4 Jul 2023 09:35:10 +0000 (13:35 +0400)]
bgpd: Fix memory leak

The `bgp_vrf->vrf_prd_pretty` string was not properly freed, leading to a memory leak.
This commit resolves the memory leak by freeing the memory allocated for `bgp_vrf->vrf_prd_pretty` before returning from the function.

The ASan leak log for reference:
```
***********************************************************************************
Address Sanitizer Error detected in evpn_type5_test_topo1.test_evpn_type5_topo1/e1.asan.bgpd.17689

=================================================================
==17689==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 15 byte(s) in 1 object(s) allocated from:
    #0 0x7fdd94fc0538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x55e28d9c4c6c in qstrdup lib/memory.c:117
    #2 0x55e28d6c0d27 in evpn_configure_vrf_rd bgpd/bgp_evpn_vty.c:2297
    #3 0x55e28d6c0d27 in bgp_evpn_vrf_rd bgpd/bgp_evpn_vty.c:6271
    #4 0x55e28d94c155 in cmd_execute_command_real lib/command.c:994
    #5 0x55e28d94c622 in cmd_execute_command lib/command.c:1053
    #6 0x55e28d94ca99 in cmd_execute lib/command.c:1221
    #7 0x55e28da6d7d4 in vty_command lib/vty.c:591
    #8 0x55e28da6dc6e in vty_execute lib/vty.c:1354
    #9 0x55e28da7644d in vtysh_read lib/vty.c:2362
    #10 0x55e28da616e2 in event_call lib/event.c:1995
    #11 0x55e28d9a7a65 in frr_run lib/libfrr.c:1213
    #12 0x55e28d63ef00 in main bgpd/bgp_main.c:505
    #13 0x7fdd93883c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

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

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
21 months agozebra: Use zebra dplane for RTM link and addr
Donald Sharp [Thu, 27 Apr 2023 03:02:09 +0000 (23:02 -0400)]
zebra: Use zebra dplane for RTM link and addr

a) Move the reads of link and address information
into the dplane
b) Move the startup read of data into the dplane
as well.
c) Break up startup reading of the linux kernel data
into multiple phases.  As that we have implied ordering
of data that must be read first and if the dplane has
taken over some data reading then we must delay initial
read-in of other data.

Fixes: #13288
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Add code to get/set interface to pass up from dplane
Donald Sharp [Thu, 20 Apr 2023 12:51:42 +0000 (08:51 -0400)]
zebra: Add code to get/set interface to pass up from dplane

1) Add a bunch of get/set functions and associated data
structure in zebra_dplane to allow the setting and retrieval
of interface netlink data up into the master pthread.

2) Add a bit of code to breakup startup into stages.  This is
because FRR currently has a mix of dplane and non dplane interactions
and the code needs to be paused before continuing on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Remove duplicate function for netlink interface changes
Donald Sharp [Thu, 13 Apr 2023 20:43:27 +0000 (16:43 -0400)]
zebra: Remove duplicate function for netlink interface changes

Turns out FRR has 2 functions one specifically for startup
and one for normal day to day operations.  There were only
a couple of minor differences from what I could tell, and
where they were different the after startup functionality should
have been updated too.  I cannot figure out why we have 2.

Non-startup handling of bonds appears to be incorrect
so let's fix that.  Additionally the speed was not
properly being set in non-startup situations.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Remove unused add variable
Donald Sharp [Sat, 15 Apr 2023 12:04:51 +0000 (08:04 -0400)]
zebra: Remove unused add variable

Function was not using the add variable.  Remove it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Remove unused dplane_intf_delete
Donald Sharp [Fri, 14 Apr 2023 11:43:19 +0000 (07:43 -0400)]
zebra: Remove unused dplane_intf_delete

There is no need for this functionality and it is
not used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Move protodown_r_bit to a better spot
Donald Sharp [Thu, 27 Apr 2023 11:37:58 +0000 (07:37 -0400)]
zebra: Move protodown_r_bit to a better spot

Since we are moving some code handling out of the dataplane
and into zebra proper, lets move the protodown r bit as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: Rename vrf_lookup_by_tableid to zebra_vrf_lookup..
Donald Sharp [Thu, 27 Apr 2023 03:25:27 +0000 (23:25 -0400)]
zebra: Rename vrf_lookup_by_tableid to zebra_vrf_lookup..

Rename the vrf_lookup_by_id function to zebra_vrf_lookup_by_id
and move to zebra_vrf.c where it nominally belongs, as that
we need zebra specific data to find this vrf_id and as such
it does not belong in vrf.c

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #13875 from donaldsharp/static_dplane_issues
Mark Stapp [Wed, 5 Jul 2023 12:27:23 +0000 (08:27 -0400)]
Merge pull request #13875 from donaldsharp/static_dplane_issues

zebra: Static routes async notification do not need this test

21 months agoredhat: Change libyang dependency to libyang > 2
Martin Winter [Mon, 26 Jun 2023 19:21:48 +0000 (21:21 +0200)]
redhat: Change libyang dependency to libyang > 2

Not using libyang2 anymore to match RedHat name change

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
21 months agoMerge pull request #13333 from donaldsharp/vrf_bitmap_cleanup
Donatas Abraitis [Tue, 4 Jul 2023 19:11:11 +0000 (22:11 +0300)]
Merge pull request #13333 from donaldsharp/vrf_bitmap_cleanup

*: Rearrange vrf_bitmap_X api to reduce memory footprint

21 months agoMerge pull request #13554 from ryndia/fix_leak
Donatas Abraitis [Tue, 4 Jul 2023 18:45:36 +0000 (21:45 +0300)]
Merge pull request #13554 from ryndia/fix_leak

bgpd: free bgp vpn policy

21 months agoMerge pull request #13467 from patrasar/pimv6_state_fix
Donatas Abraitis [Tue, 4 Jul 2023 18:37:20 +0000 (21:37 +0300)]
Merge pull request #13467 from patrasar/pimv6_state_fix

pim6d: "show ipv6 pim state" not displaying when OIL is empty

21 months agoMerge pull request #13889 from chiragshah6/fdev2
Igor Ryzhov [Tue, 4 Jul 2023 18:06:15 +0000 (21:06 +0300)]
Merge pull request #13889 from chiragshah6/fdev2

tools: fix pim interface config deletion

21 months agoMerge pull request #13892 from ryndia/fix_ospf6_lsa_leak
Donatas Abraitis [Tue, 4 Jul 2023 16:19:51 +0000 (19:19 +0300)]
Merge pull request #13892 from ryndia/fix_ospf6_lsa_leak

ospf6d: unlock lsa

21 months agobgpd: free bgp vpn policy
ryndia [Tue, 27 Jun 2023 06:59:09 +0000 (10:59 +0400)]
bgpd: free bgp vpn policy

The bgp vpn policy had some attribute not free when the function bgp_free was called leading to memory leak as shown below.

./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251:Direct leak of 592 byte(s) in 2 object(s) allocated from:
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #0 0x7f4b7ae92037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #1 0x7f4b7aa96e38 in qcalloc lib/memory.c:105
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #2 0x7f4b7aa9bec9 in srv6_locator_chunk_alloc lib/srv6.c:135
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #3 0x56396f8e56f8 in ensure_vrf_tovpn_sid_per_af bgpd/bgp_mplsvpn.c:752
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #4 0x56396f8e608a in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:846
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #5 0x56396f8e075d in vpn_leak_postchange bgpd/bgp_mplsvpn.h:259
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #6 0x56396f8f3e5b in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3397
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #7 0x56396fa920ef in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3238
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #8 0x7f4b7abb2913 in zclient_read lib/zclient.c:4134
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #9 0x7f4b7ab62010 in thread_call lib/thread.c:1991
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #10 0x7f4b7aa5a418 in frr_run lib/libfrr.c:1185
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #11 0x56396f7d756d in main bgpd/bgp_main.c:505
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #12 0x7f4b7a479d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251:Direct leak of 32 byte(s) in 2 object(s) allocated from:
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #0 0x7f4b7ae92037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #1 0x7f4b7aa96e38 in qcalloc lib/memory.c:105
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #2 0x56396f8e31b8 in vpn_leak_zebra_vrf_sid_update_per_af bgpd/bgp_mplsvpn.c:386
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #3 0x56396f8e3ae8 in vpn_leak_zebra_vrf_sid_update bgpd/bgp_mplsvpn.c:448
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #4 0x56396f8e09b0 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:271
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #5 0x56396f8f3e5b in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3397
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #6 0x56396fa920ef in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3238
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #7 0x7f4b7abb2913 in zclient_read lib/zclient.c:4134
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #8 0x7f4b7ab62010 in thread_call lib/thread.c:1991
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #9 0x7f4b7aa5a418 in frr_run lib/libfrr.c:1185
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #10 0x56396f7d756d in main bgpd/bgp_main.c:505
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #11 0x7f4b7a479d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251:Direct leak of 32 byte(s) in 2 object(s) allocated from:
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #0 0x7f4b7ae92037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #1 0x7f4b7aa96e38 in qcalloc lib/memory.c:105
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #2 0x56396f8e5730 in ensure_vrf_tovpn_sid_per_af bgpd/bgp_mplsvpn.c:753
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #3 0x56396f8e608a in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:846
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #4 0x56396f8e075d in vpn_leak_postchange bgpd/bgp_mplsvpn.h:259
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #5 0x56396f8f3e5b in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3397
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #6 0x56396fa920ef in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3238
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #7 0x7f4b7abb2913 in zclient_read lib/zclient.c:4134
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #8 0x7f4b7ab62010 in thread_call lib/thread.c:1991
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #9 0x7f4b7aa5a418 in frr_run lib/libfrr.c:1185
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #10 0x56396f7d756d in main bgpd/bgp_main.c:505
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-    #11 0x7f4b7a479d09 in __libc_start_main ../csu/libc-start.c:308
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-
./bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.bgpd.asan.603251-SUMMARY: AddressSanitizer: 656 byte(s) leaked in 6 allocation(s).

Signed-off-by: ryndia <dindyalsarvesh@gmail.com>
21 months agopimd,pim6d: Query-interval should be greater than quer max response time
Sai Gomathi N [Tue, 4 Jul 2023 08:55:33 +0000 (01:55 -0700)]
pimd,pim6d: Query-interval should be greater than quer max response time

According to RFC 2236 Section 8.3
The number of seconds represented by the [Query Response Interval] must be less than the [Query Interval].

As Maximum Response Delay refers to the maximum time interval within which an IGMP or MLD router
should respond to a query message. If both are equal, then both may expire at the same time.
So Query Interval must be greater than the query max response time.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
21 months agoMerge pull request #13894 from donaldsharp/route_map_applied_wrong
Donatas Abraitis [Tue, 4 Jul 2023 08:34:20 +0000 (11:34 +0300)]
Merge pull request #13894 from donaldsharp/route_map_applied_wrong

lib: Add two places we were not counting route-map applied

21 months agoMerge pull request #13921 from donaldsharp/ospf_vty_guard_json
Donatas Abraitis [Tue, 4 Jul 2023 05:51:51 +0000 (08:51 +0300)]
Merge pull request #13921 from donaldsharp/ospf_vty_guard_json

ospfd: Ensure `show ip ospf interface` json code is guarded

21 months agobgpd: All paths bgp_vrf have already been derefed
Donald Sharp [Mon, 3 Jul 2023 17:00:07 +0000 (13:00 -0400)]
bgpd: All paths bgp_vrf have already been derefed

Signed-off-by: Donald Sharp <sharpd@nvidia.com>