]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
16 months agozebra: Cleanup linked list on shutdown in label manager
Donald Sharp [Mon, 11 Dec 2023 20:26:20 +0000 (15:26 -0500)]
zebra: Cleanup linked list on shutdown in label manager

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agozebra: Properly unregister hook on shutdown
Donald Sharp [Mon, 11 Dec 2023 20:22:07 +0000 (15:22 -0500)]
zebra: Properly unregister hook on shutdown

the zebra pseudo wire code was registering a callback
per vrf.  These callbacks are not per vrf based.  They
are vrf agnostic so this was a mistake.  Modify the code
to on startup register once and on shutdown unregister once.

Finally rename the zebra_pw_init and zebra_pw_exit functions
to more properly reflect when they are called.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agoMerge pull request #14981 from opensourcerouting/fix/remove_depracated_code
Donald Sharp [Mon, 11 Dec 2023 18:53:49 +0000 (13:53 -0500)]
Merge pull request #14981 from opensourcerouting/fix/remove_depracated_code

bgpd: Remove deprecated code for bgpStatusCodes/bgpOriginCodes

16 months agobgpd: Remove deprecated code for bgpStatusCodes/bgpOriginCodes 14981/head
Donatas Abraitis [Mon, 11 Dec 2023 12:31:46 +0000 (14:31 +0200)]
bgpd: Remove deprecated code for bgpStatusCodes/bgpOriginCodes

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
16 months agoMerge pull request #14967 from opensourcerouting/fix/bgpd_enforce_first_as_peer-groups
Donald Sharp [Sun, 10 Dec 2023 19:32:46 +0000 (14:32 -0500)]
Merge pull request #14967 from opensourcerouting/fix/bgpd_enforce_first_as_peer-groups

bgpd: Respect enforce-first-as command for peer-groups according to the defaults

16 months agoMerge pull request #14962 from Orange-OpenSource/ospf-te
Donald Sharp [Sun, 10 Dec 2023 19:31:40 +0000 (14:31 -0500)]
Merge pull request #14962 from Orange-OpenSource/ospf-te

ospfd: Correct SID check size

16 months agoMerge pull request #14968 from opensourcerouting/fix/missing_whitespace
Donald Sharp [Sun, 10 Dec 2023 19:30:27 +0000 (14:30 -0500)]
Merge pull request #14968 from opensourcerouting/fix/missing_whitespace

zebra: Add missing whitespace when printing route entry status

16 months agoMerge pull request #14971 from opensourcerouting/o6-hidden-area
Donald Sharp [Sun, 10 Dec 2023 19:29:42 +0000 (14:29 -0500)]
Merge pull request #14971 from opensourcerouting/o6-hidden-area

ospf6d: remove hidden obsolete command

16 months agoMerge pull request #14976 from vjardin/fixUbuntuModprobe
Donald Sharp [Sun, 10 Dec 2023 13:36:33 +0000 (08:36 -0500)]
Merge pull request #14976 from vjardin/fixUbuntuModprobe

docker: fix /sbin/modprobe missing

16 months agodocker: fix /sbin/modprobe missing 14976/head
Vincent Jardin [Sat, 9 Dec 2023 23:45:22 +0000 (23:45 +0000)]
docker: fix /sbin/modprobe missing

kmod is needed in order to get modprobe

Signed-off-by: Vincent Jardin <vjardin@free.fr>
16 months agoMerge pull request #14975 from imzyxwvu/tidy-aggregate-duplication
Donatas Abraitis [Sat, 9 Dec 2023 18:03:00 +0000 (20:03 +0200)]
Merge pull request #14975 from imzyxwvu/tidy-aggregate-duplication

bgpd: Remove duplicated code in `bgp_aggregate_route`

16 months agobgpd: Remove duplicated code in `bgp_aggregate_route` 14975/head
zyxwvu Shi [Sat, 9 Dec 2023 11:26:45 +0000 (19:26 +0800)]
bgpd: Remove duplicated code in `bgp_aggregate_route`

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
16 months agoospf6d: remove hidden obsolete commands 14971/head
Rafael Zalamena [Thu, 7 Dec 2023 15:24:04 +0000 (12:24 -0300)]
ospf6d: remove hidden obsolete commands

These commands were hidden in FRR 8.1 for the transition period and
never removed.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
16 months agotopotests: remove obsolete OSPFv3 area config
Rafael Zalamena [Thu, 7 Dec 2023 20:16:42 +0000 (17:16 -0300)]
topotests: remove obsolete OSPFv3 area config

Don't use 'interface WORD area A.B.C.D' for enabling OSPFv3 areas on
interfaces and instead use the standardized 'ipv6 ospf6 area A.B.C.D'.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
16 months agoospfd: Correct SID check size 14962/head
Olivier Dugeon [Thu, 7 Dec 2023 13:53:16 +0000 (14:53 +0100)]
ospfd: Correct SID check size

Segment Router Identifier (SID) could be an index (4 bytes) within a range
(SRGB or SRLB) or an MPLS label (3 bytes). Thus, before calling check_size
macro to verify SID TLVs size, it is mandatory to determine the SID type to
avoid wrong assert.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
16 months agoMerge pull request #14964 from pguibert6WIND/nhg_del_in_queue
Donald Sharp [Fri, 8 Dec 2023 12:36:44 +0000 (07:36 -0500)]
Merge pull request #14964 from pguibert6WIND/nhg_del_in_queue

zebra: enqueue NHG_DEL in rib_nhg meta queue

16 months agozebra: Add missing whitespace when printing route entry status 14968/head
Donatas Abraitis [Fri, 8 Dec 2023 11:57:56 +0000 (13:57 +0200)]
zebra: Add missing whitespace when printing route entry status

Before:

```
status: Removed ReplacingInstalled
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
16 months agobgpd: Respect enforce-first-as command for peer-groups according to the defaults 14967/head
Donatas Abraitis [Fri, 8 Dec 2023 11:00:08 +0000 (13:00 +0200)]
bgpd: Respect enforce-first-as command for peer-groups according to the defaults

This was missed for peer-groups. Moved this default handling from peer_create()
to peer_new() which is also used by peer_group_get().

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
16 months agoMerge pull request #14963 from donaldsharp/bgp_nht_fix
Donatas Abraitis [Fri, 8 Dec 2023 09:40:37 +0000 (11:40 +0200)]
Merge pull request #14963 from donaldsharp/bgp_nht_fix

bgpd: Ensure BGP does not stop monitoring nexthops

16 months agoMerge pull request #14889 from fdumontet6WIND/snmpv2
Donatas Abraitis [Fri, 8 Dec 2023 04:55:52 +0000 (06:55 +0200)]
Merge pull request #14889 from fdumontet6WIND/snmpv2

bgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable

16 months agoMerge pull request #14936 from LabNConsulting/chopps/mgmt-dbg-improve
Donald Sharp [Thu, 7 Dec 2023 16:20:54 +0000 (11:20 -0500)]
Merge pull request #14936 from LabNConsulting/chopps/mgmt-dbg-improve

Chopps/mgmt dbg improve

16 months agozebra: enqueue NHG_DEL in rib_nhg meta queue 14964/head
Philippe Guibert [Thu, 7 Dec 2023 14:26:47 +0000 (15:26 +0100)]
zebra: enqueue NHG_DEL in rib_nhg meta queue

The NHG_DEL operation is done directly from ZAPI call, whereas
the NHG_ADD operation is done in the rib_nhg meta queue.

This may be problematic when ADD is followed by DEL. Imagine a
scenarion with two protocol NHIDs. <NH1> depends of <NH2> and
<NH3>. The deletion of <NH3> at the protocol level will trigger
2 messages to ZEBRA: NHG_ADD(<NH1>) and NHG_DEL(<NH3>).

Those operations are properly enqueued in ZAPI, but in the end,
the NHG_DEL is executed first. This causes NHG_ADD to unlink an
already freed NHG.

Fix this by consistently enqueuing NHG_DEL and NHG_ADD operations.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agoMerge pull request #14795 from donaldsharp/zebra_notify_admin_lost
Mark Stapp [Thu, 7 Dec 2023 13:30:00 +0000 (08:30 -0500)]
Merge pull request #14795 from donaldsharp/zebra_notify_admin_lost

zebra: Fix non-notification of better admin won

16 months agoMerge pull request #14957 from donaldsharp/zebra_noprefixroute
Donatas Abraitis [Thu, 7 Dec 2023 13:24:10 +0000 (15:24 +0200)]
Merge pull request #14957 from donaldsharp/zebra_noprefixroute

Add ability to handle `noprefixroute` to zebra

16 months agobgpd: Ensure BGP does not stop monitoring nexthops 14963/head
Donald Sharp [Mon, 6 Nov 2023 18:02:01 +0000 (13:02 -0500)]
bgpd: Ensure BGP does not stop monitoring nexthops

In some cases BGP can be monitoring the same prefix
in both the nexthop and import check tables.  If this
is the case, when unregistering one bnc from one table
make sure we are not still registered in the other

Example of the problem:

r1(config-router)# address-family ipv4 uni
r1(config-router-af)# no network 192.168.100.41/32
r1(config-router-af)# exit

r1# show bgp import-check-table
Current BGP import check cache:
r1# show bgp nexthop
Current BGP nexthop cache:
 192.168.100.41 valid [IGP metric 0], #paths 1, peer 192.168.100.41
  if r1-eth0
  Last update: Wed Dec  6 11:01:40 2023

BGP now believes it is only watching 192.168.100.41 in the nexthop
cache, but zebra doesn't have anything:

r1# show ip import-check
VRF default:
 Resolve via default: on
r1# show ip nht
VRF default:
 Resolve via default: on

So if anything happens to the route that is being matched for
192.168.100.41 bgp is no longer going to be notified about this.

The source of this problem is that zebra has dropped the two different
tables into 1 table, while bgp has 2 tables to track this.  The solution
to this problem (other than the rewrite that is being done ) is to have
BGP have a bit of smarts about looking in both tables for the bnc and
if found in both don't send the delete of the prefix tracking to zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agotests: Add a noprefixroute test 14957/head
Donald Sharp [Wed, 6 Dec 2023 14:27:09 +0000 (09:27 -0500)]
tests: Add a noprefixroute test

Add a simple test case to ensure that the noprefixroute
code stays working in the future.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agozebra: Add connected with noprefixroute
Donald Sharp [Wed, 6 Dec 2023 13:33:31 +0000 (08:33 -0500)]
zebra: Add connected with noprefixroute

Add ability for the connected routes to know
if they are a prefix route or not.

sharpd@eva:/work/home/sharpd/frr1$ ip addr show dev dummy1
13: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether aa:93:ce:ce:3f:62 brd ff:ff:ff:ff:ff:ff
    inet 192.168.55.1/24 scope global noprefixroute dummy1
       valid_lft forever preferred_lft forever
    inet 192.168.56.1/24 scope global dummy1
       valid_lft forever preferred_lft forever
    inet6 fe80::a893:ceff:fece:3f62/64 scope link
       valid_lft forever preferred_lft forever

sharpd@eva:/work/home/sharpd/frr1$ sudo vtysh -c "show int dummy1"
Interface dummy1 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 13 metric 0 mtu 1500 speed 0 txqlen 1000
  flags: <UP,BROADCAST,RUNNING,NOARP>
  Type: Ethernet
  HWaddr: aa:93:ce:ce:3f:62
  inet 192.168.55.1/24 noprefixroute
  inet 192.168.56.1/24
  inet6 fe80::a893:ceff:fece:3f62/64
  Interface Type Other
  Interface Slave Type None
  protodown: off

sharpd@eva:/work/home/sharpd/frr1$ sudo vtysh -c "show ip route"
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, 00:00:08
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr2 linkdown, 00:00:08
L>* 192.168.44.1/32 is directly connected, dummy2, 00:00:08
L>* 192.168.55.1/32 is directly connected, dummy1, 00:00:08
C>* 192.168.56.0/24 is directly connected, dummy1, 00:00:08
L>* 192.168.56.1/32 is directly connected, dummy1, 00:00:08
L>* 192.168.119.205/32 is directly connected, enp13s0, 00:00:08

sharpd@eva:/work/home/sharpd/frr1$ ip route show
default via 192.168.119.1 dev enp13s0 proto dhcp metric 100
169.254.0.0/16 dev virbr2 scope link metric 1000 linkdown
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.45.0/24 dev virbr2 proto kernel scope link src 192.168.45.1 linkdown
192.168.56.0/24 dev dummy1 proto kernel scope link src 192.168.56.1
192.168.119.0/24 dev enp13s0 proto kernel scope link src 192.168.119.205 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

sharpd@eva:/work/home/sharpd/frr1$ ip route show table 255
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
local 172.17.0.1 dev docker0 proto kernel scope host src 172.17.0.1
broadcast 172.17.255.255 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
local 192.168.44.1 dev dummy2 proto kernel scope host src 192.168.44.1
broadcast 192.168.44.255 dev dummy2 proto kernel scope link src 192.168.44.1
local 192.168.45.1 dev virbr2 proto kernel scope host src 192.168.45.1
broadcast 192.168.45.255 dev virbr2 proto kernel scope link src 192.168.45.1 linkdown
local 192.168.55.1 dev dummy1 proto kernel scope host src 192.168.55.1
broadcast 192.168.55.255 dev dummy1 proto kernel scope link src 192.168.55.1
local 192.168.56.1 dev dummy1 proto kernel scope host src 192.168.56.1
broadcast 192.168.56.255 dev dummy1 proto kernel scope link src 192.168.56.1
local 192.168.119.205 dev enp13s0 proto kernel scope host src 192.168.119.205
broadcast 192.168.119.255 dev enp13s0 proto kernel scope link src 192.168.119.205
local 192.168.122.1 dev virbr0 proto kernel scope host src 192.168.122.1
broadcast 192.168.122.255 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown

Fixes: #14952
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agozebra: Add ability to note that a address is NOPREFIXROUTE
Donald Sharp [Wed, 6 Dec 2023 13:24:01 +0000 (08:24 -0500)]
zebra: Add ability to note that a address is NOPREFIXROUTE

The linux kernel can send up a flag that tells us that the
connected address is not a PREFIXROUTE.  Add the ability
to note this and pass it up from the data plane.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
16 months agoMerge pull request #14922 from louis-6wind/fix-bfd-static-source
Rafael Zalamena [Wed, 6 Dec 2023 12:51:32 +0000 (09:51 -0300)]
Merge pull request #14922 from louis-6wind/fix-bfd-static-source

staticd: fix changing to source auto in bfd monitor

16 months agoMerge pull request #14937 from pguibert6WIND/fix_nhid_suppress
Russ White [Wed, 6 Dec 2023 12:40:57 +0000 (07:40 -0500)]
Merge pull request #14937 from pguibert6WIND/fix_nhid_suppress

sharpd: fix deleting nhid when suppressing nexthop from nh group

16 months agoMerge pull request #14913 from chiragshah6/mdev1
Donatas Abraitis [Wed, 6 Dec 2023 05:56:45 +0000 (07:56 +0200)]
Merge pull request #14913 from chiragshah6/mdev1

pbrd: fix map seq installed flag in json

16 months agopbrd: fix map seq installed flag in json 14913/head
Chirag Shah [Fri, 20 Oct 2023 05:07:15 +0000 (22:07 -0700)]
pbrd: fix map seq installed flag in json

Ticket:#3638598
Testing:

Post fix:
tor-2# show pbr map json
[
  {
    "name":"global-vrf-PBR-map",
    "valid":true,
    "policies":[
      {
        "id":1,
        "sequenceNumber":10,
        "ruleNumber":309,
        "vrfUnchanged":false,
        "installed":true,   <<<< now display correct value
        "installedReason":"Valid",
        "vrfName":"sym_1",
        "matchSrc":"10.1.200.0\/24",
        "matchDst":"10.6.200.0\/24"
      }
    ]
  }

Signed-off-by: Chirag Shah <chirag@nvidia.com>
16 months agoMerge pull request #14870 from opensourcerouting/ospfd-shutdown-leaks
Russ White [Tue, 5 Dec 2023 19:02:35 +0000 (14:02 -0500)]
Merge pull request #14870 from opensourcerouting/ospfd-shutdown-leaks

ospfd: fix deferred shutdown handling

16 months agotests: client testing 14936/head
Christian Hopps [Tue, 28 Nov 2023 19:25:22 +0000 (14:25 -0500)]
tests: client testing

Signed-off-by: Christian Hopps <chopps@labn.net>
16 months agomgmtd: enable conn debug when user enables mgmtd debugs
Christian Hopps [Thu, 30 Nov 2023 03:29:14 +0000 (22:29 -0500)]
mgmtd: enable conn debug when user enables mgmtd debugs

Signed-off-by: Christian Hopps <chopps@labn.net>
16 months agolib: mgmtd: enable conn debugs when user enables client debug
Christian Hopps [Tue, 28 Nov 2023 23:02:44 +0000 (18:02 -0500)]
lib: mgmtd: enable conn debugs when user enables client debug

Signed-off-by: Christian Hopps <chopps@labn.net>
16 months agoMerge pull request #14934 from LabNConsulting/chopps/new-munet-0.13.10
Donald Sharp [Tue, 5 Dec 2023 18:24:39 +0000 (13:24 -0500)]
Merge pull request #14934 from LabNConsulting/chopps/new-munet-0.13.10

tests: import munet 0.13.10

16 months agoMerge pull request #14947 from pguibert6WIND/nexthop_num_no_recurse_static
Russ White [Tue, 5 Dec 2023 16:55:21 +0000 (11:55 -0500)]
Merge pull request #14947 from pguibert6WIND/nexthop_num_no_recurse_static

lib: fix nexthop_group_nexthop_num_no_recurse() is static

16 months agoMerge pull request #14920 from LabNConsulting/chopps/rr-support
Donald Sharp [Tue, 5 Dec 2023 16:42:10 +0000 (11:42 -0500)]
Merge pull request #14920 from LabNConsulting/chopps/rr-support

tests: add support for running things under `rr`.

16 months agoMerge pull request #12600 from donaldsharp/local_routes
Russ White [Tue, 5 Dec 2023 16:00:44 +0000 (11:00 -0500)]
Merge pull request #12600 from donaldsharp/local_routes

*: Introduce Local Host Routes to FRR

16 months agotests: improve test bgp_snmp_bgp4v2mib for snmp multi path support 14889/head
Francois Dumontet [Wed, 4 Oct 2023 16:01:02 +0000 (18:01 +0200)]
tests: improve test bgp_snmp_bgp4v2mib for snmp multi path support

multi path support by snmp implies change in configuration and expected
tests results.

ipv6 trap test output is now ordered to avoid radom result due to
timeline.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agolib: fix nexthop_group_nexthop_num_no_recurse() is static 14947/head
Philippe Guibert [Mon, 27 Nov 2023 08:25:59 +0000 (09:25 +0100)]
lib: fix nexthop_group_nexthop_num_no_recurse() is static

No need to declare 'nexthop_group_nexthop_num_no_recurse()' as external.

Fixes: 98cda54a9543 ("zebra: Add recursive functionality to NHE's")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agoMerge pull request #14939 from rampxxxx/isis_lsp_id
Donatas Abraitis [Tue, 5 Dec 2023 09:11:52 +0000 (11:11 +0200)]
Merge pull request #14939 from rampxxxx/isis_lsp_id

isisd: Fix dislaying LSP ID

16 months agosharpd: fix avoid twice sending NHG_DEL for a nexthop-group 14937/head
Philippe Guibert [Tue, 5 Dec 2023 08:56:41 +0000 (09:56 +0100)]
sharpd: fix avoid twice sending NHG_DEL for a nexthop-group

After removing the nexthop of a nexthop group, when the nexthop group
is removed, a nhg removal failure happens:

> ubuntu2204(config)# nexthop-group CCC
> ubuntu2204(config-nh-group)#  nexthop 192.0.2.211 loop1
> ubuntu2204(config-nh-group)# no  nexthop 192.0.2.211 loop1
> [..]
> 2023/12/05 08:59:22 SHARP: [H3QKG-WH8ZV] Removed nhg 179687505
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# no nexthop-group CCC
> [..]
> 2023/12/05 08:59:27 SHARP: [N030J-V0SFN] Failed removal of nhg 179687505

The NHG_DEL message is sent twice at the nexthop deletion, and at the
nexthop-group deletion. Avoid sending it twice.

Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agoMerge pull request #14940 from chiragshah6/fdev2
Donatas Abraitis [Tue, 5 Dec 2023 08:03:27 +0000 (10:03 +0200)]
Merge pull request #14940 from chiragshah6/fdev2

bgpd: check bgp evpn instance presence in soo

16 months agosharpd: fix deleting nhid when suppressing nexthop from nh group
Philippe Guibert [Mon, 4 Dec 2023 15:03:31 +0000 (16:03 +0100)]
sharpd: fix deleting nhid when suppressing nexthop from nh group

When no nexthops are in a nexthop group, two successive events are
sent: NHG_DEL and NHG_ADD, but only the NHG_DEL one is necessary.
Fixes this by returning in the nhg_add() function.

Fixes: 82beaf6ae520 ("sharpd: fix deleting nhid when suppressing nexthop from nh group")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agoMerge pull request #14938 from rampxxxx/ubi8_protobuf
Donatas Abraitis [Tue, 5 Dec 2023 07:15:38 +0000 (09:15 +0200)]
Merge pull request #14938 from rampxxxx/ubi8_protobuf

docker/ubi8-minimal: add protobuf-c runtime dep

16 months agobgpd: check bgp evpn instance presence in soo 14940/head
Chirag Shah [Tue, 5 Dec 2023 03:23:32 +0000 (19:23 -0800)]
bgpd: check bgp evpn instance presence in soo

    (pi=pi@entry=0x55e86ec1a5a0, evp=evp@entry=0x7fff4edc2160)
    at bgpd/bgp_evpn.c:3623
3623    bgpd/bgp_evpn.c: No such file or directory.
(gdb) info locals
bgp_evpn = 0x0
macvrf_soo = <optimized out>
ret = false
__func__ = <optimized out>

(pi=pi@entry=0x55e86ec1a5a0, evp=evp@entry=0x7fff4edc2160)
    at bgpd/bgp_evpn.c:3623
(bgp=bgp@entry=0x55e86e9cd010, afi=afi@entry=AFI_L2VPN,
    safi=safi@entry=SAFI_EVPN, p=p@entry=0x0,
pi=pi@entry=0x55e86ec1a5a0, import=import@entry=1,
in_vrf_rt=true,
    in_vni_rt=true) at bgpd/bgp_evpn.c:4200
(import=1, pi=pi@entry=0x55e86ec1a5a0, p=p@entry=0x0,
    safi=safi@entry=SAFI_EVPN, afi=afi@entry=AFI_L2VPN,
bgp=bgp@entry=0x55e86e9cd010) at bgpd/bgp_evpn.c:6266
afi=afi@entry=AFI_L2VPN, safi=safi@entry=SAFI_EVPN,
    p=p@entry=0x7fff4edc2160, pi=pi@entry=0x55e86ec1a5a0)
at bgpd/bgp_evpn.c:6266
(peer=peer@entry=0x55e86ea35400, p=p@entry=0x7fff4edc2160,
    addpath_id=addpath_id@entry=0, attr=attr@entry=0x7fff4edc4400,
afi=afi@entry=AFI_L2VPN, safi=<optimized out>,
    safi@entry=SAFI_EVPN, type=9, sub_type=0, prd=0x7fff4edc2120,
label=0x7fff4edc211c, num_labels=1,
    soft_reconfig=0, evpn=0x7fff4edc2130) at bgpd/bgp_route.c:4805
(peer=peer@entry=0x55e86ea35400, afi=afi@entry=AFI_L2VPN,
    safi=safi@entry=SAFI_EVPN, attr=attr@entry=0x7fff4edc4400,
pfx=<optimized out>, psize=psize@entry=34,
    addpath_id=0) at bgpd/bgp_evpn.c:4922
(peer=0x55e86ea35400, attr=0x7fff4edc4400, packet=<optimized out>,
    withdraw=0) at bgpd/bgp_evpn.c:5997
(peer=peer@entry=0x55e86ea35400, attr=attr@entry=0x7fff4edc4400,
    packet=packet@entry=0x7fff4edc43d0,
mp_withdraw=mp_withdraw@entry=0) at bgpd/bgp_packet.c:363
(peer=peer@entry=0x55e86ea35400, size=size@entry=161)
    at bgpd/bgp_packet.c:2076
(thread=<optimized out>) at bgpd/bgp_packet.c:2931

Ticket: #3683053

Signed-off-by: Chirag Shah <chirag@nvidia.com>
16 months agoisisd: Fix dislaying LSP ID 14939/head
lynnemorrison [Tue, 5 Dec 2023 00:41:28 +0000 (19:41 -0500)]
isisd: Fix dislaying LSP ID

If "no hostname dynamic" command is used this fix correctly
displays the LSP ID.

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
16 months agodocker/ubi8-minimal: add protobuf-c runtime dep 14938/head
lynnemorrison [Mon, 4 Dec 2023 22:41:04 +0000 (17:41 -0500)]
docker/ubi8-minimal: add protobuf-c runtime dep

FRR's RPM package requires protobuf-c to be installed on the runtime
system, otherwise it will refuse to be installed.

Signed-off-by: Juan Vidal Allende <juan.vidal1@ibm.com>
16 months agobgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable
Francois Dumontet [Thu, 23 Nov 2023 09:45:24 +0000 (10:45 +0100)]
bgpd: add multiple paths support for draft ietf bgp4v2 in nlriTable

There is no support for dumping multiple paths for the same prefix.
The current implementation only takes the first available entry.

Fix this by walking over the list of available paths, ordered by peer.
The nlri index is set gradually for each path.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
16 months agoMerge pull request #14885 from pguibert6WIND/misc_nhg_fixes
Donald Sharp [Mon, 4 Dec 2023 12:31:14 +0000 (07:31 -0500)]
Merge pull request #14885 from pguibert6WIND/misc_nhg_fixes

various nexthop group fixes

16 months agoMerge pull request #14929 from opensourcerouting/fix/add_rfc9494
Donald Sharp [Mon, 4 Dec 2023 12:30:40 +0000 (07:30 -0500)]
Merge pull request #14929 from opensourcerouting/fix/add_rfc9494

doc: Add RFC 9494 to the supported RFC list

16 months agotests: import munet 0.13.10 14934/head
Christian Hopps [Mon, 4 Dec 2023 09:58:12 +0000 (04:58 -0500)]
tests: import munet 0.13.10

- Import 0.13.10 which adds watched logs feature, among others.

Signed-off-by: Christian Hopps <chopps@labn.net>
16 months agodoc: Add RFC 9494 to the supported RFC list 14929/head
Donatas Abraitis [Sun, 3 Dec 2023 17:27:11 +0000 (19:27 +0200)]
doc: Add RFC 9494 to the supported RFC list

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
16 months agoMerge pull request #14923 from opensourcerouting/fix/array_overrun_for_fqdn_domainname
Igor Ryzhov [Sat, 2 Dec 2023 17:42:52 +0000 (19:42 +0200)]
Merge pull request #14923 from opensourcerouting/fix/array_overrun_for_fqdn_domainname

bgpd: Do not null-terminate the domainname when receiving FQDN capability

16 months agoMerge pull request #14925 from pguibert6WIND/doctring_pathd_fix
Jafar Al-Gharaibeh [Fri, 1 Dec 2023 17:24:30 +0000 (11:24 -0600)]
Merge pull request #14925 from pguibert6WIND/doctring_pathd_fix

pathd: fix excessive doc string on pcep msd command

16 months agotests: add support for running things under `rr`. 14920/head
Christian Hopps [Thu, 30 Nov 2023 09:49:59 +0000 (04:49 -0500)]
tests: add support for running things under `rr`.

Signed-off-by: Christian Hopps <chopps@labn.net>
16 months agopathd: fix excessive doc string on pcep msd command 14925/head
Philippe Guibert [Fri, 1 Dec 2023 08:24:50 +0000 (09:24 +0100)]
pathd: fix excessive doc string on pcep msd command

The following message appears after starting pathd:
> root@ubuntu2204:~# vtysh
> 2023/10/31 05:59:10 [K2CCG-5Y7ZJ] Excessive docstring while parsing 'msd (1-32)'
> 2023/10/31 05:59:10 [W7ENN-K2SVA] ----------
> 2023/10/31 05:59:10 [WCW75-6TZPF] PCC maximum SID depth value
> 2023/10/31 05:59:10 [W7ENN-K2SVA] ----------

Remove the excessive doc string in the pcep msd command.

Fixes: d6d2527448ef ("pathd: fix 'no msd' command not possible under pcc node")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agotopotests: test wrong bfd source in bfd_topo3 14922/head
Louis Scalbert [Thu, 30 Nov 2023 15:07:40 +0000 (16:07 +0100)]
topotests: test wrong bfd source in bfd_topo3

Test setting a wrong bfd source and restore the source auto parameter.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
16 months agotopotests: redispatch tests in bfd_topo3
Louis Scalbert [Thu, 30 Nov 2023 15:01:09 +0000 (16:01 +0100)]
topotests: redispatch tests in bfd_topo3

Redispatch tests in bfd_topo3 in order to prepare next commit.
Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
16 months agostaticd: fix changing to source auto in bfd monitor
Louis Scalbert [Thu, 30 Nov 2023 16:29:20 +0000 (17:29 +0100)]
staticd: fix changing to source auto in bfd monitor

When monitoring a static route with BFD multi-hop, the source IP can be
either configured or retrieved from NextHop-Tracking (NHT). After
removing a configured source, the source is supposed to be retrieved
from NHT but it remains to the previous value. This is problematic if
the user desires to fix the configuration of a incorrect source IP.

For example, theses two commands results in the incorrect state:

> ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop source 10.2.2.2
> ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop

When removing the source, BFD is unable to find the source from NHT via
bfd_nht_update() were called.

Force zebra to resend the information to BFD by unregistering and
registering again NHT. The (...)/frr-nexthops/nexthop northbound
apply_finish function will trigger a call to static_install_nexthop()
that does a call to static_zebra_nht_register(nh, true);

Fixes: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
16 months agoospfd: fix deferred shutdown handling 14870/head
Renato Westphal [Thu, 23 Nov 2023 23:23:52 +0000 (20:23 -0300)]
ospfd: fix deferred shutdown handling

The ospfd cleanup code is relatively complicated given the need to
appropriately handle the "max-metric router-lsa on-shutdown (5-100)"
command. When that command is configured and an OSPF instance is
unconfigured, the removal of the instance should be deferred to allow
other routers sufficient time to find alternate paths before the
local Router-LSAs are flushed. When ospfd is killed, however, deferred
shutdown shouldn't take place and all instances should be cleared
immediately.

This commit fixes a problem where ospf_deferred_shutdown_finish()
was prematurely exiting the daemon when no instances were left,
inadvertently preventing ospf_terminate() from clearing the ospfd
global variables. Additionally, the commit includes code refactoring
to enhance readability and maintainability.

Fixes #14855.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
16 months agoospfd: improve memory cleanup during shutdown
Renato Westphal [Thu, 23 Nov 2023 23:21:31 +0000 (20:21 -0300)]
ospfd: improve memory cleanup during shutdown

* On ospf_terminate(), proceed to clear the ospfd global variables even
  when no OSPF instance is configured
* Remove double call to route_map_finish()
* Call ospf_opaque_term() to clear the opaque LSA infrastructure
* Clear the `OspfRI.area_info` and `om->ospf` global lists.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
16 months agoMerge pull request #14911 from LabNConsulting/chopps/speed-xpath-up
Igor Ryzhov [Fri, 1 Dec 2023 11:32:32 +0000 (13:32 +0200)]
Merge pull request #14911 from LabNConsulting/chopps/speed-xpath-up

lib: all: remove './' from xpath 22% speedup

16 months agobgpd: Do not null-terminate the domainname when receiving FQDN capability 14923/head
Donatas Abraitis [Fri, 1 Dec 2023 08:35:19 +0000 (10:35 +0200)]
bgpd: Do not null-terminate the domainname when receiving FQDN capability

This is already handled above, no need to do here, because we could have an
overrun situation where len > 64 and we do out-of-bound actions.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
16 months agoMerge pull request #14914 from idryzhov/mgmt-validate
Donatas Abraitis [Fri, 1 Dec 2023 07:01:05 +0000 (09:01 +0200)]
Merge pull request #14914 from idryzhov/mgmt-validate

mgmtd: validate candidate yang tree before creating a config diff

16 months agolib: fix nexthop node entry from nhg_list 14885/head
Philippe Guibert [Thu, 30 Nov 2023 12:57:57 +0000 (13:57 +0100)]
lib: fix nexthop node entry from nhg_list

When stopping a VRF, the linked list entries must be
removed too.

Fixes: 98cbbaea91f6 ("lib: Handle if up/down and vrf enable/disable events")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agolib: remove useless nexthop_group_active_nexthop_num_no_recurse()
Philippe Guibert [Mon, 27 Nov 2023 11:28:52 +0000 (12:28 +0100)]
lib: remove useless nexthop_group_active_nexthop_num_no_recurse()

The nexthop_group_active_nexthop_num_no_recurse() function is no more
used. Let us remove the function call.

Fixes: 148813c22a8d ("zebra: zebra_nhg check each nexthop for active, not just number")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agozebra: fix wrong nexthop id debug message
Philippe Guibert [Fri, 24 Nov 2023 15:38:31 +0000 (16:38 +0100)]
zebra: fix wrong nexthop id debug message

When allocating big protocol level identifiers, the number range is
big, and when pushing to netlink messages, the first nexthop group
is truncated, whereas the nexthop has been installed on the kernel.

> ubuntu2204(config)# nexthop-group A
> ubuntu2204(config-nh-group)# group 1
> ubuntu2204(config-nh-group)# group 2
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# nexthop-group 1
> ubuntu2204(config-nh-group)# nexthop 192.0.2.130 loop1 enable-proto-nhg-control
> ubuntu2204(config-nh-group)# exi
> ubuntu2204(config)# nexthop-group 2
> ubuntu2204(config-nh-group)# nexthop 192.0.2.131 loop1 enable-proto-nhg-control
> [..]
> 2023/11/24 16:47:40 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687500): group 17968/179687502

> # ip nexthop ls
> id 179687500 group 179687501/179687502 proto 194

Fix this by increasing the buffer size when appending the first number.

Fixes: 8d03bc501b5f ("zebra: Handle nhg_hash_entry encaps/more debugging")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agozebra: add client counter for nhg operations
Philippe Guibert [Thu, 23 Nov 2023 16:18:23 +0000 (17:18 +0100)]
zebra: add client counter for nhg operations

Add three counters that account for the nhg operations
that are using the zebra API with the NHG_ADD and NHG_DEL
commands.

> # show zebra client
> [..]
> Type        Add         Update      Del
> ==================================================
> IPv4        100         0           0
> IPv6        0           0           0
> Redist:v4   0           0           0
> Redist:v6   0           0           0
> NHG         1           1           1
> VRF         3           0           0
> [..]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agozebra: clarify error when calling zebra_nhg_rib_find_nhe()
Philippe Guibert [Mon, 4 Sep 2023 13:43:37 +0000 (15:43 +0200)]
zebra: clarify error when calling zebra_nhg_rib_find_nhe()

Display a specific log message when the rt_nhe parameter is not
set at all.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agosharpd: fix deleting nhid when suppressing nexthop from nh group
Philippe Guibert [Thu, 23 Nov 2023 13:19:04 +0000 (14:19 +0100)]
sharpd: fix deleting nhid when suppressing nexthop from nh group

When removing the last nexthop from a nexthop-group, the nexthop
group remains in the zebra contexts:

> ubuntu2204(config)# nexthop-group gdgd
> 2023/11/23 14:06:36 SHARP: [Q5NBA-GN1BG] NHG ID assigned: 179687502
> ubuntu2204(config-nh-group)# nexthop 192.0.2.7 loop1
> ubuntu2204(config-nh-group)# 2023/11/23 14:06:38 ZEBRA: [VNMVB-91G3G] _netlink_nexthop_build_group: ID (179687502): group 338
> 2023/11/23 14:06:38 ZEBRA: [R43C6-KYHWT] netlink_nexthop_msg_encode: RTM_NEWNEXTHOP, id=179687502
> 2023/11/23 14:06:38 ZEBRA: [HYEHE-CQZ9G] nl_batch_send: netlink-dp (NS 0), batch size=44, msg cnt=1
> 2023/11/23 14:06:38 SHARP: [JWRCN-N9K90] Installed nhg 179687502
>
> ubuntu2204(config-nh-group)# no nexthop 192.0.2.7 loop1
> 2023/11/23 14:06:47 SHARP: [Y2G2F-ZTW6M] nhg_add: nhg 179687502 not sent: no valid nexthops
> ubuntu2204(config-nh-group)# do show nexthop-group rib 179687502
> ID: 179687502 (sharp)
>      RefCnt: 1
>      Uptime: 00:00:23
>      VRF: default
>      Valid, Installed
>      Depends: (338)
>            via 192.0.2.7, loop1 (vrf default), weight 1

Fix this by sending an NHG_DEL message when no nexthops are attached,
and when the id was already installed.

Fixes: 5a9c0931aa95 ("sharpd: don't send invalid nexthop-groups to zebra")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
16 months agoMerge pull request #14909 from chiragshah6/fdev4
Donatas Abraitis [Thu, 30 Nov 2023 09:25:48 +0000 (11:25 +0200)]
Merge pull request #14909 from chiragshah6/fdev4

bgpd: aggr summary-only suppressed export to evpn

17 months agoMerge pull request #14907 from Keelan10/bgp_srv6-leak
Donatas Abraitis [Thu, 30 Nov 2023 07:22:57 +0000 (09:22 +0200)]
Merge pull request #14907 from Keelan10/bgp_srv6-leak

bgpd: Free Memory for SRv6 Functions and Locator Chunks

17 months agobgpd: lttng tp add evpn route events 14909/head
Chirag Shah [Thu, 7 Sep 2023 22:51:32 +0000 (15:51 -0700)]
bgpd: lttng tp add evpn route events

Ticket:#3597393
Testing Done:

2023-09-08T22:53:03.532 frr_bgp:evpn_withdraw_type5 {'vrf_id': 42, 'ip':
'53.1.1.0'}
2023-09-08T22:53:06.207 frr_bgp:evpn_advertise_type5 {'vrf_id': 42,
'ip': '53.1.1.0', 'rmac': '00:02:00:00:00:38', 'vtep': '27.0.0.15'}

2023-09-08T21:51:15.637 frr_bgp:evpn_mh_local_ead_es_evi_route_upd
{'esi': '03:44:38:39:ff:ff:01:00:00:03', 'vni': 1000, 'route_type': 1,
'vtep': '27.0.0.15'}

2023-09-08T20:45:17.059 frr_bgp:evpn_mh_local_ead_es_evi_route_del
{'esi': '03:44:38:39:ff:ff:01:00:00:01', 'vni': 0, 'route_type': 4,
'vtep': '27.0.0.15'}

2023-09-08T21:51:18.363 frr_bgp:evpn_mh_es_evi_vtep_add {'esi':
'03:44:38:39:ff:ff:01:00:00:02', 'vni': 1000, 'vtep': '27.0.0.16',
'ead_es': 1}

2023-09-08T20:43:50.206 frr_bgp:evpn_mh_es_evi_vtep_del {'esi':
'03:44:38:39:ff:ff:01:00:00:01', 'vni': 1002, 'vtep': '27.0.0.16',
'ead_es': 0}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
17 months agobgpd: aggr summary-only suppressed export to evpn
Chirag Shah [Sat, 23 Sep 2023 00:19:09 +0000 (17:19 -0700)]
bgpd: aggr summary-only suppressed export to evpn

When exporting bgp vrf instance unicast route into
EVPN as type-5, check for suppressed ones and do not
export them.

Ticket:#3534718
Testing Done:

Config:

router bgp 660000 vrf vrf1
 bgp router-id 144.1.1.2
 no bgp network import-check
 neighbor 144.1.1.1 remote-as external
 !
 address-family ipv4 unicast
  aggregate-address 50.1.0.0/16 summary-only
  redistribute connected
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
 exit-address-family
exit

v4 suppressed route: (5 suppressed routes not exported to evpn)

tor1# vtysh -c "show bgp vrf vrf1 ipv4 unicast" | grep "50.1"
*> 50.1.0.0/16      0.0.0.0(bordertor-11)
s> 50.1.1.212/32    6.0.0.30(leaf-11)<
s> 50.1.1.222/32    6.0.0.31(leaf-11)<
s> 50.1.110.0/24    0.0.0.0(bordertor-11)
s> 50.1.210.214/32  6.0.0.30(leaf-11)<
s> 50.1.220.224/32  6.0.0.31(leaf-11)<

tor1# vtysh -c "show bgp l2vpn evpn route" | grep -A3 "*> \[5\].*\[50.1"
*> [5]:[0]:[16]:[50.1.0.0] RD 144.1.1.2:7
                    6.0.0.1 (bordertor-11)
                                             0         32768 ?
                    ET:8 RT:4640:104001 Rmac:00:02:00:00:00:04

Signed-off-by: Chirag Shah <chirag@nvidia.com>
17 months agomgmtd: validate candidate yang tree before creating a config diff 14914/head
Igor Ryzhov [Tue, 14 Nov 2023 19:17:24 +0000 (20:17 +0100)]
mgmtd: validate candidate yang tree before creating a config diff

The candidate yang tree should be validated before `nb_config_diff` is
called. `nb_config_diff` ignores all prohibited operations and can
provide an empty change list because of this. For example, if a user
deletes a mandatory node from the candidate datastore and tries to make
a commit, they'll receive the "No changes found to be committed!" error,
because such a change is ignored by `nb_config_diff`. Instead, mgmtd
should tell the user that their candidate datastore is not valid and
can't be commited.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
17 months agolib: all: remove './' from xpath 22% speedup 14911/head
Christian Hopps [Wed, 29 Nov 2023 19:37:23 +0000 (14:37 -0500)]
lib: all: remove './' from xpath 22% speedup

fixes #8299

Signed-off-by: Christian Hopps <chopps@labn.net>
17 months agoMerge pull request #14906 from Keelan10/bgp_confederation-leak
Donald Sharp [Wed, 29 Nov 2023 18:49:37 +0000 (13:49 -0500)]
Merge pull request #14906 from Keelan10/bgp_confederation-leak

bgpd: Free Memory for confed_peers in bgp_free

17 months agoMerge pull request #14908 from Keelan10/zebra-tc-leak
Donald Sharp [Wed, 29 Nov 2023 18:48:45 +0000 (13:48 -0500)]
Merge pull request #14908 from Keelan10/zebra-tc-leak

zebra: Set Free Functions for Traffic Control Hash Tables

17 months agozebra: Fix non-notification of better admin won 14795/head
Donald Sharp [Tue, 14 Nov 2023 15:15:42 +0000 (10:15 -0500)]
zebra: Fix non-notification of better admin won

If there happens to be a entry in the zebra rib
that has a lower admin distance then a newly received
re, zebra would not notify the upper level protocol
about this happening.  Imagine a case where there
is a connected route for say a /32 and bgp receives
a route from a peer that is the same route as the
connected.  Since BGP has no network statement and
perceives the route as being `good` bgp will install
the route into zebra.  Zebra will look at the new
bgp re and correctly identify that the re is not
something that it will use and do nothing.  This
change notices this and sends up a BETTER_ADMIN_WON
route notification.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
17 months agobgpd: Free Memory for SRv6 Functions and Locator Chunks 14907/head
Keelan10 [Wed, 29 Nov 2023 11:49:58 +0000 (15:49 +0400)]
bgpd: Free Memory for SRv6 Functions and Locator Chunks

Implement proper memory cleanup for SRv6 functions and locator chunks to prevent potential memory leaks.
The list callback deletion functions have been set.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in bgp_srv6l3vpn_to_bgp_vrf.test_bgp_srv6l3vpn_to_bgp_vrf/r2.asan.bgpd.4180

=================================================================
==4180==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 544 byte(s) in 2 object(s) allocated from:
    #0 0x7f8d176a0d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f8d1709f238 in qcalloc lib/memory.c:105
    #2 0x55d5dba6ee75 in sid_register bgpd/bgp_mplsvpn.c:591
    #3 0x55d5dba6ee75 in alloc_new_sid bgpd/bgp_mplsvpn.c:712
    #4 0x55d5dba6f3ce in ensure_vrf_tovpn_sid_per_af bgpd/bgp_mplsvpn.c:758
    #5 0x55d5dba6fb94 in ensure_vrf_tovpn_sid bgpd/bgp_mplsvpn.c:849
    #6 0x55d5dba7f975 in vpn_leak_postchange bgpd/bgp_mplsvpn.h:299
    #7 0x55d5dba7f975 in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3704
    #8 0x55d5dbbb6c66 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3164
    #9 0x7f8d1716f08a in zclient_read lib/zclient.c:4459
    #10 0x7f8d1713f034 in event_call lib/event.c:1974
    #11 0x7f8d1708242b in frr_run lib/libfrr.c:1214
    #12 0x55d5db99d19d in main bgpd/bgp_main.c:510
    #13 0x7f8d160c5c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 296 byte(s) in 1 object(s) allocated from:
    #0 0x7f8d176a0d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7f8d1709f238 in qcalloc lib/memory.c:105
    #2 0x7f8d170b1d5f in srv6_locator_chunk_alloc lib/srv6.c:135
    #3 0x55d5dbbb6a19 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3144
    #4 0x7f8d1716f08a in zclient_read lib/zclient.c:4459
    #5 0x7f8d1713f034 in event_call lib/event.c:1974
    #6 0x7f8d1708242b in frr_run lib/libfrr.c:1214
    #7 0x55d5db99d19d in main bgpd/bgp_main.c:510
    #8 0x7f8d160c5c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
***********************************************************************************

```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agoMerge pull request #14896 from zarkdav/patch-1
Donald Sharp [Wed, 29 Nov 2023 14:04:39 +0000 (09:04 -0500)]
Merge pull request #14896 from zarkdav/patch-1

