]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
13 months agotopotests: bgp_bmp, add vpn tests
Louis Scalbert [Tue, 27 Feb 2024 14:42:16 +0000 (15:42 +0100)]
topotests: bgp_bmp, add vpn tests

Test vpn prefixes sending to BMP

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agotopotests: bgp_bmp, use test ip range
Louis Scalbert [Tue, 27 Feb 2024 13:40:57 +0000 (14:40 +0100)]
topotests: bgp_bmp, use test ip range

Use standard test ip range in bgp_bmp topotest

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoMerge pull request #14775 from adrianomarto/test_ospfd_single_switch2
Donatas Abraitis [Thu, 29 Feb 2024 08:36:54 +0000 (10:36 +0200)]
Merge pull request #14775 from adrianomarto/test_ospfd_single_switch2

tests: multiple OSPF routers connected to a single switch

14 months agoMerge pull request #14898 from chiragshah6/mdev
Donatas Abraitis [Thu, 29 Feb 2024 07:26:13 +0000 (09:26 +0200)]
Merge pull request #14898 from chiragshah6/mdev

tools: fix frr-reload for nbr deletion

14 months agoMerge pull request #15368 from louis-6wind/fix-6pe
Donatas Abraitis [Wed, 28 Feb 2024 09:34:43 +0000 (11:34 +0200)]
Merge pull request #15368 from louis-6wind/fix-6pe

bgpd: fix 6vpe nexthop

14 months agoMerge pull request #15446 from mjstapp/fix_config_typo
Donatas Abraitis [Wed, 28 Feb 2024 09:34:06 +0000 (11:34 +0200)]
Merge pull request #15446 from mjstapp/fix_config_typo

tools: fix typo in configure script

14 months agoMerge pull request #15447 from louis-6wind/bmp-safi
Donatas Abraitis [Wed, 28 Feb 2024 09:33:35 +0000 (11:33 +0200)]
Merge pull request #15447 from louis-6wind/bmp-safi

bmp: fix vty_out for monitor afi loc-rib

14 months agobmp: fix vty_out for monitor afi loc-rib 15447/head
Farid Mihoub [Thu, 8 Jun 2023 13:37:10 +0000 (15:37 +0200)]
bmp: fix vty_out for monitor afi loc-rib

"show run" displays BMP monitor AFI in upper case.

> bmp targets bmp1
>  bmp monitor IPv4 unicast loc-rib

Display it in lower case.

> bmp targets bmp1
>  bmp monitor ipv4 unicast loc-rib

Signed-off-by: Farid Mihoub <farid.mihoub@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotools: fix typo in configure script 15446/head
Mark Stapp [Tue, 27 Feb 2024 17:36:38 +0000 (12:36 -0500)]
tools: fix typo in configure script

Fix a small typo nit in the configure script.

Signed-off-by: Mark Stapp <mjs@cisco.com>
14 months agoMerge pull request #13721 from pguibert6WIND/route_target_wrong_display
Russ White [Tue, 27 Feb 2024 17:01:45 +0000 (12:01 -0500)]
Merge pull request #13721 from pguibert6WIND/route_target_wrong_display

bgpd: fix route-target display with as dotted format

14 months agoMerge pull request #15438 from opensourcerouting/fix/doc_release_reference_table
Russ White [Tue, 27 Feb 2024 17:01:29 +0000 (12:01 -0500)]
Merge pull request #15438 from opensourcerouting/fix/doc_release_reference_table

doc: Update dates in release reference table

14 months agoMerge pull request #15399 from louis-6wind/fix-macvlan-crash
Donatas Abraitis [Tue, 27 Feb 2024 16:31:28 +0000 (18:31 +0200)]
Merge pull request #15399 from louis-6wind/fix-macvlan-crash

zebra: fix crash when macvlan link-interface is in another netns

14 months agoMerge pull request #15431 from Orange-OpenSource/ospf-te
Donatas Abraitis [Tue, 27 Feb 2024 15:41:19 +0000 (17:41 +0200)]
Merge pull request #15431 from Orange-OpenSource/ospf-te

ospfd: Solved crash in OSPF TE parsing

14 months agoMerge pull request #14810 from dmytroshytyi-6WIND/srv6_bgp_sid_reachability
Russ White [Tue, 27 Feb 2024 15:32:14 +0000 (10:32 -0500)]
Merge pull request #14810 from dmytroshytyi-6WIND/srv6_bgp_sid_reachability

SRv6 BGP SID reachability

14 months agoMerge pull request #15273 from opensourcerouting/feature/paths_limit_capability
Russ White [Tue, 27 Feb 2024 15:24:05 +0000 (10:24 -0500)]
Merge pull request #15273 from opensourcerouting/feature/paths_limit_capability

bgpd: Implement Paths-Limit capability

14 months agobgpd: fix route-target display with as dotted format 13721/head
Philippe Guibert [Wed, 7 Jun 2023 15:26:52 +0000 (17:26 +0200)]
bgpd: fix route-target display with as dotted format

The following command results in a wrong route-target
display:
> # show running-config
> [..]
> route-map rmap permit 1
>  set extcommunity rt 1.45:55
> exit
> router bgp 1.45 as-notation plain
> neighbor 192.0.2.1 remote-as 65500
> address-family ipv4 unicast
> network 192.0.2.2/32 route-map rmap
>

Observed output:

> # show bgp ipv4 192.0.2.2/32
> [..]
>     Extended Community: RT:1.0.0.45:55
>

