]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
21 months agoMerge pull request #14081 from donaldsharp/bgp_ringbuf_cleanup
Russ White [Tue, 25 Jul 2023 14:24:12 +0000 (10:24 -0400)]
Merge pull request #14081 from donaldsharp/bgp_ringbuf_cleanup

Bgp ringbuf cleanup

21 months agoMerge pull request #14086 from qlyoung/fix-strncpy-warning
Russ White [Tue, 25 Jul 2023 14:23:35 +0000 (10:23 -0400)]
Merge pull request #14086 from qlyoung/fix-strncpy-warning

tests: fix strncpy warning

21 months agoMerge pull request #14080 from anlancs/fix/zebra-nhg-reinstall
Russ White [Tue, 25 Jul 2023 14:23:10 +0000 (10:23 -0400)]
Merge pull request #14080 from anlancs/fix/zebra-nhg-reinstall

zebra: fix nhg out of sync between zebra and kernel

21 months agoMerge pull request #13945 from pguibert6WIND/redistribute_isis_table
Russ White [Tue, 25 Jul 2023 14:16:46 +0000 (10:16 -0400)]
Merge pull request #13945 from pguibert6WIND/redistribute_isis_table

Redistribute isis table

21 months agoMerge pull request #14088 from anlancs/fix/add-debug-zebra
Donald Sharp [Tue, 25 Jul 2023 13:48:38 +0000 (09:48 -0400)]
Merge pull request #14088 from anlancs/fix/add-debug-zebra

zebra: add several fields for debug

21 months agoMerge pull request #14079 from donaldsharp/last_reset_cause_slimming
Mark Stapp [Tue, 25 Jul 2023 13:25:43 +0000 (09:25 -0400)]
Merge pull request #14079 from donaldsharp/last_reset_cause_slimming

bgpd: The last_reset_cause in the peer structure is too large

21 months agozebra: add several fields for debug 14088/head
anlan_cs [Tue, 25 Jul 2023 05:15:44 +0000 (13:15 +0800)]
zebra: add several fields for debug

Two changes for debug:
1. Add a field to indicate its vrf for nexthop.  When the interface changes
vrf, we can't easily know the vrf of this nexthop according to current log.
2. Add a field to indicate operation type.  We can't know whether to add or
remove route according to current log.

Before:
```
zebra_nhg_increment_ref: nhe 0x555623eb82c0 (76[if 6]) 0 => 1
zebra_interface_nhg_reinstall install nhe 75[77.75.1.75 if 6] nh type 3 flags 0x1
Route 77.75.1.0/24(8) queued for processing into sub-queue Early Route Processing
Route 77.75.1.0/24(8) queued for processing into sub-queue Early Route Processing
```

After:
```
zebra_nhg_increment_ref: nhe 0x555623eb82c0 (76[if 6 vrfid 9]) 0 => 1
zebra_interface_nhg_reinstall install nhe 75[77.75.1.75 if 6 vrfid 8] nh type 3 flags 0x1
Route 77.75.1.0/24(8) (add) queued for processing into sub-queue Early Route Processing
Route 77.75.1.0/24(8) (delete) queued for processing into sub-queue Early Route Processing
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
21 months agoMerge pull request #14083 from chiragshah6/fdev1
Donatas Abraitis [Tue, 25 Jul 2023 06:14:54 +0000 (09:14 +0300)]
Merge pull request #14083 from chiragshah6/fdev1

bgpd: non pretty json output for neighbor routes

21 months agobgpd: The last_reset_cause in the peer structure is too large 14079/head
Donald Sharp [Mon, 24 Jul 2023 00:30:47 +0000 (20:30 -0400)]
bgpd: The last_reset_cause in the peer structure is too large

The last_reset_cause is a plain old BGP_MAX_PACKET_SIZE buffer
that is really enlarging the peer data structure.  Let's just
copy the stream that failed and only allocate how ever much
the packet size actually was.  While it's likely that we have
a reset reason, the packet typically is not going to be 65k
in size.  Let's save space.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotests: fix strncpy warning 14086/head
Quentin Young [Mon, 24 Jul 2023 23:01:51 +0000 (19:01 -0400)]
tests: fix strncpy warning

GCC/clang warns about using strncpy in such a way that it does not copy
the null byte of a string; as implemented it was fine, but to fix the
warning, just use strlcat which was purpose made for the task being
accomplished here.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
21 months agobgpd: non pretty json output for neighbor routes 14083/head
Sindhu Parvathi Gopinathan [Wed, 12 Jul 2023 10:45:26 +0000 (03:45 -0700)]
bgpd: non pretty json output for neighbor routes

Currently, json output of show BGP commands are no pretty format.

This is an extremely expensive operation for huge scale (lots of
routes with lots of paths).

BGP json non-pretty commands support added:

```
show bgp neighbors <nbr-id> advertised-routes json
show bgp neighbors <nbr-id> received-routes json
show bgp neighbors <nbr-id> advertised-routes detail json
show bgp neighbors <nbr-id> received-routes detail json
```

Ticket:#3513256
Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
21 months agobgpd: Reduce size of ibuf_work ringbuf 14081/head
Donald Sharp [Mon, 24 Jul 2023 14:33:21 +0000 (10:33 -0400)]
bgpd: Reduce size of ibuf_work ringbuf

The ringbuf is 650k in size.  This is obscenely large and
in practical experimentation FRR never even approaches
that size at all.  Let's reduce this to 1.5 max packet sizes.

If a BGP_MAX_PACKET_SIZE packet is ever received having a bit
of extra space ensures that we can read at least 1 packet.

This also will significantly reduce memory usage when the
operator has a lot of peers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: With io limit allow parsing to continue even if memory is low
Donald Sharp [Mon, 24 Jul 2023 14:13:32 +0000 (10:13 -0400)]
bgpd: With io limit allow parsing to continue even if memory is low

Commit: a0b937de428e14e869b8541f0b7810113d619c2e

Introduced the idea of a input Q packet limit.  Say you read in
635000 bytes of data and the input Q is already at it's limit
(currently 1000) then when bgp_process_reads runs it will
assert because there is less then a BGP_MAX_PACKET_SIZE in ibuf_work.

Don't assert as that it's irrelevant.  Even if we can't read a full packet
in let's let the whole system keep working as that as the input Q length
comes down we will start pulling down the ibuf_work and it will be ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agozebra: fix nhg out of sync between zebra and kernel 14080/head
anlan_cs [Mon, 24 Jul 2023 06:40:22 +0000 (14:40 +0800)]
zebra: fix nhg out of sync between zebra and kernel

PR#13413 introduces reinstall mechanism, but there is problem with the route
leak scenario.

With route leak configuration: ( `x1` and `x2` are binded to `vrf1` )
```
vrf vrf2
 ip route 75.75.75.75/32 77.75.1.75 nexthop-vrf vrf1
 ip route 75.75.75.75/32 77.75.2.75 nexthop-vrf vrf1