Update bgp.rst

17 months agoMerge pull request #14838 from idryzhov/mgmtd-cli-out
Christian Hopps [Wed, 29 Nov 2023 13:50:16 +0000 (14:50 +0100)]
Merge pull request #14838 from idryzhov/mgmtd-cli-out

Output configuration of mgmtd-converted daemons from mgmtd

17 months agoMerge pull request #14762 from pguibert6WIND/show_pcep_port
Olivier Dugeon [Wed, 29 Nov 2023 13:41:47 +0000 (14:41 +0100)]
Merge pull request #14762 from pguibert6WIND/show_pcep_port

pathd: fix space before pcep port in running-config

17 months agoMerge pull request #9012 from dlqs/lua-poly
Donatas Abraitis [Wed, 29 Nov 2023 13:14:46 +0000 (15:14 +0200)]
Merge pull request #9012 from dlqs/lua-poly

Refactor decoder for Lua hook system

17 months agozebra: Set Free Functions for Traffic Control Hash Tables 14908/head
Keelan10 [Wed, 29 Nov 2023 12:33:54 +0000 (16:33 +0400)]
zebra: Set Free Functions for Traffic Control Hash Tables

Configure hash table cleanup with specific free functions for `zrouter.filter_hash`, `zrouter.qdisc_hash`, and `zrouter.class_hash`.
This ensures proper memory cleanup, addressing memory leaks.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in tc_basic.test_tc_basic/r1.asan.zebra.15495