The decoding of the passed cli string assumes this is an
IP address, whereas it is an AS number in dotted format.
Consequently, the vty output will use the ip address encoding.

Count the number of dots in the extended community format.
If a single dot number is detected, the AS format is passed,
and used by the vty output.

After fix:

>
> # show bgp ipv4 192.0.2.2/32
> [..]
>    Extended Community: RT:65581:55
>

For remind, AS 65581 and AS 1.45 are a unique AS number.

> show bgp neighbor
> BGP neighbor is 192.0.2.1, remote AS 65500, local AS 65581, external link
> [..]

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agodoc: Update dates in release reference table 15438/head
Donatas Abraitis [Tue, 27 Feb 2024 12:54:16 +0000 (14:54 +0200)]
doc: Update dates in release reference table

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15427 from idryzhov/fix-filter-nb-update
Donatas Abraitis [Tue, 27 Feb 2024 11:39:05 +0000 (13:39 +0200)]
Merge pull request #15427 from idryzhov/fix-filter-nb-update

lib: fix access/prefix-list entry update

14 months agoMerge pull request #15429 from sri-mohan1/srib-24-zebra
Donatas Abraitis [Tue, 27 Feb 2024 11:37:38 +0000 (13:37 +0200)]
Merge pull request #15429 from sri-mohan1/srib-24-zebra

zebra: changes for code maintainability

14 months agoospfd: Solved crash in OSPF TE parsing 15431/head
Olivier Dugeon [Mon, 26 Feb 2024 09:40:34 +0000 (10:40 +0100)]
ospfd: Solved crash in OSPF TE parsing

Iggy Frankovic discovered an ospfd crash when perfomring fuzzing of OSPF LSA
packets. The crash occurs in ospf_te_parse_te() function when attemping to
create corresponding egde from TE Link parameters. If there is no local
address, an edge is created but without any attributes. During parsing, the
function try to access to this attribute fields which has not been created
causing an ospfd crash.

The patch simply check if the te parser has found a valid local address. If not
found, we stop the parser which avoid the crash.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoMerge pull request #15387 from fdumontet6WIND/frr_aspath_excl_bp1
Donatas Abraitis [Tue, 27 Feb 2024 07:52:23 +0000 (09:52 +0200)]
Merge pull request #15387 from fdumontet6WIND/frr_aspath_excl_bp1

bgpd: fix no bgp as-path access-list issue

14 months agoMerge pull request #15339 from opensourcerouting/fix/add_deprecation
Russ White [Mon, 26 Feb 2024 19:59:17 +0000 (14:59 -0500)]
Merge pull request #15339 from opensourcerouting/fix/add_deprecation

ospfd: Add deprecation cycle for `router-info X [A.B.C.D]` command

14 months agoMerge pull request #15430 from idryzhov/fix-ly-log
Donald Sharp [Mon, 26 Feb 2024 15:26:13 +0000 (10:26 -0500)]
Merge pull request #15430 from idryzhov/fix-ly-log

lib: fix setting temporary log options for libyang

14 months agobgpd: fix no bgp as-path access-list issue 15387/head
Francois Dumontet [Fri, 16 Feb 2024 14:31:14 +0000 (15:31 +0100)]
bgpd: fix no bgp as-path access-list  issue

router bgp 65001
 no bgp ebgp-requires-policy
 neighbor 192.168.1.2 remote-as external
 neighbor 192.168.1.2 timers 3 10
 address-family ipv4 unicast
  neighbor 192.168.1.2 route-map r2 in
 exit-address-family
!
ip prefix-list p1 seq 5 permit 172.16.255.31/32
!
route-map r2 permit 10
 match ip address prefix-list p1
 set as-path exclude 65003
route-map r2 permit 20
 set as-path exclude all
!

we make the following commands

bgp as-path access-list FIRST permit ^65
bgp as-path access-list SECOND permit 2
 route-map r2 permit 6
  set as-path exclude as-path-access-list SECOND

and then

no bgp as-path access-list SECOND permit 2
clear bgp *

we have the following crash in bgp

               Stack trace of thread 536083:
                #0  0x00007f87f8aacfe1 raise (libpthread.so.0 + 0x12fe1)
                #1  0x00007f87f8cf6870 core_handler (libfrr.so.0 +
    0xf6870)
                #2  0x00007f87f8aad140 __restore_rt (libpthread.so.0 +
    0x13140)
                #3  0x00007f87f89a5122 __GI___regexec (libc.so.6 +
    0xdf122)
                #4  0x000055d7f198b4a7 aspath_filter_exclude_acl (bgpd +
    0x2054a7)
                #5  0x000055d7f1902187 route_set_aspath_exclude (bgpd +
    0x17c187)
                #6  0x00007f87f8ce54b0 route_map_apply_ext (libfrr.so.0
    + 0xe54b0)
                #7  0x000055d7f18da925 bgp_input_modifier (bgpd +
    0x154925)
                #8  0x000055d7f18e0647 bgp_update (bgpd + 0x15a647)
                #9  0x000055d7f18e4772 bgp_nlri_parse_ip (bgpd +
    0x15e772)
                #10 0x000055d7f18c38ae bgp_nlri_parse (bgpd + 0x13d8ae)
                #11 0x000055d7f18c6b7a bgp_update_receive (bgpd +
    0x140b7a)
                #12 0x000055d7f18c8ff3 bgp_process_packet (bgpd +
    0x142ff3)
                #13 0x00007f87f8d0dce0 thread_call (libfrr.so.0 +
    0x10dce0)
                #14 0x00007f87f8cacb28 frr_run (libfrr.so.0 + 0xacb28)
                #15 0x000055d7f18435da main (bgpd + 0xbd5da)
                #16 0x00007f87f88e9d0a __libc_start_main (libc.so.6 +
    0x23d0a)
                #17 0x000055d7f18415fa _start (bgpd + 0xbb5fa)