exit-vrf
```

Firstly, all are ok.  But after `x1` is set down and up ( The interval
between the down and up operations should be less than 180 seconds. ) ,
`x1` is lost from the nexthop group:
```
anlan# ip nexthop
id 121 group 122/123 proto zebra
id 122 via 77.75.1.75 dev x1 scope link proto zebra
id 123 via 77.75.2.75 dev x2 scope link proto zebra
anlan# ip route show table 2
75.75.75.75 nhid 121 proto 196 metric 20
        nexthop via 77.75.1.75 dev x1 weight 1
        nexthop via 77.75.2.75 dev x2 weight 1
anlan# ip link set dev x1 down
anlan# ip link set dev x1 up
anlan# ip route show table 2 <- Wrong, one nexthop lost from group
75.75.75.75 nhid 121 via 77.75.2.75 dev x2 proto 196 metric 20
anlan# ip nexthop
id 121 group 123 proto zebra
id 122 via 77.75.1.75 dev x1 scope link proto zebra
id 123 via 77.75.2.75 dev x2 scope link proto zebra
anlan# show ip route vrf vrf2 <- Still ok
VRF vrf2:
S>* 75.75.75.75/32 [1/0] via 77.75.1.75, x1 (vrf vrf1), weight 1, 00:00:05
  *                      via 77.75.2.75, x2 (vrf vrf1), weight 1, 00:00:05