=================================================================
==15495==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 176 byte(s) in 1 object(s) allocated from:
    #0 0x7fd5660ffd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd565afe238 in qcalloc lib/memory.c:105
    #2 0x5564521c6c9e in tc_filter_alloc_intern zebra/zebra_tc.c:389
    #3 0x7fd565ac49e8 in hash_get lib/hash.c:147
    #4 0x5564521c7c74 in zebra_tc_filter_add zebra/zebra_tc.c:409
    #5 0x55645210755a in zread_tc_filter zebra/zapi_msg.c:3428
    #6 0x5564521127c1 in zserv_handle_commands zebra/zapi_msg.c:4004
    #7 0x5564522208b2 in zserv_process_messages zebra/zserv.c:520
    #8 0x7fd565b9e034 in event_call lib/event.c:1974
    #9 0x7fd565ae142b in frr_run lib/libfrr.c:1214
    #10 0x5564520c14b1 in main zebra/main.c:492
    #11 0x7fd564ec2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x7fd5660ffd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd565afe238 in qcalloc lib/memory.c:105
    #2 0x5564521c6c6e in tc_class_alloc_intern zebra/zebra_tc.c:239
    #3 0x7fd565ac49e8 in hash_get lib/hash.c:147
    #4 0x5564521c784f in zebra_tc_class_add zebra/zebra_tc.c:293
    #5 0x556452107ce5 in zread_tc_class zebra/zapi_msg.c:3315
    #6 0x5564521127c1 in zserv_handle_commands zebra/zapi_msg.c:4004
    #7 0x5564522208b2 in zserv_process_messages zebra/zserv.c:520
    #8 0x7fd565b9e034 in event_call lib/event.c:1974
    #9 0x7fd565ae142b in frr_run lib/libfrr.c:1214
    #10 0x5564520c14b1 in main zebra/main.c:492
    #11 0x7fd564ec2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Direct leak of 12 byte(s) in 1 object(s) allocated from:
    #0 0x7fd5660ffd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    #1 0x7fd565afe238 in qcalloc lib/memory.c:105
    #2 0x5564521c6c3e in tc_qdisc_alloc_intern zebra/zebra_tc.c:128
    #3 0x7fd565ac49e8 in hash_get lib/hash.c:147
    #4 0x5564521c753b in zebra_tc_qdisc_install zebra/zebra_tc.c:184
    #5 0x556452108203 in zread_tc_qdisc zebra/zapi_msg.c:3286
    #6 0x5564521127c1 in zserv_handle_commands zebra/zapi_msg.c:4004
    #7 0x5564522208b2 in zserv_process_messages zebra/zserv.c:520
    #8 0x7fd565b9e034 in event_call lib/event.c:1974
    #9 0x7fd565ae142b in frr_run lib/libfrr.c:1214
    #10 0x5564520c14b1 in main zebra/main.c:492
    #11 0x7fd564ec2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