analysis

crash is due to the fact that there were always a pointer from
as-path exclude to deleted as-path access list.

fix
we add a backpointer mechanism to manage the dependency beetween
as-path access-list  and aspath exclude.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
14 months agotests: extend tests for aspath exclude
Francois Dumontet [Wed, 14 Feb 2024 16:13:40 +0000 (17:13 +0100)]
tests: extend tests for aspath exclude

adding a tests about:
"no bgp as-path access-list" command.

the folloxing "clear bgp *" command leads to the
crash exhibited above.

a sleep had been added to capture the crash befor the end of scenario.

50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f5f05cbb9c0 (LWP 1371086))]
(gdb) bt
    context=0x7ffcf2c216c0) at lib/sigevent.c:248
    acl_list=0x55c976ec03c0) at bgpd/bgp_aspath.c:1688
    dummy=0x7ffcf2c22340, object=0x7ffcf2c21e70) at bgpd/bgp_routemap.c:2401
    match_object=0x7ffcf2c21e70, set_object=0x7ffcf2c21e70, pref=0x0)
    at lib/routemap.c:2687
    attr=0x7ffcf2c220b0, afi=AFI_IP, safi=SAFI_UNICAST, rmap_name=0x0, label=0x0,
    num_labels=0, dest=0x55c976ebeaf0) at bgpd/bgp_route.c:1807
    addpath_id=0, attr=0x7ffcf2c22450, afi=AFI_IP, safi=SAFI_UNICAST, type=10,
    sub_type=0, prd=0x0, label=0x0, num_labels=0, soft_reconfig=0, evpn=0x0)
    at bgpd/bgp_route.c:4424
    packet=0x7ffcf2c22410) at bgpd/bgp_route.c:6266
    packet=0x7ffcf2c22410, mp_withdraw=false) at bgpd/bgp_packet.c:341
    peer=0x55c976e89ed0, size=43) at bgpd/bgp_packet.c:2414
    at bgpd/bgp_packet.c:3899

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
14 months agolib: fix setting temporary log options for libyang 15430/head
Igor Ryzhov [Mon, 26 Feb 2024 09:30:57 +0000 (11:30 +0200)]
lib: fix setting temporary log options for libyang

By calling `ly_log_options` with `LY_LOSTORE`, the current code
effectively disables libyang logging and never enables it back. The call
is done to get the current logging options, but we don't really need
that. When looking for a schema node, we don't want neither to log nor
to store the error, so simply set the temporary options to 0.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agobgpd: fix 6vpe nexthop 15368/head
Louis Scalbert [Thu, 15 Feb 2024 12:28:02 +0000 (13:28 +0100)]
bgpd: fix 6vpe nexthop

6vPE enables the announcement of IPv6 VPN prefixes through an IPv4 BGP
session. In this scenario, the next hop addresses for these prefixes are
represented in an IPv4-mapped IPv6 format, noted as ::ffff:[IPv4]. This
format indicates to the peer that it should route these IPv6 addresses
using information from the IPv4 nexthop. For example:

> Path Attribute - MP_REACH_NLRI
> [...]
>     Address family identifier (AFI): IPv6 (2)
>     Subsequent address family identifier (SAFI): Labeled VPN Unicast (128)
>     Next hop:  RD=0:0 IPv6=::ffff:192.0.2.5 RD=0:0 Link-local=fe80::501d:42ff:feef:b021
>     Number of Subnetwork points of attachment (SNPA): 0

This rule is set out in RFC4798:

> The IPv4 address of the egress 6PE router MUST be encoded as an
> IPv4-mapped IPv6 address in the BGP Next Hop field.

However, in some situations, bgpd sends a standard nexthop IPv6 address
instead of an IPv4-mapped IPv6 address because the outgoing interface for
the BGP session has a valid IPv6 address. This is problematic because
the peer router may not be able to route the nexthop IPv6 address (ie.
if the outgoing interface has not IPv6).

Fix the issue by always sending a IPv4-mapped IPv6 address as nexthop
when the BGP session is on IPv4 and address family IPv6.

Link: https://datatracker.ietf.org/doc/html/rfc4798#section-2
Fixes: 92d6f76 ("lib,zebra,bgpd: Fix for nexthop as IPv4 mapped IPv6 address")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotopotests: add an ebgp 6vpe test
Philippe Guibert [Mon, 13 Mar 2023 09:47:16 +0000 (10:47 +0100)]
topotests: add an ebgp 6vpe test