```

From the impact on kernel:
The `nh->type` of `id 122` is *always* `NEXTHOP_TYPE_IPV4` in the route leak
case.  Then, `nexthop_is_ifindex_type()` introduced by commit `5bb877` always
returns `false`, so its dependents can't be reinstalled.  After `x1` is down,
there is only `id 123` in the group of `id 121`.  So, Finally `id 121` remains
unchanged after `x1` is up, i.e., `id 122` is not added to the group even it is
reinstalled itself.

From the impact on zebra:
The `show ip route vrf vrf2` is still ok because the `id`s are reused/reinstalled
successfully within 180 seconds after `x1` is down and up.  The group of `id 121`
is with old `NEXTHOP_GROUP_INSTALLED` flag, and it is still the group of `id 122`
and `id 123` as before.

In this way, kernel and zebra have become out of sync.

The `nh->type` of `id 122` should be adjusted to `NEXTHOP_TYPE_IPV4_IFINDEX`
after nexthop resolved.  This commit is for doing this to make that reinstall
mechanism work.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
21 months agoMerge pull request #14076 from chiragshah6/fdev1 14538/head
Donatas Abraitis [Sat, 22 Jul 2023 07:30:05 +0000 (10:30 +0300)]
Merge pull request #14076 from chiragshah6/fdev1

zebra: non pretty json format for rib and evpn operational commands

21 months agoMerge pull request #14075 from donaldsharp/bgp_memory_fun
Donatas Abraitis [Fri, 21 Jul 2023 20:14:29 +0000 (23:14 +0300)]
Merge pull request #14075 from donaldsharp/bgp_memory_fun

Remove unused memory allocations associated with bgp

21 months agozebra: non pretty json output for evpn route 14076/head
Sindhu Parvathi Gopinathan [Wed, 19 Jul 2023 07:00:24 +0000 (00:00 -0700)]
zebra: non pretty json output for evpn route

Currently, json output of evpn route command are no pretty format.
This is an extremely expensive operation at high VNI scale

EVPN json non-pretty command support added:

```
show evpn mac vni <vni-id> detail json
show evpn vni detail json
```

Ticket:#3513256
Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
21 months agozebra: non pretty json output for show ip route
Sindhu Parvathi Gopinathan [Wed, 19 Jul 2023 06:53:15 +0000 (23:53 -0700)]
zebra: non pretty json output for show ip route

Currently, json output of show ip route command are no pretty format.
This is an extremely expensive operation at high scale
(with high number of routes with many paths).

Zebra json non-pretty command support added:

```
show ip route json
```

Ticket:#3513256

Issue:3513256

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
21 months agobgpd: Replace peer->ibuf_scratch 14075/head
Donald Sharp [Fri, 21 Jul 2023 17:10:03 +0000 (13:10 -0400)]
bgpd: Replace peer->ibuf_scratch

The peer->ibuf_scratch was allocating 65535 * 10 bytes
for scratch space to hold data incoming from a read
from a peer.  When you have 4k peers this is 262,1400,000
or 262 mb of data.  Which is crazy large.  Especially
since the i/o pthread is reading per peer without
any chance of having the data interfere with other reads.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Remove withdraw_low from system, it is never used
Donald Sharp [Fri, 21 Jul 2023 16:46:31 +0000 (12:46 -0400)]
bgpd: Remove withdraw_low from system, it is never used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Remove peer->sync array
Donald Sharp [Fri, 21 Jul 2023 16:41:35 +0000 (12:41 -0400)]
bgpd: Remove peer->sync array

It is never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Remove peer->obuf_work
Donald Sharp [Fri, 21 Jul 2023 16:23:23 +0000 (12:23 -0400)]
bgpd: Remove peer->obuf_work

This is never used.  Free up another 65k of stream data
never used per peer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Remove peer->scratch
Donald Sharp [Fri, 21 Jul 2023 16:14:59 +0000 (12:14 -0400)]
bgpd: Remove peer->scratch

This was only ever being allocated and de-allocated.
Let's save 65k per peer

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #14065 from opensourcerouting/bfd-label-doc
Mark Stapp [Fri, 21 Jul 2023 12:59:50 +0000 (08:59 -0400)]
Merge pull request #14065 from opensourcerouting/bfd-label-doc

doc: remove BFD label command references

21 months agoMerge pull request #14034 from LabNConsulting/aceelindem/ospf_prefix_suppression
Donatas Abraitis [Fri, 21 Jul 2023 07:14:22 +0000 (10:14 +0300)]
Merge pull request #14034 from LabNConsulting/aceelindem/ospf_prefix_suppression

ospfd: Implement OSPF prefix-suppression as specified in RFC 6860

21 months agoMerge pull request #14066 from opensourcerouting/fix/libyang_2.1.80
Donald Sharp [Fri, 21 Jul 2023 03:08:28 +0000 (23:08 -0400)]
Merge pull request #14066 from opensourcerouting/fix/libyang_2.1.80

Switch to libyang 2.1.80

21 months agodocker: Use libyang 2.1.80 for Alpine builds 14066/head
Donatas Abraitis [Thu, 20 Jul 2023 20:16:38 +0000 (23:16 +0300)]
docker: Use libyang 2.1.80 for Alpine builds

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodocker: Move Alpine dependency packages to APKBUILD file
Donatas Abraitis [Thu, 20 Jul 2023 19:39:14 +0000 (22:39 +0300)]
docker: Move Alpine dependency packages to APKBUILD file

Do not mix APKBUILD and Dockerfile when installing dependencies.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodocker: Install protobuf-c-devel for ubi8-minimal
Donatas Abraitis [Thu, 20 Jul 2023 19:33:10 +0000 (22:33 +0300)]
docker: Install protobuf-c-devel for ubi8-minimal

configure: error: in `/src':
configure: error: protobuf requested but protoc-c not found.  Install protobuf-c.
See `config.log' for more details

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodocker: Use Alpine Linux 3.18
Donatas Abraitis [Thu, 20 Jul 2023 19:11:03 +0000 (22:11 +0300)]
docker: Use Alpine Linux 3.18

It has the newer libyang version 2.1.55, while 3.17 has 2.1.30.

3.19 will have 2.1.80.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodocker: Use libyang 2.1.80
Donatas Abraitis [Thu, 20 Jul 2023 19:10:19 +0000 (22:10 +0300)]
docker: Use libyang 2.1.80

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoospfd: Implement OSPF prefix-suppression as specified in RFC 6860 14034/head
Acee [Mon, 17 Jul 2023 17:47:16 +0000 (13:47 -0400)]
ospfd: Implement OSPF prefix-suppression as specified in RFC 6860

Signed-off-by: Acee <aceelindem@gmail.com>
21 months agoredhat: Require libyang 2.1.80
Donatas Abraitis [Thu, 20 Jul 2023 18:54:22 +0000 (21:54 +0300)]
redhat: Require libyang 2.1.80

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodebian: Require libyang 2.1.80
Donatas Abraitis [Thu, 20 Jul 2023 18:52:26 +0000 (21:52 +0300)]
debian: Require libyang 2.1.80

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agodoc: remove BFD label command references 14065/head
Rafael Zalamena [Wed, 19 Jul 2023 14:10:28 +0000 (11:10 -0300)]
doc: remove BFD label command references

`label` command is already gone and now we are going to remove all label
references.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
21 months agosnapcraft: Use libyang 2.1.80
Donatas Abraitis [Thu, 20 Jul 2023 18:46:38 +0000 (21:46 +0300)]
snapcraft: Use libyang 2.1.80

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoMerge pull request #14003 from iqras23/coverity
Donald Sharp [Thu, 20 Jul 2023 14:16:46 +0000 (10:16 -0400)]
Merge pull request #14003 from iqras23/coverity

bgpd: Fix coverity for EVPN

21 months agoMerge pull request #14006 from AbhishekNR/mld_core
Donald Sharp [Thu, 20 Jul 2023 12:23:28 +0000 (08:23 -0400)]
Merge pull request #14006 from AbhishekNR/mld_core

pim6d: Fixing core while running MLD conformance test.

21 months agoMerge pull request #13605 from anlancs/fix/pimd-promote-interface
Donald Sharp [Thu, 20 Jul 2023 12:16:17 +0000 (08:16 -0400)]
Merge pull request #13605 from anlancs/fix/pimd-promote-interface

pimd: Fix missing promotion for primary address

21 months agoMerge pull request #14026 from LabNConsulting/pbr-add-vlan-filters
Donald Sharp [Thu, 20 Jul 2023 12:01:24 +0000 (08:01 -0400)]
Merge pull request #14026 from LabNConsulting/pbr-add-vlan-filters

pbrd: 1/3: add vty support for vlan filtering and send to zebra

21 months agoMerge pull request #14055 from guoguojia2021/route_lock
Donatas Abraitis [Thu, 20 Jul 2023 07:06:47 +0000 (10:06 +0300)]
Merge pull request #14055 from guoguojia2021/route_lock

zebra:unlock node after route_next

21 months agoMerge pull request #14058 from kuldeepkash/pim_v6
Donald Sharp [Wed, 19 Jul 2023 19:45:09 +0000 (15:45 -0400)]
Merge pull request #14058 from kuldeepkash/pim_v6

tests: Update join state in verify_upstream_iif API

21 months agoMerge pull request #14054 from zice312963205/zly_evpn
Donald Sharp [Wed, 19 Jul 2023 19:44:42 +0000 (15:44 -0400)]
Merge pull request #14054 from zice312963205/zly_evpn

zebra:fix a zebra crash issue caused by mac change

21 months agopbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (doc, tests) 14026/head
G. Paul Ziemba [Wed, 19 Jul 2023 14:49:18 +0000 (07:49 -0700)]
pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (doc, tests)

    Subset: doc and tests

    doc
PBR section updated with new fields and some copy-editing

    tests
pbr_topo1: ensure new vlan fields arrive at zebra

    Changes by:
Josh Werner <joshuawerner@mitre.org>
Eli Baum <ebaum@mitre.org>
G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agopbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zebra dplane)
G. Paul Ziemba [Wed, 19 Jul 2023 14:50:11 +0000 (07:50 -0700)]
pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zebra dplane)

    Subset: zebra dataplane

    Add new vlan filter fields. No kernel dataplane
    implementation yet (linux does not support).

    Changes by:
Josh Werner <joshuawerner@mitre.org>
Eli Baum <ebaum@mitre.org>
G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agopbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zapi)
G. Paul Ziemba [Wed, 19 Jul 2023 14:59:04 +0000 (07:59 -0700)]
pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (zapi)

    Subset: ZAPI changes to send the new data

    Also adds filter_bm field; currently for PBR_FILTER_PCP, but in the
    future to be used for all of the filter fields.

    Changes by:
Josh Werner <joshuawerner@mitre.org>
Eli Baum <ebaum@mitre.org>
G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agopbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (pbr feature)
G. Paul Ziemba [Wed, 19 Jul 2023 14:58:02 +0000 (07:58 -0700)]
pbrd: add vlan filters pcp/vlan-id/vlan-flags; ip-protocol any (pbr feature)

    Subset: feature in PBR

    New PBR rule fields:

    match ip-protocol (was only tcp|udp, now any value in /etc/protocols)
    match pcp (0-7)
    match vlan (1-4094)
    match vlan (tagged|untagged|untagged-or-zero)

    Filter flags
Add filter_bm (flags) field internally to indicate which
filter fields should be considered active. Bit definitions
as in lib/pbr.h.

This commit uses only the PBR_FILTER_PCP bit, but other
fields will be added in future commits. (Fixes bug related
to determining set/not-set state of pcp filter)

Shift vlan filter flags to lib/pbr.h

    Changes by:
Josh Werner <joshuawerner@mitre.org>
Eli Baum <ebaum@mitre.org>
G. Paul Ziemba <paulz@labn.net>

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agoMerge pull request #13629 from anlancs/fix/pimd-order-pimreg
Donald Sharp [Wed, 19 Jul 2023 14:34:05 +0000 (10:34 -0400)]
Merge pull request #13629 from anlancs/fix/pimd-order-pimreg

pimd: Fix wrong creating order for pimreg

21 months agozebra:fix a zebra crash issue caused by mac change 14054/head
Jack.zhang [Wed, 19 Jul 2023 09:46:46 +0000 (17:46 +0800)]
zebra:fix a zebra crash issue caused by mac change

When the MAC address of the neighbor changes, a possible crash issue may occur.

In the zebra_evpn_local_neigh_update function, the value of old_zmac (n->mac) will be updated to the new MAC address when the neighbor's MAC address changes.
The pointer to the memory that this pointer points to may be released in the zebra_evpn_local_neigh_deref_mac function. This will cause old_zmac to become a dangling pointer. Accessing this dangling pointer in the zebra_evpn_ip_inherit_dad_from_mac function below will cause the zebra process to crash.

Here is the backtrace:
(gdb) bt
0  0x00007fc12c5f1fbf in raise () from /lib/x86_64-linux-gnu/libpthread.so.0
1  0x00007fc12d52e19c in core_handler (signo=11, siginfo=0x7ffda1fd1570, context=<optimized out>) at lib/sigevent.c:262
2  <signal handler called>
3  zebra_evpn_ip_inherit_dad_from_mac (zvrf=<optimized out>, old_zmac=0x5579ac3ca520, new_zmac=0x5579aba82f80, nbr=0x5579abd65ec0) at zebra/ze
4  0x00005579aa8dbf6d in zebra_evpn_local_neigh_update (zevpn=0x5579abb81440, ifp=ifp@entry=0x5579ab8a1640, ip=ip@entry=0x7ffda1fd1b40, macadd
   local_inactive=local_inactive@entry=253, dp_static=false) at zebra/zebra_evpn_neigh.c:1729
5  0x00005579aa9190a9 in zebra_vxlan_handle_kernel_neigh_update (ifp=ifp@entry=0x5579ab8a1640, link_if=link_if@entry=0x5579abd14f90, ip=ip@ent
   is_ext=is_ext@entry=false, is_router=<optimized out>, local_inactive=false, dp_static=false) at zebra/zebra_vxlan.c:3791
6  0x00005579aa8b3048 in netlink_ipneigh_change (h=0x7ffda1fd1d50, len=<optimized out>, ns_id=<optimized out>) at zebra/rt_netlink.c:3649
7  0x00005579aa8ac667 in netlink_parse_info (filter=filter@entry=0x5579aa8ab630 <netlink_information_fetch>, nl=nl@entry=0x5579ab5861e8, zns=z
   startup=startup@entry=0) at zebra/kernel_netlink.c:965
8  0x00005579aa8ac8c8 in kernel_read (thread=<optimized out>) at zebra/kernel_netlink.c:402
9  0x00007fc12d53e60b in thread_call (thread=thread@entry=0x7ffda1fd9fd0) at lib/thread.c:1834
10 0x00007fc12d4fba78 in frr_run (master=0x5579ab3a1740) at lib/libfrr.c:1155
11 0x00005579aa89c6e3 in main (argc=11, argv=0x7ffda1fda3c8) at zebra/main.c:485
(gdb) f 3
3  zebra_evpn_ip_inherit_dad_from_mac (zvrf=<optimized out>, old_zmac=0x5579ac3ca520, new_zmac=0x5579aba82f80, nbr=0x5579abd65ec0) at zebra/ze
1230 zebra/zebra_evpn_neigh.c: No such file or directory.
(gdb) p *old_zmac
Cannot access memory at address 0x5579ac3ca520
(gdb)

To fix this issue, the ZEBRA_MAC_DUPLICATE flag should be retrieved before old_zmac is released and used in the zebra_evpn_ip_inherit_dad_from_mac function.

Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
21 months agotests: Update join state in verify_upstream_iif API 14058/head
Kuldeep Kashyap [Wed, 19 Jul 2023 13:51:01 +0000 (19:21 +0530)]
tests: Update join state in verify_upstream_iif API

When JoinState is not passed to API it is expected to
be in Joined state, there was a minor bug in API, where
it was printng JoinState as None, which is default value
in API. Updated value to print Joined when verification
fails.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
21 months agoMerge pull request #13951 from fdumontet6WIND/as_path_exclude_reg
Donatas Abraitis [Wed, 19 Jul 2023 13:35:33 +0000 (16:35 +0300)]
Merge pull request #13951 from fdumontet6WIND/as_path_exclude_reg

bgpd: add set as-path exclude acl-list command

21 months agobgpd: Fix coverity for EVPN 14003/head
Kantesh Mundaragi [Mon, 30 May 2022 13:42:06 +0000 (06:42 -0700)]
bgpd: Fix coverity for EVPN

Reported Warning:
Compare member by member to check object equality

RCA:
struct evpn_addr contains padding

Authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
21 months agoMerge pull request #14049 from opensourcerouting/fix/initialize_some_bools
mobash-rasool [Wed, 19 Jul 2023 11:41:24 +0000 (17:11 +0530)]
Merge pull request #14049 from opensourcerouting/fix/initialize_some_bools

bgpd: Initialize bgp_nht_ifp_table_handle() bools

21 months agozebra:unlock node after route_next 14055/head
guozhongfeng [Wed, 19 Jul 2023 11:39:22 +0000 (19:39 +0800)]
zebra:unlock node after route_next

When route_next return node, it has lock the node. if return or break loop, should unlock node.
Signed-off-by: guozhongfeng <guozhongfeng.gzf@alibaba-inc.com>
21 months agotests: add one test to bgp_exclude_aspath_exclude.py 13951/head
Francois Dumontet [Wed, 12 Jul 2023 17:55:52 +0000 (19:55 +0200)]
tests: add one test to bgp_exclude_aspath_exclude.py

add support of  set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agodoc: set as-path exclude as-path-access-list
Francois Dumontet [Wed, 12 Jul 2023 17:54:37 +0000 (19:54 +0200)]
doc: set as-path exclude as-path-access-list

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agobgpd: add set as-path exclude acl-list command
Francois Dumontet [Wed, 12 Jul 2023 17:44:02 +0000 (19:44 +0200)]
bgpd: add set as-path exclude acl-list command

A route-map applied on incoming BGP updates is not able
to exclude the unwanted as segments, based on an AS path
access-list.

The below configuration illustrates the case:

router bgp 65001

address-family ipv4 unicast
 neighbor 192.168.1.2 route-map rule_2 in
exit-address-family

bgp as-path access-list RULE permit ^65

route-map rule_2 permit 10
 set as-path exclude as-path-access-list RULE

```
BGP routing table entry for 10.10.10.10/32, version 13
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.10.65
  65000 1 2 3 123
    192.168.10.65 from 192.168.10.65 (10.10.10.11)
      Origin IGP, metric 0, valid, external, best (First path received)