SUMMARY: AddressSanitizer: 228 byte(s) leaked in 3 allocation(s).
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agobgpd: Free Memory for confed_peers in bgp_free 14906/head
Keelan10 [Wed, 29 Nov 2023 11:28:54 +0000 (15:28 +0400)]
bgpd: Free Memory for confed_peers in bgp_free

Release memory associated with `bgp->confed_peers` in the `bgp_free`
function to ensure proper cleanup. This fix prevents memory leaks related
to `confed_peers`.

The ASan leak log for reference:

```
***********************************************************************************
Address Sanitizer Error detected in bgp_confederation_astype.test_bgp_confederation_astype/r2.asan.bgpd.15045

=================================================================
==15045==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 16 byte(s) in 1 object(s) allocated from:
    #0 0x7f5666787b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    #1 0x7f56661867c7 in qrealloc lib/memory.c:112
    #2 0x55a3b4736a40 in bgp_confederation_peers_add bgpd/bgpd.c:681
    #3 0x55a3b46b3363 in bgp_confederation_peers bgpd/bgp_vty.c:2068
    #4 0x7f5666109021 in cmd_execute_command_real lib/command.c:978
    #5 0x7f5666109a52 in cmd_execute_command_strict lib/command.c:1087
    #6 0x7f5666109ab1 in command_config_read_one_line lib/command.c:1247
    #7 0x7f5666109d98 in config_from_file lib/command.c:1300
    #8 0x7f566623c6d0 in vty_read_file lib/vty.c:2614
    #9 0x7f566623c7fa in vty_read_config lib/vty.c:2860
    #10 0x7f56661682e4 in frr_config_read_in lib/libfrr.c:978
    #11 0x7f5666226034 in event_call lib/event.c:1974
    #12 0x7f566616942b in frr_run lib/libfrr.c:1214
    #13 0x55a3b44f319d in main bgpd/bgp_main.c:510
    #14 0x7f56651acc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 6 byte(s) in 1 object(s) allocated from:
    #0 0x7f5666720538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7f5666186898 in qstrdup lib/memory.c:117
    #2 0x55a3b4736adb in bgp_confederation_peers_add bgpd/bgpd.c:687
    #3 0x55a3b46b3363 in bgp_confederation_peers bgpd/bgp_vty.c:2068
    #4 0x7f5666109021 in cmd_execute_command_real lib/command.c:978
    #5 0x7f5666109a52 in cmd_execute_command_strict lib/command.c:1087
    #6 0x7f5666109ab1 in command_config_read_one_line lib/command.c:1247
    #7 0x7f5666109d98 in config_from_file lib/command.c:1300
    #8 0x7f566623c6d0 in vty_read_file lib/vty.c:2614
    #9 0x7f566623c7fa in vty_read_config lib/vty.c:2860
    #10 0x7f56661682e4 in frr_config_read_in lib/libfrr.c:978
    #11 0x7f5666226034 in event_call lib/event.c:1974
    #12 0x7f566616942b in frr_run lib/libfrr.c:1214
    #13 0x55a3b44f319d in main bgpd/bgp_main.c:510
    #14 0x7f56651acc86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
***********************************************************************************
```

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
17 months agodoc: Update bgp.rst 14896/head
Benjamin Ryzman [Tue, 28 Nov 2023 16:48:36 +0000 (17:48 +0100)]
doc: Update bgp.rst