This test uses the connected ipv4 mapped ipv6 prefix
to resolve the received BGP routes.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: François Dumontet <francois.dumontet@6wind.com>
14 months agozebra: changes for code maintainability 15429/head
sri-mohan1 [Mon, 26 Feb 2024 08:51:12 +0000 (14:21 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #15426 from idryzhov/bgp-rmap-yang
Donatas Abraitis [Mon, 26 Feb 2024 07:44:20 +0000 (09:44 +0200)]
Merge pull request #15426 from idryzhov/bgp-rmap-yang

bgpd, yang: fix missing mandatory/default statements on some leafs

14 months agolib: fix prefix-list entry update 15427/head
Igor Ryzhov [Sun, 25 Feb 2024 23:00:17 +0000 (01:00 +0200)]
lib: fix prefix-list entry update

When a prefix-list entry is updated, current NB code calls the
replacement code multiple times, once per each updated field. It means
that when multiple fields of an entry are changed in a single commit,
the replacement is done with an interim state of a prefix-list instead
of a final one. To fix the issue, we should call the replacement code
once, after all fields of an entry are updated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: fix access-list entry update
Igor Ryzhov [Sun, 25 Feb 2024 21:12:14 +0000 (23:12 +0200)]
lib: fix access-list entry update

When an access-list entry is updated, current NB code calls notification
hooks for each updated field. It means that when multiple fields of an
entry are changed in a single commit, the hooks are run with an interim
state of an access-list instead of a final one. To fix the issue, we
should call the hooks once, after all fields of an entry are updated.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agobgpd, yang: fix missing mandatory/default statements on some leafs 15426/head
Igor Ryzhov [Sun, 25 Feb 2024 19:50:41 +0000 (21:50 +0200)]
bgpd, yang: fix missing mandatory/default statements on some leafs

The code expects these leafs to always exist. If they are not set, the
daemon would crash. CLI always sets them, but we should properly mark
them as mandatory/default to prevent them from being missed when using
the API.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15423 from idryzhov/fix-nb-choice
Christian Hopps [Sun, 25 Feb 2024 21:54:16 +0000 (16:54 -0500)]
Merge pull request #15423 from idryzhov/fix-nb-choice

lib: fix processing of choices in northbound

14 months agotests: add test for required choice/np-container callbacks 15423/head
Christian Hopps [Sun, 25 Feb 2024 04:24:05 +0000 (23:24 -0500)]
tests: add test for required choice/np-container callbacks

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: add test for northbound ordering fix
Christian Hopps [Sun, 25 Feb 2024 02:39:30 +0000 (21:39 -0500)]
tests: add test for northbound ordering fix

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: fix nb callbacks for containers inside choice case
Igor Ryzhov [Fri, 23 Feb 2024 22:06:41 +0000 (00:06 +0200)]
lib: fix nb callbacks for containers inside choice case

Containers inside a choice's case must be treated as presence containers
as they can be explicitly created and deleted. They must have `create`
and `destroy` callbacks, otherwise the internal data they represent may
never be deleted.

The issue can be reproduced with the following steps:
- create an access-list with destination-network params
  ```
  # access-list test seq 1 permit ip any 10.10.10.0 0.0.0.255
  ```
- delete the `destination-network` container
  ```
  # mgmt delete-config /frr-filter:lib/access-list[name='test'][type='ipv4']/entry[sequence='1']/destination-network
  # mgmt commit apply
  MGMTD: No changes found to be committed!
  ```

As the `destination-network` container is non-presence, and all its
leafs are mandatory, mgmtd doesn't see any changes to be commited and
simply updates its YANG data tree without passing any updates to backend
daemons.

This commit fixes the issue by requiring `create` and `destroy`
callbacks for containers inside choice's cases.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: fix order of northbound operations
Igor Ryzhov [Fri, 23 Feb 2024 19:14:26 +0000 (21:14 +0200)]
lib: fix order of northbound operations

When ordering operations, destroys must always come before other
operations, to correctly cover the change of a "case" in a "choice".

The problem can be reproduced with the following commands:
```
access-list test seq 1 permit 10.0.0.0/8
access-list test seq 1 permit host 10.0.0.1
access-list test seq 1 permit 10.0.0.0/8
```

Before this commit, the order of changes would be the following:
- `access-list test seq 1 permit 10.0.0.0/8`
  - `modify` for `ipv4-prefix`
- `access-list test seq 1 permit host 10.0.0.1`
  - `destroy` for `ipv4-prefix`
  - `modify` for `host`
- `access-list test seq 1 permit 10.0.0.0/8`
  - `modify` for `ipv4-prefix`
  - `destroy` for `host`

As `destroy` for `host` is called last, it rewrites the fields that were
filled by `modify` callback of `ipv4-prefix`. This commit fixes this
problem by always calling `destroy` callbacks first.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15421 from idryzhov/fix-fe-client-notify
Christian Hopps [Fri, 23 Feb 2024 21:29:25 +0000 (16:29 -0500)]
Merge pull request #15421 from idryzhov/fix-fe-client-notify

lib: fix processing of notifications on mgmt fe client

14 months agolib: fix processing of notifications on mgmt fe client 15421/head
Igor Ryzhov [Fri, 23 Feb 2024 16:53:46 +0000 (18:53 +0200)]
lib: fix processing of notifications on mgmt fe client

Notifications are sent by mgmtd for each session of a client, so they
should be processed once per each session.

Also, add session_id parameter to an async_notification callback as all
other callbacks have this parameter.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15405 from LabNConsulting/chopps/fix-fe-client
Donald Sharp [Fri, 23 Feb 2024 14:47:46 +0000 (09:47 -0500)]
Merge pull request #15405 from LabNConsulting/chopps/fix-fe-client

tests: use more standard name for python3

14 months agoMerge pull request #15410 from louis-6wind/optim-nhflags
Donatas Abraitis [Fri, 23 Feb 2024 08:18:15 +0000 (10:18 +0200)]
Merge pull request #15410 from louis-6wind/optim-nhflags

bgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags

14 months agoMerge pull request #15406 from donaldsharp/evpn_mh_fix
Donatas Abraitis [Fri, 23 Feb 2024 08:04:50 +0000 (10:04 +0200)]
Merge pull request #15406 from donaldsharp/evpn_mh_fix

tests: bgp_evpn_mh timing issue fix

14 months agoMerge pull request #15384 from louis-6wind/isis-show-all-algos
Donatas Abraitis [Fri, 23 Feb 2024 07:51:13 +0000 (09:51 +0200)]
Merge pull request #15384 from louis-6wind/isis-show-all-algos

isisd: display all the algorithms at the same time

14 months agoMerge pull request #15383 from donaldsharp/cpp_evpn_data
Donatas Abraitis [Fri, 23 Feb 2024 07:49:15 +0000 (09:49 +0200)]
Merge pull request #15383 from donaldsharp/cpp_evpn_data

zebra: Remove deprecated items

14 months agoMerge pull request #15409 from sri-mohan1/srib-24-zebra-dpdk-dp
Donald Sharp [Thu, 22 Feb 2024 18:47:30 +0000 (13:47 -0500)]
Merge pull request #15409 from sri-mohan1/srib-24-zebra-dpdk-dp

zebra: changes for code maintainability

14 months agobgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags 15410/head
Louis Scalbert [Fri, 29 Apr 2022 17:41:57 +0000 (19:41 +0200)]
bgpd: move mp_nexthop_prefer_global boolean attribute to nh_flags

Move mp_nexthop_prefer_global boolean attribute to nh_flags. It does
not currently save memory because of the packing.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agozebra: changes for code maintainability 15409/head
sri-mohan1 [Thu, 22 Feb 2024 05:03:47 +0000 (10:33 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agotests: bgp_evpn_mh timing issue fix 15406/head
Donald Sharp [Wed, 21 Feb 2024 23:12:00 +0000 (18:12 -0500)]
tests: bgp_evpn_mh timing issue fix

This test is failing locally for me 100% of the time
since zebra was converted to mgmtd usage.  The failed
command is:

torm11# show evpn mac vni 1000 mac 00:00:00:00:00:11 json
{
  "00:00:00:00:00:11":{
    "type":"auto",
    "uptime":"00:02:01",
    "localSequence":0,
    "remoteSequence":0,
    "detectionCount":0,
    "isDuplicate":false,
    "syncNeighCount":0,
    "neighbors":{
      "active":[
      ],
      "inactive":[
        "45.0.0.11"
      ]
    }
  }
}

The test is expecting an esi as a key in the output.  Re-arranging
the startup of the tor's before the hosts fixes the issue.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agozebra: fix crash if macvlan link in another netns 15399/head
Louis Scalbert [Tue, 20 Feb 2024 16:49:01 +0000 (17:49 +0100)]
zebra: fix crash if macvlan link in another netns

A macvlan interface can have its underlying link-interface in another
namespace (aka. netns). However, by default, zebra does not know the
interface from the other namespaces. It results in a crash the pointer
to the link interface is NULL.

> 6  0x0000559d77a329d3 in zebra_vxlan_macvlan_up (ifp=0x559d798b8e00) at /root/frr/zebra/zebra_vxlan.c:4676
> 4676 link_zif = link_ifp->info;
> (gdb) list
> 4671 struct interface *link_ifp, *link_if;
> 4672
> 4673 zif = ifp->info;
> 4674 assert(zif);
> 4675 link_ifp = zif->link;
> 4676 link_zif = link_ifp->info;
> 4677 assert(link_zif);
> 4678
> (gdb) p zif->link
> $2 = (struct interface *) 0x0
> (gdb) p zif->link_ifindex
> $3 = 15

Fix the crash by returning when the macvlan link-interface is in another
namespace. No need to go further because any vxlan under the macvlan
interface would not be accessible by zebra.

Link: https://github.com/FRRouting/frr/issues/15370
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: use more standard name for python3 15405/head
Christian Hopps [Wed, 21 Feb 2024 12:55:54 +0000 (07:55 -0500)]
tests: use more standard name for python3

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoMerge pull request #15401 from idryzhov/fix-nb-crash
Christian Hopps [Wed, 21 Feb 2024 05:16:47 +0000 (00:16 -0500)]
Merge pull request #15401 from idryzhov/fix-nb-crash

Fix order of NB callbacks (and a crash)

14 months agolib: fix order of northbound callbacks 15401/head
Igor Ryzhov [Tue, 20 Feb 2024 20:32:52 +0000 (22:32 +0200)]
lib: fix order of northbound callbacks

When ordering the NB callbacks according to their priorities, if the
operation is "destroy" we should reverse the order, to destroy the
dependants before the dependencies.

This fixes the crash, that can be reproduced with the following steps:
```
frr# conf term file-lock
frr(config)# affinity-map map bit-position 10
frr(config)# interface test
frr(config-if)# link-params
frr(config-link-params)# affinity map
frr(config-link-params)# exit
frr(config-if)# exit
frr(config)# mgmt commit apply
frr(config)# no affinity-map map
frr(config)# interface test
frr(config-if)# link-params
frr(config-link-params)# no affinity map
frr(config-link-params)# exit
frr(config-if)# exit
frr(config)# mgmt commit apply
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: add missing priority for affinity map callbacks
Igor Ryzhov [Tue, 20 Feb 2024 20:27:29 +0000 (22:27 +0200)]
lib: add missing priority for affinity map callbacks

Other objects depend on affinity-maps being created before them by using
leafref with require-instance true. Set the priority to ensure that.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15393 from idryzhov/fix-base64
Donald Sharp [Tue, 20 Feb 2024 15:20:28 +0000 (10:20 -0500)]
Merge pull request #15393 from idryzhov/fix-base64

lib: fix base64 encoding

14 months agoMerge pull request #15377 from opensourcerouting/fix/bgpd_evpn_route_map
Russ White [Tue, 20 Feb 2024 15:17:46 +0000 (10:17 -0500)]
Merge pull request #15377 from opensourcerouting/fix/bgpd_evpn_route_map

lib: Do not convert EVPN prefixes into IPv4/IPv6 if not needed

14 months agoMerge pull request #15367 from rampxxxx/ldp_sync_cleanup
Russ White [Tue, 20 Feb 2024 15:15:39 +0000 (10:15 -0500)]
Merge pull request #15367 from rampxxxx/ldp_sync_cleanup

ospfd: fix cli shown in running config when turning off ldp-sync

14 months agoMerge pull request #15366 from cscarpitta/feature/srv6-fpm-pb-extension
Russ White [Tue, 20 Feb 2024 15:14:56 +0000 (10:14 -0500)]
Merge pull request #15366 from cscarpitta/feature/srv6-fpm-pb-extension

fpm: Add support for SRv6 to FPM protobuf

14 months agoMerge pull request #15351 from louis-6wind/fix-leak-vrf-interface
Russ White [Tue, 20 Feb 2024 15:14:20 +0000 (10:14 -0500)]
Merge pull request #15351 from louis-6wind/fix-leak-vrf-interface

bgpd: update route leak after vrf interface changes

14 months agozebra: Remove deprecated items 15383/head
Donald Sharp [Fri, 16 Feb 2024 04:42:46 +0000 (23:42 -0500)]
zebra: Remove deprecated items

Both zebra_evpn.c and zebra_vxlan.c have items that
were deprecated a year ago.  Let's remove them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoMerge pull request #15394 from sri-mohan1/srib-24-babel
Donald Sharp [Tue, 20 Feb 2024 12:02:59 +0000 (07:02 -0500)]
Merge pull request #15394 from sri-mohan1/srib-24-babel

babeld: changes for code maintainability

14 months agobabeld: changes for code maintainability 15394/head
sri-mohan1 [Mon, 19 Feb 2024 18:32:50 +0000 (00:02 +0530)]
babeld: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
14 months agoMerge pull request #15381 from LabNConsulting/chopps/nb-notif
Igor Ryzhov [Mon, 19 Feb 2024 14:52:47 +0000 (16:52 +0200)]
Merge pull request #15381 from LabNConsulting/chopps/nb-notif

lib: mgmtd: add xpath arg to YANG notification message

14 months agolib: fix base64 encoding 15393/head
Igor Ryzhov [Mon, 19 Feb 2024 13:35:22 +0000 (15:35 +0200)]
lib: fix base64 encoding

Remove adding of line feeds when encondig. We're using these functions
only for encoding binary data for storing in YANG data tree.

According to RFC 7950, section 9.8.2:
```
9.8.2.  Lexical Representation

   Binary values are encoded with the base64 encoding scheme (see
   Section 4 in [RFC4648]).
```

According to mentioned RFC 4648, section 3.1:
```
   Implementations MUST NOT add line feeds to base-encoded data unless
   the specification referring to this document explicitly directs base
   encoders to add line feeds after a specific number of characters.
```

Therefore, line feeds must not be added to the encoded data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15389 from opensourcerouting/fix/add_mgmtd_pytest_marker
Christian Hopps [Mon, 19 Feb 2024 11:36:15 +0000 (06:36 -0500)]
Merge pull request #15389 from opensourcerouting/fix/add_mgmtd_pytest_marker

doc: Add `mgmtd` pytest marker into documentation

14 months agodoc: show isis optional algorithm id 15384/head
Louis Scalbert [Mon, 19 Feb 2024 09:13:51 +0000 (10:13 +0100)]
doc: show isis optional algorithm id

Set optional algorithm ID in the show isis commands.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoisisd: make algorithm id optional in show isis commands
Philippe Guibert [Thu, 15 Dec 2022 08:28:19 +0000 (09:28 +0100)]
isisd: make algorithm id optional in show isis commands

The following two isis commands have now the algorithm id
optional:

> # show isis segment-routing node algorithm
> # show isis topology algorithm

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoisisd: show isis route .. json adds the algorithm value
Philippe Guibert [Mon, 19 Dec 2022 14:39:00 +0000 (15:39 +0100)]
isisd: show isis route .. json adds the algorithm value

When walking over all the flex-algorithm routes, it is
difficult to know which route is associated to which
algorithm: add "algorithm" attribute to the json object.

Output example:

> ubuntu2004(config-router)# do show isis route algorithm  json
> [
>   {
>     "area":"1",
>     "algorithm":128,
>     "level-1":{
>      ]
>    },
>    "level-2":{
>      "area":"1"
>    },
>    "vrf_id":0
>  },
>  {
>    "area":"1",
>    "algorithm":129,
>    "level-1":{
>      "area":"1",

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoisisd: make optional algorithm id in 'show isis route'
Philippe Guibert [Thu, 15 Dec 2022 08:26:45 +0000 (09:26 +0100)]
isisd: make optional algorithm id in 'show isis route'

To avoid calling for each algorithm the 'show isis route'
command, the algorithm id is optional. The below command
will dump the routes for all the algorithms:

> show isis route algorithm

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agolib: mgmtd: add xpath arg to notification message 15381/head
Christian Hopps [Wed, 14 Feb 2024 15:04:11 +0000 (10:04 -0500)]
lib: mgmtd: add xpath arg to notification message

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agofpm: Add func to encode SRv6 SIDs in protobuf 15366/head
Carmine Scarpitta [Tue, 13 Feb 2024 10:48:11 +0000 (11:48 +0100)]
fpm: Add func to encode SRv6 SIDs in protobuf

Add a bunch of helper functions to support encoding of SRv6 SIDs in
protobuf.

Specifically,
* `fpm_srv6_sid_format_create`: encode SID format information into a
protobuf `SRv6SIDFormat` structure
* `fpm_srv6_local_sid_*_behavior_create` functions: encode an SRv6 SID
behavior and associated attributes into a protobuf
`Fpm__SRv6LocalSID__*` structure

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add functions to encode nexthop in protobuf
Carmine Scarpitta [Tue, 13 Feb 2024 10:40:49 +0000 (11:40 +0100)]
fpm: Add functions to encode nexthop in protobuf

Add two helper functions to encode/decode nexthops in protobuf.

Specifically,
* `fpm_nexthop_create`: encode a `struct nexthop` in a protobuf nexthop
structure
* `fpm_nexthop_get`: decode a nexthop protobuf structure into a `struct
nexthop`

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add SRv6 VPN SIDs to `fpm.proto`
Carmine Scarpitta [Tue, 13 Feb 2024 11:12:34 +0000 (12:12 +0100)]
fpm: Add SRv6 VPN SIDs to `fpm.proto`

Add two optional fields to the AddRoute protobuf message to support
SRv6 VPN use cases:
* `srv6_vpn_sid`: used to associate an SRv6 VPN SID to a route; if
present, the router will steer the traffic that matches the prefix by
encapsulating the payload in an outer IPv6 header where the destination
address is the SRv6 VPN SID provided
* `srv6_encap_source_address`: source Address of outer encapsulating
IPv6 header

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agofpm: Add SRv6 Local SIDs to `fpm.proto`
Carmine Scarpitta [Tue, 13 Feb 2024 09:29:34 +0000 (10:29 +0100)]
fpm: Add SRv6 Local SIDs to `fpm.proto`

Add several protobuf messages to support the installation and removal
of SRv6 Local SIDs via FPM protobuf.

This is a preliminary commit to support sending SRv6 Local SIDs and VPN
SIDs via protobuf.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agoMerge pull request #15357 from dpward/master
Donatas Abraitis [Sun, 18 Feb 2024 12:43:21 +0000 (14:43 +0200)]
Merge pull request #15357 from dpward/master

github: Replace issue template with issue form

14 months agodoc: Add `mgmtd` pytest marker into documentation 15389/head
Donatas Abraitis [Sat, 17 Feb 2024 09:24:29 +0000 (11:24 +0200)]
doc: Add `mgmtd` pytest marker into documentation

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15376 from sri-mohan1/srib-24-babel
Donatas Abraitis [Fri, 16 Feb 2024 20:29:06 +0000 (22:29 +0200)]
Merge pull request #15376 from sri-mohan1/srib-24-babel

babeld: changes for code maintainability

14 months agoMerge pull request #15378 from idryzhov/ospf-suppress-fa
Donald Sharp [Fri, 16 Feb 2024 12:26:24 +0000 (07:26 -0500)]
Merge pull request #15378 from idryzhov/ospf-suppress-fa

tests: fix ospf_suppress_fa timing issue

14 months agoMerge pull request #15382 from donaldsharp/more_sa_failures
Igor Ryzhov [Fri, 16 Feb 2024 11:55:35 +0000 (13:55 +0200)]
Merge pull request #15382 from donaldsharp/more_sa_failures

More sa failures

14 months agobgpd: Fix value stored to group never being read 15382/head
Donald Sharp [Fri, 16 Feb 2024 04:28:18 +0000 (23:28 -0500)]
bgpd: Fix value stored to group never being read

SA Reports:

bgpd/bgp_rpki.c:1085:24: warning: Value stored to 'group' during its initialization is never read [deadcode.DeadStores]
        struct rtr_mgr_group *group = get_connected_group(rpki_vrf);
                              ^~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agoospfd: Fix assignment with never being used
Donald Sharp [Fri, 16 Feb 2024 04:27:38 +0000 (23:27 -0500)]
ospfd: Fix assignment with never being used

SA finds this:

error 14-Feb-2024 14:52:24 ospfd/ospf_te.c:3962:2: warning: Value stored to 'sub' is never read [deadcode.DeadStores]
error 14-Feb-2024 14:52:24         sub = 0;
error 14-Feb-2024 14:52:24         ^     ~
error 14-Feb-2024 14:52:24 1 warning generated.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agolib: always call new notification hooks too
Christian Hopps [Mon, 12 Feb 2024 18:03:32 +0000 (13:03 -0500)]
lib: always call new notification hooks too

- call the new notification hooks when backends call the old notification
posting API.

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoMerge pull request #15371 from LabNConsulting/chopps/mgmtd-fixes
Igor Ryzhov [Thu, 15 Feb 2024 18:02:23 +0000 (20:02 +0200)]
Merge pull request #15371 from LabNConsulting/chopps/mgmtd-fixes

Fixes for the northbound/mgmtd

14 months agotests: fix ospf_suppress_fa timing issue 15378/head
Igor Ryzhov [Thu, 15 Feb 2024 13:35:24 +0000 (15:35 +0200)]
tests: fix ospf_suppress_fa timing issue

Set static router-id for OSPF, because otherwise it depends on timing of
router-id updates received from zebra and may differ between test runs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib: actually create the tree for the conversion 15371/head
Christian Hopps [Wed, 14 Feb 2024 22:32:04 +0000 (17:32 -0500)]
lib: actually create the tree for the conversion

Before this fix would always return empty results b/c there was no
libyang tree to print to output format.

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agolib: fix memleak on success
Christian Hopps [Wed, 14 Feb 2024 22:31:12 +0000 (17:31 -0500)]
lib: fix memleak on success

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agotests: Check if multiple route-map match clauses works for EVPN prefixes 15377/head
Donatas Abraitis [Thu, 15 Feb 2024 10:19:43 +0000 (12:19 +0200)]
tests: Check if multiple route-map match clauses works for EVPN prefixes

Test prefix-list matching and some other EVPN stuff.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agolib: Do not convert EVPN prefixes into IPv4/IPv6 if not needed
Donatas Abraitis [Thu, 15 Feb 2024 10:07:43 +0000 (12:07 +0200)]
lib: Do not convert EVPN prefixes into IPv4/IPv6 if not needed

Convert only when this is really needed, e.g. `match ip address prefix-list ...`.

Otherwise, we can't have mixed match clauses, like:

```
match ip address prefix-list p1
match evpn route-type prefix
```

This won't work, because the prefix is already converted, and we can't extract
route type, vni, etc. from the original EVPN prefix.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agogithub: Replace issue template with issue form 15357/head
David Ward [Mon, 12 Feb 2024 11:30:26 +0000 (06:30 -0500)]
github: Replace issue template with issue form

Signed-off-by: David Ward <david.ward@gatech.edu>
14 months agotests: check route leak update after vrf creation and deletion 15351/head
Louis Scalbert [Fri, 9 Feb 2024 15:28:18 +0000 (16:28 +0100)]
tests: check route leak update after vrf creation and deletion

Ensure that a locally leaked route is updated after a VRF (dis)appears.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: update route leak when vrf appears
Louis Scalbert [Fri, 9 Feb 2024 15:28:23 +0000 (16:28 +0100)]
bgpd: update route leak when vrf appears

If the VRF is not yet created and a BGP instance is created for the
VRF, dependent leaked routes are inactive, which is normal. However,
when the VRF interface appears, they remains inactive.

Update route leak when a VRF interface appears. Note that routes to a
deleted VRF are already removed by zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: check route leak after changing vrf state
Louis Scalbert [Fri, 9 Feb 2024 14:47:40 +0000 (15:47 +0100)]
tests: check route leak after changing vrf state

Check that local route leaks are set to "inactive" when the VRF
interface is shutdown and, conversely, that they are set to "active"
when the VRF interface is unshut.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: update route leak when vrf state changes
Louis Scalbert [Tue, 26 Apr 2022 14:57:45 +0000 (16:57 +0200)]
bgpd: update route leak when vrf state changes

Locally leaked routes remain active after the nexthop VRF interface goes
down.

Update route leaking when the loopback or a VRF interface state change is
received from zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: use check_ping in bgp_vrf_route_leak_basic
Louis Scalbert [Wed, 14 Feb 2024 15:35:51 +0000 (16:35 +0100)]
tests: use check_ping in bgp_vrf_route_leak_basic

Use check_ping in bgp_vrf_route_leak_basic

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: add source_addr in check_ping
Louis Scalbert [Wed, 14 Feb 2024 15:32:13 +0000 (16:32 +0100)]
tests: add source_addr in check_ping

Allow specifying a source_addr in check_ping library function.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: fix duplicates in bgp_vrf_route_leak_basic
Louis Scalbert [Fri, 9 Feb 2024 14:55:47 +0000 (15:55 +0100)]
tests: fix duplicates in bgp_vrf_route_leak_basic

Test functions were duplicated by mistakes. They were identical.

Fixes: 8af61c8a34 ("topotests: test leak from the default vrf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoMerge pull request #15332 from donaldsharp/nhg_stuffs
Donatas Abraitis [Wed, 14 Feb 2024 14:14:19 +0000 (16:14 +0200)]
Merge pull request #15332 from donaldsharp/nhg_stuffs

Nhg stuffs

14 months agoMerge pull request #15288 from donaldsharp/shell_access_removal
Donatas Abraitis [Wed, 14 Feb 2024 09:20:36 +0000 (11:20 +0200)]
Merge pull request #15288 from donaldsharp/shell_access_removal

vtysh: Remove deprecated shell_access code

14 months agoMerge pull request #15359 from LabNConsulting/chopps/reap-unused-phase
Igor Ryzhov [Wed, 14 Feb 2024 09:15:06 +0000 (11:15 +0200)]
Merge pull request #15359 from LabNConsulting/chopps/reap-unused-phase

mgmtd: remove unused commit phase SEND_CFG

14 months agobuild: FRR 10.1 development version frr-10.0-dev
Donatas Abraitis [Tue, 13 Feb 2024 19:18:45 +0000 (21:18 +0200)]
build: FRR 10.1 development version

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>