```

After:

```
do show ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 15
    Paths: (1 available, best #1, table default)
      Advertised to non peer-group peers:
      192.168.10.65
      2 3 123
        192.168.10.65 from 192.168.10.65 (10.10.10.11)
          Origin IGP, metric 0, valid, external, best (First path
received)
```

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
21 months agoMerge pull request #14048 from LabNConsulting/chopps/staticd-stop-parsing
Donald Sharp [Tue, 18 Jul 2023 23:18:12 +0000 (19:18 -0400)]
Merge pull request #14048 from LabNConsulting/chopps/staticd-stop-parsing

static: stop vtysh from sending VRF commands to staticd

21 months agobgpd: Initialize bgp_nht_ifp_table_handle() bools 14049/head
Donatas Abraitis [Tue, 18 Jul 2023 17:45:47 +0000 (20:45 +0300)]
bgpd: Initialize bgp_nht_ifp_table_handle() bools

Assuming field 'ifindex_ipv6_ll' is not equal to field 'ifindex', then
nhop_found is just a garbage, let's avoid that.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agostatic: stop sending VRF commands to staticd from vtysh 14048/head
Christian Hopps [Tue, 18 Jul 2023 16:45:04 +0000 (12:45 -0400)]
static: stop sending VRF commands to staticd from vtysh

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agoMerge pull request #10136 from idryzhov/frr-reload-exit
Mark Stapp [Tue, 18 Jul 2023 16:19:10 +0000 (12:19 -0400)]
Merge pull request #10136 from idryzhov/frr-reload-exit

tools: always append "exit" in frr-reload.py

21 months agoMerge pull request #13918 from rameshabhinay/evpn_memleak
Jafar Al-Gharaibeh [Tue, 18 Jul 2023 15:59:20 +0000 (10:59 -0500)]
Merge pull request #13918 from rameshabhinay/evpn_memleak

bgpd: fix bgp evpn cli memory leaks.

21 months agoMerge pull request #11831 from anlancs/fix/cleanup-default
Quentin Young [Tue, 18 Jul 2023 15:15:39 +0000 (15:15 +0000)]
Merge pull request #11831 from anlancs/fix/cleanup-default

zebra: remove unnecessary check for default vrf

21 months agoMerge pull request #14041 from opensourcerouting/fix/memory_leak_bgp_redistribute_add
Donald Sharp [Tue, 18 Jul 2023 14:55:22 +0000 (10:55 -0400)]
Merge pull request #14041 from opensourcerouting/fix/memory_leak_bgp_redistribute_add

bgpd: Do not try to redistribute routes if we are shutting down

21 months agoMerge pull request #14015 from opensourcerouting/fix/bgpd_refactor_bgp_update_withdra...
Russ White [Tue, 18 Jul 2023 13:42:07 +0000 (09:42 -0400)]
Merge pull request #14015 from opensourcerouting/fix/bgpd_refactor_bgp_update_withdraw_safi

bgpd: Refactor a bit bgp_{update,withdraw} functions

21 months agoMerge pull request #14037 from opensourcerouting/feature/enable_software_capability_f...
Donald Sharp [Tue, 18 Jul 2023 13:19:19 +0000 (09:19 -0400)]
Merge pull request #14037 from opensourcerouting/feature/enable_software_capability_for_datacenter_profile_by_default

bgpd: Enable software version capability for datacenter profile

21 months agoMerge pull request #13868 from zice312963205/zly_mapflag
Russ White [Tue, 18 Jul 2023 13:14:50 +0000 (09:14 -0400)]
Merge pull request #13868 from zice312963205/zly_mapflag

bgpd:Fixing a conflict issue between rmap_in_change_flag and rmap_out…

21 months agoMerge pull request #13974 from pguibert6WIND/bgp_nht_other_if_cases_2
Russ White [Tue, 18 Jul 2023 13:10:50 +0000 (09:10 -0400)]
Merge pull request #13974 from pguibert6WIND/bgp_nht_other_if_cases_2

Bgp nht other if cases 2

21 months agoMerge pull request #12964 from FRIDM636/bmp-basic-test
Russ White [Tue, 18 Jul 2023 12:53:07 +0000 (08:53 -0400)]
Merge pull request #12964 from FRIDM636/bmp-basic-test

Add basic bgp bmp test

21 months agoMerge pull request #13140 from rgwan/master
Donatas Abraitis [Tue, 18 Jul 2023 11:58:05 +0000 (14:58 +0300)]
Merge pull request #13140 from rgwan/master

ospfd: Show advertise router in 'show ip ospf route' command

21 months agobgpd: Do not try to redistribute routes if we are shutting down 14041/head
Donatas Abraitis [Tue, 18 Jul 2023 10:14:08 +0000 (13:14 +0300)]
bgpd: Do not try to redistribute routes if we are shutting down

When switching `router bgp`, `no router bgp` and doing redistributions, we should
ignore this action, otherwise memory leak happens:

```
Indirect leak of 400 byte(s) in 2 object(s) allocated from:
    0 0x7f81b36b3a06 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:153
    1 0x7f81b327bd2e in qcalloc lib/memory.c:105
    2 0x55f301d28628 in bgp_node_create bgpd/bgp_table.c:92
    3 0x7f81b3309d0b in route_node_new lib/table.c:52
    4 0x7f81b3309d0b in route_node_set lib/table.c:61
    5 0x7f81b330be0a in route_node_get lib/table.c:319
    6 0x55f301ce89df in bgp_redistribute_add bgpd/bgp_route.c:8907
    7 0x55f301dac182 in zebra_read_route bgpd/bgp_zebra.c:593
    8 0x7f81b334dcd7 in zclient_read lib/zclient.c:4179
    9 0x7f81b331d702 in event_call lib/event.c:1995
    10 0x7f81b325d597 in frr_run lib/libfrr.c:1213
    11 0x55f301b94b12 in main bgpd/bgp_main.c:505
    12 0x7f81b2b57082 in __libc_start_main ../csu/libc-start.c:308
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: fix bgp evpn cli memory leaks. 13918/head
Abhinay Ramesh [Mon, 3 Jul 2023 09:40:11 +0000 (09:40 +0000)]
bgpd: fix bgp evpn cli memory leaks.

problem:
In CLI config codeflow there are memory leaks in failure scenario

Fix:
Code changes are done to free ecommunity

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
21 months agopim6d: Fixing core while running MLD conformance test. 14006/head
Abhishek N R [Thu, 13 Jul 2023 09:54:27 +0000 (02:54 -0700)]
pim6d: Fixing core while running MLD conformance test.

While running MLD conformance test 9.2 core is getting generated.

Test setps:
1. ANVL: Listen (for upto <GeneralQueryRecvWaitTime> seconds) on <AIface-0>.
2. DUT: Send MLD General Query Message.
3. ANVL: Send MLD Report Message to <DIface-0> containing:
• IPv6 Source Address field set to link-local IPv6 Address of HOST-1
• IPv6 Destination Address field set to <McastAddrGroup>
• MLD Multicast Address field set to <McastAddrGroup>.
4. ANVL: Wait for <ProcessTime> seconds for DUT to process and add <Mcas- tAddrGroup> to its Multicast Address list.
5. ANVL: Send MLD General Query Message to <DIface-0> containing:
• IPv6 Source Address field set to link-local IPv6 Address of RTR-1 which is numerically less than the link-local IPv6 unicast address of <DIface-0>
• IPv6 Destination Address field set to link-scope all-nodes multicast address.
6. ANVL: Send MLD Multicast-Address-Specific Query Message to <DIface-0> containing:
• IPv6 Source Address field set to link-local IPv6 Address of RTR-1
• IPv6 Destination Address field set to <McastAddrGroup>
• MLD Multicast Address field set to <McastAddrGroup>
• MLD Maximum Response Delay field value set to 0.
7. ANVL: Verify that the Maximum Response Delay timer for <McastAd- drGroup> is set to zero.

While running above test, when group specific query is received we start gm_t_sg_expire timer.
Once this timer expires, we clear the corresponding entry.
During this sg->state was still set to JOIN. This happened because receiver went down without sending leave.

Added a condition to update the sg->state before starting the timer.
If receiver goes down without sending leave we will update sg->state to GM_SG_JOIN_EXPIRING or GM_SG_NOPRUNE_EXPIRING based on previous state.
If we receive a join then sg->state will be refreshed and will be updated to JOIN state.

Fixes: #13387
Signed-off-by: Abhishek N R <abnr@vmware.com>
21 months agoMerge pull request #14033 from donaldsharp/zebra_same_route
Donatas Abraitis [Tue, 18 Jul 2023 07:37:15 +0000 (10:37 +0300)]
Merge pull request #14033 from donaldsharp/zebra_same_route

Zebra same route

21 months agoMerge pull request #14009 from rgangam-PAN/master
Donatas Abraitis [Tue, 18 Jul 2023 06:47:10 +0000 (09:47 +0300)]
Merge pull request #14009 from rgangam-PAN/master

test_grpc.cpp Fix Compilation Error and RuntimePath for finding grpc.so

21 months agobgpd: Send software-version capability by default 14037/head
Donatas Abraitis [Mon, 17 Jul 2023 19:25:39 +0000 (22:25 +0300)]
bgpd: Send software-version capability by default

Useful to have it for datacenter profile only, disabled for traditional.

If the peer is not established or established, but has no description set,
we will show the FRR version instead, which is kinda handy to have instead of
nothing.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: Add SPDX-License-Identifier for bgp_software_version topotest
Donatas Abraitis [Tue, 18 Jul 2023 06:33:36 +0000 (09:33 +0300)]
tests: Add SPDX-License-Identifier for bgp_software_version topotest

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agoospfd: Support show intra-area network type in 'show ip ospf route' command 13140/head
Zhiyuan Wan [Mon, 3 Apr 2023 08:21:15 +0000 (16:21 +0800)]
ospfd: Support show intra-area network type in 'show ip ospf route' command

User can now use 'show ip ospf route detail' command to distinguish
intra-area stub network and transit network.
Transit network will be displayed as 'N T prefix ...'.

NOTICE: Json output format has been changed, intra-area transit networks
will have a new attribute 'transit' and value is 'true'.
And 'adv' (means advertise router) change to 'advertisedRouter'.

Example output:

bsp-debianrt-exp1# show ip ospf route detail
Codes: N  - network     T - transitive
       IA - inter-area  E - external route
       D  - destination R - router

============ OSPF network routing table ============
N T  10.0.0.0/24           [32] area: 0.0.0.0
                           via 192.168.124.67, ens192
                           adv 10.0.0.5
N    10.0.30.0/24          [33] area: 0.0.0.0
                           via 192.168.124.67, ens192
                           adv 10.0.0.5
...

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agoospfd: Fix wrong advertise router calculation in transit network
Zhiyuan Wan [Mon, 3 Apr 2023 06:35:14 +0000 (14:35 +0800)]
ospfd: Fix wrong advertise router calculation in transit network

The ospfd mistakenly copy advertise router from vertex->id, which may
not be correct in an OSPF transit network.

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agoospfd: Support show advertise router in 'show ip ospf route' command
Zhiyuan Wan [Wed, 29 Mar 2023 15:05:20 +0000 (23:05 +0800)]
ospfd: Support show advertise router in 'show ip ospf route' command

Users can now use 'show ip ospf route [detail]' command to show the
originator of each OSPF route item.

Signed-off-by: Zhiyuan Wan <h@iloli.bid>
21 months agotest: fix the topotest case for the bug fix 13868/head
Jack.zhang [Fri, 30 Jun 2023 12:13:36 +0000 (20:13 +0800)]
test: fix the topotest case for the bug fix

Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
21 months agoMerge pull request #14025 from guoguojia2021/guozhongfeng_alibaba
Donald Sharp [Mon, 17 Jul 2023 18:27:56 +0000 (14:27 -0400)]
Merge pull request #14025 from guoguojia2021/guozhongfeng_alibaba

zebra: The command ipv6 nht xxx not work

21 months agozebra: Further handle route replace semantics 14033/head
Donald Sharp [Mon, 17 Jul 2023 14:00:32 +0000 (10:00 -0400)]
zebra: Further handle route replace semantics

When an upper level protocol is installing a route X that needs to be
route replaced and at the same time the same or another protocol installs a
different route that depends on route X for nexthop resolution can leave
us with a state where the route is not accepted because zebra is still
really early in the route replace semantics ( route X is still on the work
Queue to be processed ) then the dependent route would not be installed.
This came up in the bgp_default_originate test cases frequently.

Further extendd the ROUTE_ENTR_ROUTE_REPLACING flag to cover this case
as well.  This has come up because the early route processing queueing
that was implemented late last year.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agotools: Add what FRR thinks as the fib routes for support_bundle
Donald Sharp [Mon, 17 Jul 2023 13:56:06 +0000 (09:56 -0400)]
tools: Add what FRR thinks as the fib routes for support_bundle

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agoMerge pull request #14017 from donaldsharp/bgp_always_compare_med_crash
Donatas Abraitis [Mon, 17 Jul 2023 12:12:46 +0000 (15:12 +0300)]
Merge pull request #14017 from donaldsharp/bgp_always_compare_med_crash

bgpd: Prevent use after free

21 months agoMerge pull request #14027 from LabNConsulting/ziemba-topotests-babel-relax
Donatas Abraitis [Mon, 17 Jul 2023 09:27:38 +0000 (12:27 +0300)]
Merge pull request #14027 from LabNConsulting/ziemba-topotests-babel-relax

tests: test_babel_topo1: tolerate slow results

21 months agoMerge pull request #14011 from opensourcerouting/fix/add_rfc5396_to_supported_list
Jafar Al-Gharaibeh [Mon, 17 Jul 2023 04:53:32 +0000 (23:53 -0500)]
Merge pull request #14011 from opensourcerouting/fix/add_rfc5396_to_supported_list

doc: Add RFC 5396 to the supported BGP RFC list

21 months agotests: test_babel_topo1: tolerate slow results 14027/head
G. Paul Ziemba [Sun, 16 Jul 2023 21:30:24 +0000 (14:30 -0700)]
tests: test_babel_topo1: tolerate slow results

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
21 months agozebra: The command ipv6 nht xxx not work 14025/head
guozhongfeng [Fri, 14 Jul 2023 08:08:50 +0000 (16:08 +0800)]
zebra: The command ipv6 nht xxx not work

If the command is ipv6 nht protocol route-map rmap, this parameter should use AFI_IP6

Signed-off-by: guozhongfeng <guozhongfeng.gzf@alibaba-inc.com>
21 months agoMerge pull request #14019 from LabNConsulting/chopps/fix-mgmtd-assert
Donald Sharp [Sat, 15 Jul 2023 20:05:09 +0000 (16:05 -0400)]
Merge pull request #14019 from LabNConsulting/chopps/fix-mgmtd-assert

fix double lock bug and cmd resume early bugs

21 months agoMerge pull request #14020 from LabNConsulting/chopps/check-bt-cores-per-test
Donald Sharp [Sat, 15 Jul 2023 19:59:25 +0000 (15:59 -0400)]
Merge pull request #14020 from LabNConsulting/chopps/check-bt-cores-per-test

check for bt and cores per test

21 months agoMerge pull request #14008 from LabNConsulting/chopps/fix-backtrace
Donald Sharp [Sat, 15 Jul 2023 19:59:15 +0000 (15:59 -0400)]
Merge pull request #14008 from LabNConsulting/chopps/fix-backtrace

tests: fix/improve the printing of backtrace from cores

21 months agotests: backtraces/cores now fail tests 14020/head
Christian Hopps [Sat, 15 Jul 2023 04:04:05 +0000 (00:04 -0400)]
tests: backtraces/cores now fail tests

Previously we just raised an error for the test file with possibly all tests
passing. Now we fail any test that produces new backtraces or cores. This
just works a lot better with analysis and even CI.

Also be less verbose to the console after failure runs, just show error
level and above logs. The log files still capture all levels (DEBUG).

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agotests: add regression test for issue $13920 14019/head
Christian Hopps [Fri, 14 Jul 2023 23:29:57 +0000 (19:29 -0400)]
tests: add regression test for issue $13920

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agovtysh: track and fix file-lock use in the workaround from 2004
Christian Hopps [Fri, 14 Jul 2023 22:21:55 +0000 (18:21 -0400)]
vtysh: track and fix file-lock use in the workaround from 2004

There's a workaround in the code from a bug from back in 2004, it ends
and re-enters config mode anytime an `exit` is done from a level below
the top-level config node (e.g., from a `router isis` node). We need to
re-enter config mode with or without a lock according to how we actually
entered it to begin with.

fixes #13920

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agolib: mgmtd: only clear pending for the in-progress command
Christian Hopps [Fri, 14 Jul 2023 20:13:54 +0000 (16:13 -0400)]
lib: mgmtd: only clear pending for the in-progress command

The lock/unlocks are being done short-circuit so they are never pending;
however, the handling of the unlock notification was always resuming the command
if pending was set. In all cases pending is set for another command. For example
implicit commit locks then when notified its done unlocks which was clearing the
set-config pending flag and resuming that command incorrectly.

Signed-off-by: Christian Hopps <chopps@labn.net>
21 months agobgpd: Prevent use after free 14017/head
Donald Sharp [Fri, 14 Jul 2023 16:14:20 +0000 (12:14 -0400)]
bgpd: Prevent use after free

When running bgp_always_compare_med, I am frequently seeing a crash
After running with valgrind I am seeing this and a invalid write
immediately after this as well.

==311743== Invalid read of size 2
==311743==    at 0x4992421: route_map_counter_decrement (routemap.c:3308)
==311743==    by 0x35664D: peer_route_map_unset (bgpd.c:7259)
==311743==    by 0x306546: peer_route_map_unset_vty (bgp_vty.c:8037)
==311743==    by 0x3066AC: no_neighbor_route_map (bgp_vty.c:8081)
==311743==    by 0x49078DE: cmd_execute_command_real (command.c:990)
==311743==    by 0x4907A63: cmd_execute_command (command.c:1050)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)
==311743==    by 0x1F7655: main (bgp_main.c:505)
==311743==  Address 0x9ec2180 is 64 bytes inside a block of size 120 free'd
==311743==    at 0x484B27F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==311743==    by 0x495A1BA: qfree (memory.c:130)
==311743==    by 0x498D412: route_map_free_map (routemap.c:748)
==311743==    by 0x498D176: route_map_add (routemap.c:672)
==311743==    by 0x498D79B: route_map_get (routemap.c:857)
==311743==    by 0x499C256: lib_route_map_create (routemap_northbound.c:102)
==311743==    by 0x49702D8: nb_callback_create (northbound.c:1234)
==311743==    by 0x497107F: nb_callback_configuration (northbound.c:1578)
==311743==    by 0x4971693: nb_transaction_process (northbound.c:1709)
==311743==    by 0x496FCF4: nb_candidate_commit_apply (northbound.c:1103)
==311743==    by 0x496FE4E: nb_candidate_commit (northbound.c:1136)
==311743==    by 0x497798F: nb_cli_classic_commit (northbound_cli.c:49)
==311743==    by 0x4977B4F: nb_cli_pending_commit_check (northbound_cli.c:88)
==311743==    by 0x49078C1: cmd_execute_command_real (command.c:987)
==311743==    by 0x4907B44: cmd_execute_command (command.c:1068)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)
==311743==    by 0x1F7655: main (bgp_main.c:505)
==311743==  Block was alloc'd at
==311743==    at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==311743==    by 0x495A068: qcalloc (memory.c:105)
==311743==    by 0x498D0C8: route_map_new (routemap.c:646)
==311743==    by 0x498D128: route_map_add (routemap.c:658)
==311743==    by 0x498D79B: route_map_get (routemap.c:857)
==311743==    by 0x499C256: lib_route_map_create (routemap_northbound.c:102)
==311743==    by 0x49702D8: nb_callback_create (northbound.c:1234)
==311743==    by 0x497107F: nb_callback_configuration (northbound.c:1578)
==311743==    by 0x4971693: nb_transaction_process (northbound.c:1709)
==311743==    by 0x496FCF4: nb_candidate_commit_apply (northbound.c:1103)
==311743==    by 0x496FE4E: nb_candidate_commit (northbound.c:1136)
==311743==    by 0x497798F: nb_cli_classic_commit (northbound_cli.c:49)
==311743==    by 0x4977B4F: nb_cli_pending_commit_check (northbound_cli.c:88)
==311743==    by 0x49078C1: cmd_execute_command_real (command.c:987)
==311743==    by 0x4907B44: cmd_execute_command (command.c:1068)
==311743==    by 0x490801F: cmd_execute (command.c:1217)
==311743==    by 0x49C5535: vty_command (vty.c:551)
==311743==    by 0x49C7459: vty_execute (vty.c:1314)
==311743==    by 0x49C97D1: vtysh_read (vty.c:2223)
==311743==    by 0x49BE5E2: event_call (event.c:1995)
==311743==    by 0x494786C: frr_run (libfrr.c:1204)

Effectively the route_map that is being stored has been freed already
but we have not cleaned up properly yet.  Go through and clean the
code up by ensuring that the pointer actually exists instead of trusting
it does when doing the decrement operation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
21 months agobgpd: Drop bgp_static_update_safi() function 14015/head
Donatas Abraitis [Fri, 14 Jul 2023 11:10:14 +0000 (14:10 +0300)]
bgpd: Drop bgp_static_update_safi() function

Combine bgp_static_update() and bgp_static_update_safi() into a single one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agobgpd: Drop bgp_static_withdraw_safi() function
Donatas Abraitis [Fri, 14 Jul 2023 10:34:47 +0000 (13:34 +0300)]
bgpd: Drop bgp_static_withdraw_safi() function

Combine bgp_static_withdraw() and bgp_static_withdraw_safi() into a single one.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
21 months agotests: fix/improve the printing of backtrace from cores 14008/head
Christian Hopps [Fri, 14 Jul 2023 00:44:53 +0000 (20:44 -0400)]
tests: fix/improve the printing of backtrace from cores

Signed-off-by: Christian Hopps <chopps@labn.net>