Fix typo in VRF Route Leaking general configuration example.

Signed-off-by: Benjamin Ryzman <benjamin@ryzman.fr>
17 months agoMerge pull request #14894 from louis-6wind/bestpath-heap
Donatas Abraitis [Wed, 29 Nov 2023 08:44:16 +0000 (10:44 +0200)]
Merge pull request #14894 from louis-6wind/bestpath-heap

bgpd: fix bgp_best_selection heap-use-after-free

17 months agoMerge pull request #14886 from LabNConsulting/aceelindem/ospf-link-local-fix
Donatas Abraitis [Wed, 29 Nov 2023 08:36:30 +0000 (10:36 +0200)]
Merge pull request #14886 from LabNConsulting/aceelindem/ospf-link-local-fix

ospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruption

17 months agoMerge pull request #14897 from chiragshah6/mdev1
Donatas Abraitis [Wed, 29 Nov 2023 07:51:50 +0000 (09:51 +0200)]
Merge pull request #14897 from chiragshah6/mdev1

tools: fix frr-reload interface desc cmd

17 months agotools: fix frr-reload interface desc cmd 14897/head
Chirag Shah [Wed, 29 Nov 2023 02:54:14 +0000 (18:54 -0800)]
tools: fix frr-reload interface desc cmd

Fix frr-reload script to only render 'no description'
rather than 'no description blah'

Ticket:#3628756
Testing Done:

Before:
2023-11-29 02:38:55,758  INFO: Failed to execute interface hostbond_1
no description hostbond_1_to_host exit
2023-11-29 02:38:55,758 ERROR: "interface hostbond_1 --  no description
hostbond_1_to_host -- exit" we failed to remove this command
2023-11-29 02:38:55,758 ERROR: % Unknown command:  no description
hostbond_1_to_host

Signed-off-by: Chirag Shah <chirag@nvidia.com>
17 months agoospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruption 14886/head
Acee [Mon, 27 Nov 2023 13:13:03 +0000 (08:13 -0500)]
ospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruption

  1. When an OSPF interface is deleted, remove the references in link-local
     LSA. Delete the LSA from the LSDB so that the callback has accessibily
     to the interface prior to deletion.
  2. Fix a double free for the opaque function table data structure.
  3. Assure that the opaque per-type information and opaque function table
     structures are removed at the same time since they have back pointers
     to one another.
  4. Add a topotest variation for the link-local opaque LSA crash.

Signed-off-by: Acee <aceelindem@gmail.com>
17 months agoMerge pull request #14811 from donaldsharp/zebra_final_shutdown_finally
Christian Hopps [Tue, 28 Nov 2023 19:14:42 +0000 (20:14 +0100)]
Merge pull request #14811 from donaldsharp/zebra_final_shutdown_finally

Zebra final shutdown finally

17 months agobgpd: fix bgp_best_selection heap-use-after-free 14894/head
Louis Scalbert [Tue, 28 Nov 2023 13:54:46 +0000 (14:54 +0100)]
bgpd: fix bgp_best_selection heap-use-after-free

Fix bgp_best_selection heap-use-after-free

> ==2521540==ERROR: AddressSanitizer: heap-use-after-free on address 0x60d000032810 at pc 0x000000716f45 bp 0x7ffedc6229d0 sp 0x7ffedc6229c8
> READ of size 8 at 0x60d000032810 thread T0
>     #0 0x716f44 in bgp_best_selection /home/lscalber/git/frr/bgpd/bgp_route.c:2834:5
>     #1 0x71a05e in bgp_process_main_one /home/lscalber/git/frr/bgpd/bgp_route.c:3344:2
>     #2 0x71c265 in bgp_process_wq /home/lscalber/git/frr/bgpd/bgp_route.c:3622:3
>     #3 0x7fe630a6669c in work_queue_run /home/lscalber/git/frr/lib/workqueue.c:282:10
>     #4 0x7fe630a294e2 in event_call /home/lscalber/git/frr/lib/event.c:1974:2
>     #5 0x7fe630898f3f in frr_run /home/lscalber/git/frr/lib/libfrr.c:1214:3
>     #6 0x4f4ace in main /home/lscalber/git/frr/bgpd/bgp_main.c:510:2
>     #7 0x7fe63018bd09 in __libc_start_main csu/../csu/libc-start.c:308:16
>     #8 0x449629 in _start (/usr/lib/frr/bgpd+0x449629)
>
> 0x60d000032810 is located 48 bytes inside of 144-byte region [0x60d0000327e0,0x60d000032870)
> freed by thread T0 here:
>     #0 0x4c341d in free (/usr/lib/frr/bgpd+0x4c341d)
>     #1 0x7fe6308d7420 in qfree /home/lscalber/git/frr/lib/memory.c:130:2
>     #2 0x702632 in bgp_path_info_free_with_caller /home/lscalber/git/frr/bgpd/bgp_route.c:300:2
>     #3 0x702023 in bgp_path_info_unlock /home/lscalber/git/frr/bgpd/bgp_route.c:315:3
>     #4 0x703bc6 in bgp_path_info_reap /home/lscalber/git/frr/bgpd/bgp_route.c:461:2
>     #5 0x716e5d in bgp_best_selection /home/lscalber/git/frr/bgpd/bgp_route.c:2829:12
>     #6 0x71a05e in bgp_process_main_one /home/lscalber/git/frr/bgpd/bgp_route.c:3344:2
>     #7 0x71c265 in bgp_process_wq /home/lscalber/git/frr/bgpd/bgp_route.c:3622:3
>     #8 0x7fe630a6669c in work_queue_run /home/lscalber/git/frr/lib/workqueue.c:282:10
>     #9 0x7fe630a294e2 in event_call /home/lscalber/git/frr/lib/event.c:1974:2
>     #10 0x7fe630898f3f in frr_run /home/lscalber/git/frr/lib/libfrr.c:1214:3
>     #11 0x4f4ace in main /home/lscalber/git/frr/bgpd/bgp_main.c:510:2
>     #12 0x7fe63018bd09 in __libc_start_main csu/../csu/libc-start.c:308:16
>
> previously allocated by thread T0 here:
>     #0 0x4c3812 in calloc (/usr/lib/frr/bgpd+0x4c3812)
>     #1 0x7fe6308d7178 in qcalloc /home/lscalber/git/frr/lib/memory.c:105:27
>     #2 0x71f5b4 in info_make /home/lscalber/git/frr/bgpd/bgp_route.c:3985:8
>     #3 0x725293 in bgp_update /home/lscalber/git/frr/bgpd/bgp_route.c:4881:8
>     #4 0x73083d in bgp_nlri_parse_ip /home/lscalber/git/frr/bgpd/bgp_route.c:6230:4
>     #5 0x6ba980 in bgp_nlri_parse /home/lscalber/git/frr/bgpd/bgp_packet.c:341:10
>     #6 0x6cca2a in bgp_update_receive /home/lscalber/git/frr/bgpd/bgp_packet.c:2412:15
>     #7 0x6c6788 in bgp_process_packet /home/lscalber/git/frr/bgpd/bgp_packet.c:3887:11
>     #8 0x7fe630a294e2 in event_call /home/lscalber/git/frr/lib/event.c:1974:2
>     #9 0x7fe630898f3f in frr_run /home/lscalber/git/frr/lib/libfrr.c:1214:3
>     #10 0x4f4ace in main /home/lscalber/git/frr/bgpd/bgp_main.c:510:2
>     #11 0x7fe63018bd09 in __libc_start_main csu/../csu/libc-start.c:308:16

Fixes: ddb5b4880b ("bgpd: vpn-vrf route leaking")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
17 months agoMerge pull request #14856 from opensourcerouting/show-rm
Russ White [Tue, 28 Nov 2023 13:46:53 +0000 (08:46 -0500)]
Merge pull request #14856 from opensourcerouting/show-rm

lib: fix show route map JSON display

17 months agoMerge pull request #14819 from opensourcerouting/feature/bgp_debug_updates_with_route-map
Russ White [Tue, 28 Nov 2023 13:40:07 +0000 (08:40 -0500)]
Merge pull request #14819 from opensourcerouting/feature/bgp_debug_updates_with_route-map

bgpd: Add an ability to filter UPDATEs using neighbor with prefix-list

17 months agoMerge pull request #14512 from pguibert6WIND/vpnv4_with_no_rt_export
Russ White [Tue, 28 Nov 2023 13:34:58 +0000 (08:34 -0500)]
Merge pull request #14512 from pguibert6WIND/vpnv4_with_no_rt_export

L3VPN exportation by using 'route-map vpn export' command instead of 'rt vpn export' command