]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
14 months agolib: fix prefix-list entry update 15437/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>
(cherry picked from commit 0bc2ab8598fa1418d3a45499e4f047622d21d6b4)

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>
(cherry picked from commit a9460ae713a43285a972070d925ce38eaa5e363a)

14 months agoMerge pull request #15435 from FRRouting/mergify/bp/dev/10.0/pr-15387
Donatas Abraitis [Tue, 27 Feb 2024 11:36:01 +0000 (13:36 +0200)]
Merge pull request #15435 from FRRouting/mergify/bp/dev/10.0/pr-15387

bgpd: fix no bgp as-path access-list issue  (backport #15387)

14 months agobgpd: fix no bgp as-path access-list issue 15435/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>
(cherry picked from commit 100ef15262316b34ec46220806dc816db729870f)

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>
(cherry picked from commit 324fa2101550b542946a34de09b394df8bf8ba9d)

14 months agoMerge pull request #15433 from FRRouting/mergify/bp/dev/10.0/pr-15430
Donatas Abraitis [Tue, 27 Feb 2024 07:48:15 +0000 (09:48 +0200)]
Merge pull request #15433 from FRRouting/mergify/bp/dev/10.0/pr-15430

lib: fix setting temporary log options for libyang (backport #15430)

14 months agolib: fix setting temporary log options for libyang 15433/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>
(cherry picked from commit 3cd6ddaec6fd41ac84ef23595ffc7e3d18334839)

14 months agoMerge pull request #15428 from FRRouting/mergify/bp/dev/10.0/pr-15426
Igor Ryzhov [Mon, 26 Feb 2024 11:52:38 +0000 (13:52 +0200)]
Merge pull request #15428 from FRRouting/mergify/bp/dev/10.0/pr-15426

bgpd, yang: fix missing mandatory/default statements on some leafs (backport #15426)

14 months agobgpd, yang: fix missing mandatory/default statements on some leafs 15428/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>
(cherry picked from commit 83a3b0f10f994ee5adbbef0f6bd970b69eab4486)

14 months agoMerge pull request #15425 from FRRouting/mergify/bp/dev/10.0/pr-15423
Donatas Abraitis [Mon, 26 Feb 2024 06:06:57 +0000 (08:06 +0200)]
Merge pull request #15425 from FRRouting/mergify/bp/dev/10.0/pr-15423

lib: fix processing of choices in northbound (backport #15423)

14 months agotests: add test for required choice/np-container callbacks 15425/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>
(cherry picked from commit e5acf6797cbeb3c68946c3a7f65d4d8b433d85f5)

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>
(cherry picked from commit a37f5f9153b0652f0f551d2e36fbfea8dab8c020)

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>
(cherry picked from commit 0b905f740459291bca12e552aea4975fb46e9d98)

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>
(cherry picked from commit 38b85e0c2bc555b8827dbd2cb6515b6febf548b4)

14 months agoMerge pull request #15422 from FRRouting/mergify/bp/dev/10.0/pr-15421
Igor Ryzhov [Sat, 24 Feb 2024 15:51:16 +0000 (17:51 +0200)]
Merge pull request #15422 from FRRouting/mergify/bp/dev/10.0/pr-15421

lib: fix processing of notifications on mgmt fe client (backport #15421)

14 months agolib: fix processing of notifications on mgmt fe client 15422/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>
(cherry picked from commit 13359c5cc9b8fd84c62b30443e063d96e9a73034)

14 months agoMerge pull request #15403 from FRRouting/mergify/bp/dev/10.0/pr-15401
Igor Ryzhov [Wed, 21 Feb 2024 13:28:28 +0000 (15:28 +0200)]
Merge pull request #15403 from FRRouting/mergify/bp/dev/10.0/pr-15401

Fix order of NB callbacks (and a crash) (backport #15401)

14 months agolib: fix order of northbound callbacks 15403/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>
(cherry picked from commit 01f371a677dc52ff888b14360f6ffd63b91f3845)

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>
(cherry picked from commit 323caf1d7013c4787b30ee34b3c53dd4bf0a92aa)

14 months agoMerge pull request #15398 from FRRouting/mergify/bp/dev/10.0/pr-15381
Igor Ryzhov [Tue, 20 Feb 2024 21:28:08 +0000 (23:28 +0200)]
Merge pull request #15398 from FRRouting/mergify/bp/dev/10.0/pr-15381

lib: mgmtd: add xpath arg to YANG notification message (backport #15381)

14 months agolib: mgmtd: add xpath arg to notification message 15398/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>
(cherry picked from commit 4a93d171c2e3ec1ff6c4fc553d6acf42e035e0d4)

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>
(cherry picked from commit 1d4ea437e4a4fced3fce6e441952fdea8d94af80)

14 months agoMerge pull request #15380 from FRRouting/mergify/bp/dev/10.0/pr-15371
Igor Ryzhov [Thu, 15 Feb 2024 22:10:18 +0000 (00:10 +0200)]
Merge pull request #15380 from FRRouting/mergify/bp/dev/10.0/pr-15371

Fixes for the northbound/mgmtd (backport #15371)

14 months agolib: actually create the tree for the conversion 15380/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>
(cherry picked from commit dff28248c3c1dee0d1c9f9225dab66224c6aac54)

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>
(cherry picked from commit b8e07049a8ee684eaa8df48bef6e7bfbc853644d)

14 months agotools: Change the major version from 9 to 10
Donatas Abraitis [Tue, 13 Feb 2024 19:19:52 +0000 (21:19 +0200)]
tools: Change the major version from 9 to 10

It was decided to keep it 10, not 9 as planned initially.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15234 from opensourcerouting/snmp-topotest-fixes base_10.0
Donald Sharp [Tue, 13 Feb 2024 15:59:30 +0000 (10:59 -0500)]
Merge pull request #15234 from opensourcerouting/snmp-topotest-fixes

topotests: fix snmptrap log OID parsing

14 months agoMerge pull request #15320 from donaldsharp/vtysh_limit_fds
Russ White [Tue, 13 Feb 2024 14:50:00 +0000 (09:50 -0500)]
Merge pull request #15320 from donaldsharp/vtysh_limit_fds

lib, ospfclient, vtysh: Allow for a minimum fd poll size

14 months agoMerge pull request #15284 from opensourcerouting/feature/bgpd_announce_rpki_state_knob
Russ White [Tue, 13 Feb 2024 14:35:10 +0000 (09:35 -0500)]
Merge pull request #15284 from opensourcerouting/feature/bgpd_announce_rpki_state_knob

bgpd: Add neighbor X send-community extended rpki command

14 months agoMerge pull request #15042 from Orange-OpenSource/ospf-te
Christian Hopps [Tue, 13 Feb 2024 10:37:29 +0000 (05:37 -0500)]
Merge pull request #15042 from Orange-OpenSource/ospf-te

ospfd: Add Opaque LSA decoder for json output

14 months agoMerge pull request #15361 from idryzhov/fix-be-interested
Christian Hopps [Tue, 13 Feb 2024 01:11:20 +0000 (20:11 -0500)]
Merge pull request #15361 from idryzhov/fix-be-interested

mgmtd: fix be_is_client_interested

14 months agoMerge pull request #15352 from louis-6wind/fix-leak-recursive
Donatas Abraitis [Mon, 12 Feb 2024 19:42:03 +0000 (21:42 +0200)]
Merge pull request #15352 from louis-6wind/fix-leak-recursive

bgpd: fix route recursion on leaked routes

14 months agomgmtd: fix be_is_client_interested 15361/head
Igor Ryzhov [Mon, 12 Feb 2024 18:34:33 +0000 (20:34 +0200)]
mgmtd: fix be_is_client_interested

Backend "subscribe" API allows daemons to dynamically register xpaths
they are interested in. Such xpaths are not stored in hardcoded
config/oper xpath arrays so this function fails to understand that a
backend daemon is interested in them. Fix by using dynamic xpath maps
instead which store both hardcoded and dynamic xpaths.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15358 from LabNConsulting/chopps/doc-update
Igor Ryzhov [Mon, 12 Feb 2024 17:52:35 +0000 (19:52 +0200)]
Merge pull request #15358 from LabNConsulting/chopps/doc-update

update doc with new more strict protobuf requirements

14 months agotests: adapt ospfapiclient test to new json output 15042/head
Olivier Dugeon [Thu, 21 Dec 2023 21:12:59 +0000 (22:12 +0100)]
tests: adapt ospfapiclient test to new json output

Following new json decoder for Opaque LSA, this patch adapts the ospfapiclient
test to the new json output.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode Extended Link & Prefix TLVs for json
Olivier Dugeon [Tue, 19 Dec 2023 15:00:25 +0000 (16:00 +0100)]
ospfd: Decode Extended Link & Prefix TLVs for json

When dumping ospf database with json output, decode Extended Link and Extended
Prefix TLVs and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode Router Info. TLVs for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:59:33 +0000 (15:59 +0100)]
ospfd: Decode Router Info. TLVs for json output

When dumping ospf database with json output, decode Router Information TLVs
and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Decode TE TLVs for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:57:49 +0000 (15:57 +0100)]
ospfd: Decode TE TLVs for json output

When dumping ospf database with json output, decode Traffic Engineering TLVs
and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agoospfd: Prepare Opaque LSA for json output
Olivier Dugeon [Tue, 19 Dec 2023 14:56:12 +0000 (15:56 +0100)]
ospfd: Prepare Opaque LSA for json output

Instead of output bulk of data with json output, prepare json context to decode
opaque TLVs and sub-TLVs.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
14 months agotests: fix grpc test 15358/head
Christian Hopps [Mon, 12 Feb 2024 12:48:50 +0000 (07:48 -0500)]
tests: fix grpc test

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agodoc: docker: update with new more strict protobuf requirements
Christian Hopps [Mon, 12 Feb 2024 11:48:12 +0000 (06:48 -0500)]
doc: docker: update with new more strict protobuf requirements

Signed-off-by: Christian Hopps <chopps@labn.net>
14 months agoMerge pull request #15355 from idryzhov/fix-mgmtd-notif
Christian Hopps [Mon, 12 Feb 2024 11:17:38 +0000 (06:17 -0500)]
Merge pull request #15355 from idryzhov/fix-mgmtd-notif

Fix and rework YANG notifications

14 months agoMerge pull request #15346 from opensourcerouting/fix/memory_optimizations
Donald Sharp [Mon, 12 Feb 2024 02:33:44 +0000 (21:33 -0500)]
Merge pull request #15346 from opensourcerouting/fix/memory_optimizations

Some more memory optimizations

14 months agoMerge pull request #15356 from idryzhov/configure-sysconfdir
Donald Sharp [Mon, 12 Feb 2024 02:33:00 +0000 (21:33 -0500)]
Merge pull request #15356 from idryzhov/configure-sysconfdir

build: fix configure output

14 months agoMerge pull request #15347 from askorichenko/test-bgp-ttl
Donatas Abraitis [Sun, 11 Feb 2024 20:12:32 +0000 (22:12 +0200)]
Merge pull request #15347 from askorichenko/test-bgp-ttl

bgpd: fix minttl copying during peer reset

14 months agobuild: fix configure output 15356/head
Igor Ryzhov [Sat, 10 Feb 2024 22:53:06 +0000 (00:53 +0200)]
build: fix configure output

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib, mgmtd: rework processing of yang notifications 15355/head
Igor Ryzhov [Sat, 10 Feb 2024 00:11:13 +0000 (02:11 +0200)]
lib, mgmtd: rework processing of yang notifications

Currently, YANG notification processing is done using a special type of
callbacks registered in backend clients. In this commit, we start using
regular northbound infrastructure instead, because it already has a
convenient way of registering xpath-specific callbacks without the need
for creating additional structures for each necessary notification. We
also now pass a notification data to the callback, instead of a plain
JSON. This allows to use regular YANG library functions for inspecting
notification fields, instead of manually parsing the JSON.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agoMerge pull request #15354 from cscarpitta/fix/fpm-pb-add-missing-include
Donald Sharp [Sun, 11 Feb 2024 01:52:47 +0000 (20:52 -0500)]
Merge pull request #15354 from cscarpitta/fix/fpm-pb-add-missing-include

qpb: Add missing `#include nexthop.h`

14 months agoqpb: Add missing `#include nexthop.h` 15354/head
Carmine Scarpitta [Fri, 9 Feb 2024 23:44:50 +0000 (00:44 +0100)]
qpb: Add missing `#include nexthop.h`

In `qpb.h` we have a bunch of functions that make use of
`union g_addr`. `union g_addr` is defined in `nexthop.h`, which
actually is NOT included in `qpb.h`.

Let's add the missing `#include nexthop.h`.

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
14 months agoMerge pull request #15353 from vjardin/yang_converted
Igor Ryzhov [Fri, 9 Feb 2024 23:27:23 +0000 (01:27 +0200)]
Merge pull request #15353 from vjardin/yang_converted

mgmtd: ripng, libs fully converted

14 months agolib, mgmtd: fix processing of yang notifications
Igor Ryzhov [Fri, 9 Feb 2024 22:58:49 +0000 (00:58 +0200)]
lib, mgmtd: fix processing of yang notifications

Current code assumes that notification is always sent in stripped JSON
format and therefore notification xpath starts at the third symbol of
notification data. Assuming JSON is more or less fine, because this
representation is internal to FRR, but the assumption about the xpath is
wrong, because it won't work for not top-level notifications. YANG
allows to define notification as a child for some data node deep into
the tree and in this case notification data contains not only the
notification node itself, but also all its parents.

To fix the issue, parse the notification data and get its xpath from its
schema node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agomgmtd: ripng, libs fully converted 15353/head
Vincent JARDIN [Fri, 9 Feb 2024 18:18:48 +0000 (19:18 +0100)]
mgmtd: ripng, libs fully converted

While checking the code, we can notice that they are already converted.

Suggested-by: Igor Ryzhov <iryzhov@nfware.com>
Signed-off-by: Vincent Jardin <vjardin@free.fr>
14 months agobgpd: fix route recursion on leaked routes 15352/head
Louis Scalbert [Tue, 26 Apr 2022 14:45:42 +0000 (16:45 +0200)]
bgpd: fix route recursion on leaked routes

Leaked recursive routes are not resolved.

> VRF r1-cust1:
> B>  5.1.0.0/24 [200/98] via 99.0.0.1 (recursive), weight 1, 00:00:08
>  *                       via 192.168.1.2, r1-eth4, weight 1, 00:00:08
> B>* 99.0.0.1/32 [200/0] via 192.168.1.2, r1-eth4, weight 1, 00:00:08

> VRF r1-cust4:
> B   5.1.0.0/24 [20/98] via 99.0.0.1 (vrf r1-cust1) inactive, weight 1, 00:00:08
> B>* 99.0.0.1/32 [20/0] via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:08

When announcing the routes to zebra, use the peer of the ultimate bgp
path info instead of the one of the first parent path info to determine
whether the route is recursive.

The result is:
> VRF r1-cust4:
> B>  5.1.0.0/24 [20/98] via 99.0.0.1 (vrf r1-cust1) (recursive), weight 1, 00:00:02
>   *                      via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:02
> B>* 99.0.0.1/32 [20/0] via 192.168.1.2, r1-eth4 (vrf r1-cust1), weight 1, 00:00:02

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: check route recursion on leaked routes
Louis Scalbert [Fri, 9 Feb 2024 17:04:34 +0000 (18:04 +0100)]
tests: check route recursion on leaked routes

Check that leaks of a route with a recursive nexthop is possible.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agobgpd: fix minttl copying during peer reset 15347/head
Alexander Skorichenko [Fri, 9 Feb 2024 15:23:21 +0000 (16:23 +0100)]
bgpd: fix minttl copying during peer reset

Include gtsm_hops (minttl) field when copying peer structure,
so that a new connection could set a proper value.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
14 months agobgpd: Optimize memory for peer_connection struct 15346/head
Donatas Abraitis [Fri, 9 Feb 2024 15:29:35 +0000 (17:29 +0200)]
bgpd: Optimize memory for peer_connection struct

```
struct peer_connection {
struct peer *              peer;                 /*     0     8 */
enum bgp_fsm_status        status;               /*     8     4 */
enum bgp_fsm_status        ostatus;              /*    12     4 */
int                        fd;                   /*    16     4 */
uint32_t                   thread_flags;         /*    20     4 */
pthread_mutex_t            io_mtx;               /*    24    40 */
/* --- cacheline 1 boundary (64 bytes) --- */
struct stream_fifo *       ibuf;                 /*    64     8 */
struct stream_fifo *       obuf;                 /*    72     8 */
struct ringbuf *           ibuf_work;            /*    80     8 */
struct event *             t_read;               /*    88     8 */
struct event *             t_write;              /*    96     8 */
struct event *             t_connect;            /*   104     8 */
struct event *             t_delayopen;          /*   112     8 */
struct event *             t_start;              /*   120     8 */
/* --- cacheline 2 boundary (128 bytes) --- */
struct event *             t_holdtime;           /*   128     8 */
struct event *             t_connect_check_r;    /*   136     8 */
struct event *             t_connect_check_w;    /*   144     8 */
struct event *             t_gr_restart;         /*   152     8 */
struct event *             t_gr_stale;           /*   160     8 */
struct event *             t_generate_updgrp_packets; /*   168     8 */
struct event *             t_pmax_restart;       /*   176     8 */
struct event *             t_routeadv;           /*   184     8 */
/* --- cacheline 3 boundary (192 bytes) --- */
struct event *             t_process_packet;     /*   192     8 */
struct event *             t_process_packet_error; /*   200     8 */
union sockunion            su;                   /*   208   128 */

/* size: 336, cachelines: 6, members: 25 */
/* last cacheline: 16 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for bgp_nexthop_cache struct
Donatas Abraitis [Fri, 9 Feb 2024 15:25:05 +0000 (17:25 +0200)]
bgpd: Optimize memory for bgp_nexthop_cache struct

```
struct bgp_nexthop_cache {
afi_t                      afi;                  /*     0     4 */
ifindex_t                  ifindex_ipv6_ll;      /*     4     4 */
struct bgp_nexthop_cache_item entry;             /*     8    32 */
uint32_t                   metric;               /*    40     4 */
uint8_t                    nexthop_num;          /*    44     1 */
_Bool                      is_evpn_gwip_nexthop; /*    45     1 */
uint16_t                   change_flags;         /*    46     2 */
struct nexthop *           nexthop;              /*    48     8 */
time_t                     last_update;          /*    56     8 */
/* --- cacheline 1 boundary (64 bytes) --- */
uint16_t                   flags;                /*    64     2 */

/* XXX 2 bytes hole, try to pack */

uint32_t                   srte_color;           /*    68     4 */
struct bgp_nexthop_cache_head * tree;            /*    72     8 */
struct prefix              prefix __attribute__((__aligned__(8))); /*    80    56 */
/* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
void *                     nht_info;             /*   136     8 */
struct path_list           paths;                /*   144     8 */
unsigned int               path_count;           /*   152     4 */

/* XXX 4 bytes hole, try to pack */

struct bgp *               bgp;                  /*   160     8 */

/* size: 168, cachelines: 3, members: 17 */
/* sum members: 162, holes: 2, sum holes: 6 */
/* forced alignments: 1 */
/* last cacheline: 40 bytes */
} __attribute__((__aligned__(8)));   /* saved 16 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for ecommunity struct
Donatas Abraitis [Fri, 9 Feb 2024 15:21:23 +0000 (17:21 +0200)]
bgpd: Optimize memory for ecommunity struct

```
struct ecommunity {
long unsigned int          refcnt;               /*     0     8 */
uint8_t                    unit_size;            /*     8     1 */
_Bool                      disable_ieee_floating; /*     9     1 */

/* XXX 2 bytes hole, try to pack */

uint32_t                   size;                 /*    12     4 */
uint8_t *                  val;                  /*    16     8 */
char *                     str;                  /*    24     8 */

/* size: 32, cachelines: 1, members: 6 */
/* sum members: 30, holes: 1, sum holes: 2 */
/* last cacheline: 32 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Optimize memory for bgp_adj_out struct
Donatas Abraitis [Fri, 9 Feb 2024 15:18:22 +0000 (17:18 +0200)]
bgpd: Optimize memory for bgp_adj_out struct

```
struct bgp_adj_out {
struct rb_entry            adj_entry;            /*     0    32 */

/* XXX last struct has 4 bytes of padding */

struct update_subgroup *   subgroup;             /*    32     8 */
struct {
struct bgp_adj_out * tqe_next;           /*    40     8 */
struct bgp_adj_out * * tqe_prev;         /*    48     8 */
} subgrp_adj_train;                              /*    40    16 */
struct bgp_dest *          dest;                 /*    56     8 */
/* --- cacheline 1 boundary (64 bytes) --- */
uint32_t                   addpath_tx_id;        /*    64     4 */
uint32_t                   attr_hash;            /*    68     4 */
struct attr *              attr;                 /*    72     8 */
struct bgp_advertise *     adv;                  /*    80     8 */

/* size: 88, cachelines: 2, members: 8 */
/* paddings: 1, sum paddings: 4 */
/* last cacheline: 24 bytes */
};   /* saved 8 bytes! */
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15327 from routingrocks/pim_evpn_traffic_loss
Jafar Al-Gharaibeh [Fri, 9 Feb 2024 15:15:01 +0000 (09:15 -0600)]
Merge pull request #15327 from routingrocks/pim_evpn_traffic_loss

pimd: re-evaluated S,G OILs upon RP changes and empty SG upstream oils

14 months agoMerge pull request #15333 from c-po/issue-14910
Donatas Abraitis [Fri, 9 Feb 2024 10:34:58 +0000 (12:34 +0200)]
Merge pull request #15333 from c-po/issue-14910

ospfd: can not delete "segment-routing node-msd" when SR if off

14 months agoMerge pull request #15336 from c-po/issue-15335
Donatas Abraitis [Fri, 9 Feb 2024 10:33:59 +0000 (12:33 +0200)]
Merge pull request #15336 from c-po/issue-15335

ospfd: add support for "no router-info [<area|as>] command"

14 months agoospfd: add support for "no router-info [<area|as>] command" 15336/head
Christian Breunig [Thu, 8 Feb 2024 21:39:04 +0000 (22:39 +0100)]
ospfd: add support for "no router-info [<area|as>] command"

frr-reload.py will walk through all config contexts and prepend no to the CLI
command. This requires that the vtysh shell code accepts a full command.

To Reproduce

vtysh -c "conf t" -c "router ospf" -c "router-info area"
vtysh -c "conf t" -c "router ospf" -c "no router-info area"
% Unknown command: no router-info area
vtysh -c "conf t" -c "router ospf" -c "no router-info"

Signed-off-by: Christian Breunig <christian@breunig.cc>
14 months agoospfd: can not delete "segment-routing node-msd" when SR if off 15333/head
Christian Breunig [Thu, 8 Feb 2024 20:53:35 +0000 (21:53 +0100)]
ospfd: can not delete "segment-routing node-msd" when SR if off

This fixes the initial implementation of commit 7743f2f8c00 ("OSPFd: Update
Segment Routing PR following review") where it wsa not possible to remove
the "segment-routing node-msd" CLI nodes via vtysh once segment-routing got
disabled.

Closes #14910

Signed-off-by: Christian Breunig <christian@breunig.cc>
14 months agoMerge pull request #15285 from idryzhov/staticd-nexthop-refcounter
Donald Sharp [Thu, 8 Feb 2024 20:53:30 +0000 (15:53 -0500)]
Merge pull request #15285 from idryzhov/staticd-nexthop-refcounter

staticd: fix nexthop tracking memory leak and add a topotest for VRFs

14 months agopimd: re-evaluated S,G OILs upon RP changes and for empty SG upstream oils 15327/head
Rajesh Varatharaj [Thu, 8 Feb 2024 02:58:39 +0000 (18:58 -0800)]
pimd: re-evaluated S,G OILs upon RP changes and for empty SG upstream oils

Topology:

TOR11 (FHR) --- LEAF-11---SPINE1 (RP)MSDP SPINE-2(RP)MSDP --- LEAF-12 -- TOR12 (LHR)
        |         |                    | |       |
|         -----------------------------------------------------(ECMP)   |
|         |                                 |               |
 -----------------------------------------------------------------------(ECMP)
Issue:
In some triggers, S,G upstream is preserved even with the PP timer expiry, resulting
in S,G with NULL OILS. This could be because we create a dummy S,G upstream and
dummy channel_oif for *,G, where RPF is UNKNOWN. As a result, PIM+VXLAN traffic is never
forwarded downstream to LHR.

Fix:
when the S,G stream is running, Determine if a reevaluation of the outgoing interface
 list (OIL) is required. S,G upstream should then inherit the OIL from *,G.

Testing:
- Evpn pim tests - TestEvpnPimSingleVtepOneMdt.test_02_broadcast_traffic_spt_zero
- pim-smoke

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
14 months agoMerge pull request #15255 from louis-6wind/bgp-leak-interface
Donald Sharp [Thu, 8 Feb 2024 16:18:58 +0000 (11:18 -0500)]
Merge pull request #15255 from louis-6wind/bgp-leak-interface

bgpd: fix interface of routes leaked from another VRF

14 months agoMerge pull request #15326 from pguibert6WIND/bgp_flowspec_ipv6_flush
Donald Sharp [Thu, 8 Feb 2024 15:36:00 +0000 (10:36 -0500)]
Merge pull request #15326 from pguibert6WIND/bgp_flowspec_ipv6_flush

bgpd: fix flushing ipv6 flowspec entries when peering stops

14 months agoMerge pull request #15325 from opensourcerouting/fix/show_getsockopt
Donald Sharp [Thu, 8 Feb 2024 15:33:34 +0000 (10:33 -0500)]
Merge pull request #15325 from opensourcerouting/fix/show_getsockopt

bgpd: Do not show TCP MSS if the socket is broken

14 months agoMerge pull request #15316 from LabNConsulting/working/lb/nhrp-nexthop-race-cond
Donald Sharp [Thu, 8 Feb 2024 15:31:46 +0000 (10:31 -0500)]
Merge pull request #15316 from LabNConsulting/working/lb/nhrp-nexthop-race-cond

nhrp: fix race condition in  null lladdr from zebra

14 months agoMerge pull request #15324 from opensourcerouting/fix/doc_route_map_continue
Donald Sharp [Thu, 8 Feb 2024 13:19:56 +0000 (08:19 -0500)]
Merge pull request #15324 from opensourcerouting/fix/doc_route_map_continue

doc: Fix the documentation for route-map continue statement

14 months agonhrp: fix race condition 15316/head
Lou Berger [Tue, 6 Feb 2024 23:14:07 +0000 (23:14 +0000)]
nhrp: fix race condition

where null lladdr recieved from zebra before nhrp next hop
is installed.

Signed-off-by: Lou Berger <lberger@labn.net>
14 months agobgpd: fix flushing ipv6 flowspec entries when peering stops 15326/head
Philippe Guibert [Wed, 7 Feb 2024 21:34:34 +0000 (22:34 +0100)]
bgpd: fix flushing ipv6 flowspec entries when peering stops

When a BGP flowspec peering stops, the BGP RIB entries for IPv6
flowspec entries are removed, but not the ZEBRA RIB IPv6 entries.

Actually, when calling bgp_zebra_withdraw() function call, only
the AFI_IP parameter is passed to the bgp_pbr_update_entry() function
in charge of the Flowspec add/delete in zebra. Fix this by passing
the AFI parameter to the bgp_zebra_withdraw() function.

Note that using topotest does not show up the problem as the
flowspec driver code is not present and was refused. Without that,
routes are not installed, and can not be uninstalled.

Fixes: 529efa234655 ("bgpd: allow flowspec entries to be announced to zebra")
Link: https://github.com/FRRouting/frr/pull/2025
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
14 months agoMerge pull request #15286 from idryzhov/fix-mgmt-startup
Christian Hopps [Wed, 7 Feb 2024 21:04:11 +0000 (16:04 -0500)]
Merge pull request #15286 from idryzhov/fix-mgmt-startup

Fix conflict in mgmtd on startup

14 months agobgpd: Do not show TCP MSS if the socket is broken 15325/head
Donatas Abraitis [Wed, 7 Feb 2024 21:03:37 +0000 (23:03 +0200)]
bgpd: Do not show TCP MSS if the socket is broken

Just avoid calling for TCP MSS socket option if it's not in use.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agodoc: Fix the documentation for route-map continue statement 15324/head
Donatas Abraitis [Wed, 7 Feb 2024 20:56:17 +0000 (22:56 +0200)]
doc: Fix the documentation for route-map continue statement

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15317 from louis-6wind/fix-affinity-map-odr
Donatas Abraitis [Wed, 7 Feb 2024 20:42:36 +0000 (22:42 +0200)]
Merge pull request #15317 from louis-6wind/fix-affinity-map-odr

lib: fix affinity map duplicate

14 months agobgpd: Add `neighbor X send-community extended rpki` command 15284/head
Donatas Abraitis [Fri, 2 Feb 2024 08:47:46 +0000 (10:47 +0200)]
bgpd: Add `neighbor X send-community extended rpki` command

By default, iBGP and eBGP-OAD peers exchange RPKI extended community by default.

Add a command to disable sending RPKI extended community if needed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agotests: Test if RPKI extended community can be disabled between peers
Donatas Abraitis [Fri, 2 Feb 2024 08:47:20 +0000 (10:47 +0200)]
tests: Test if RPKI extended community can be disabled between peers

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agodoc: Add `neighbor X send-community extended rpki` command
Donatas Abraitis [Fri, 2 Feb 2024 08:45:55 +0000 (10:45 +0200)]
doc: Add `neighbor X send-community extended rpki` command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agovtysh: remove resync workaround when exiting to config node 15286/head
Igor Ryzhov [Fri, 2 Feb 2024 23:15:46 +0000 (01:15 +0200)]
vtysh: remove resync workaround when exiting to config node

When exiting from a level below the config node, like `router rip`,
vtysh executes a resync by sending "end" and "conf term [file-lock]"
commands to all the daemons. As statet in the description comment, it's
done "in case one of the daemons is somewhere else". I don't think this
actually ever happens, but even if it is, it is a bug in a daemon that
needs to be fixed. This resync was okay before the introduction of
mgmtd, but now it unlocks and locks back the datastores during the
configuration reading process, which can lead to a failure which is
explained in the previous commit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agomgmtd, vtysh: fix possible conflict when reading the config
Igor Ryzhov [Fri, 2 Feb 2024 22:42:58 +0000 (00:42 +0200)]
mgmtd, vtysh: fix possible conflict when reading the config

When FRR starts, after mgmtd is initialized, backend clients connect to
it and request their config. To supply the config, mgmtd creates a
configuration transaction. At the same time, `vtysh -b` tries to read
the startup config and configure mgmtd, which also creates a
configuration transaction. If these two actions happen at the exact same
time, there's a conflict between them, because only a single
configuration translaction is allowed. Because of that, vtysh fails and
the config is completely ignored.

When starting the config reading, vtysh locks candidate and running
datastores in mgmtd. This commit adds locking of running datastore when
initializing the backend client. It allows to retry locking on the vtysh
side and read the config only when the lock is aquired instead of
failing.

This change also prevents running datastore from being changed during
initialization of backend clients. This could lead to a desynchronized
state between mgmtd and backends.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agolib, ospfclient, tests, vtysh: Allow for a minimum fd poll size 15320/head
Donald Sharp [Wed, 7 Feb 2024 15:38:02 +0000 (10:38 -0500)]
lib, ospfclient, tests, vtysh: Allow for a minimum fd poll size

There exists cases where just honoring the FD_LIMIT size
as given to us by the operating system makes no sense.
Let's just make a switch to allow for this for things
like vtysh and ospfclient which will never have 1k files
open at any given time.

Fixes: #15315
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
14 months agolib: fix affinity map duplicate 15317/head
Louis Scalbert [Wed, 7 Feb 2024 12:16:26 +0000 (13:16 +0100)]
lib: fix affinity map duplicate

Fix duplicate definition of frr_affinity_map_cli_info in libfrr.so.0 and
libmgmt_be_nb.so.0

> =================================================================
> ==3860488==ERROR: AddressSanitizer: odr-violation (0x7f12c98c4d20):
>   [1] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
>   [2] size=296 'frr_affinity_map_cli_info' lib/affinitymap_cli.c:77:35
> These globals were registered at these points:
>   [1]:
>     #0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
>     #1 0x7f12c9585b7d in _sub_I_00099_1 (/lib/libfrr.so.0+0x185b7d)
>     #2 0x7f12ca437fe1 in call_init elf/dl-init.c:72
>
>   [2]:
>     #0 0x7f12c9a36f40 in __asan_register_globals ../../../../src/libsanitizer/asan/asan_globals.cpp:341
>     #1 0x7f12c93824ed in _sub_I_00099_1 (/lib/libmgmt_be_nb.so.0+0x6f4ed)
>     #2 0x7f12ca437fe1 in call_init elf/dl-init.c:72
>
> ==3860488==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
> SUMMARY: AddressSanitizer: odr-violation: global 'frr_affinity_map_cli_info' at lib/affinitymap_cli.c:77:35
> ==3860488==ABORTING

Fixes: dc6ff4c0de ("lib: convert affinity-map to mgmtd")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: Reduce wait intervals in test_bgp_snmp_bgp4v2mib 15234/head
David Schweizer [Wed, 7 Feb 2024 12:50:53 +0000 (13:50 +0100)]
tests: Reduce wait intervals in test_bgp_snmp_bgp4v2mib

Remove sleep time in test_bgp_snmp_bgp4v2mib before run_and_expect and
reduce wait intervals for faster test convergence.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
14 months agotopotests: fix snmptrap log OID parsing
David Schweizer [Wed, 24 Jan 2024 10:16:03 +0000 (11:16 +0100)]
topotests: fix snmptrap log OID parsing

Replace OID string parsing of snmptrap log files based on odd/even line
numbers with regex string search to prevent test failures in cases where
log entries don't match assumed order.

Signed-off-by: David Schweizer <dschweizer@opensourcerouting.org>
14 months agoMerge pull request #15314 from opensourcerouting/fix/remove_bgp_evpn_attr_get_df_pref
Donald Sharp [Wed, 7 Feb 2024 12:44:07 +0000 (07:44 -0500)]
Merge pull request #15314 from opensourcerouting/fix/remove_bgp_evpn_attr_get_df_pref

bgpd: A couple random EVPN findings

14 months agoMerge pull request #15305 from louis-6wind/label-dead-code
Donald Sharp [Tue, 6 Feb 2024 19:50:56 +0000 (14:50 -0500)]
Merge pull request #15305 from louis-6wind/label-dead-code

bgpd: remove dead label code in bgp_update

14 months agoMerge pull request #15283 from okda-networks/doc-update
Donald Sharp [Tue, 6 Feb 2024 16:42:02 +0000 (11:42 -0500)]
Merge pull request #15283 from okda-networks/doc-update

doc: sysrepo plugin doc update with test commands

14 months agoMerge pull request #15311 from louis-6wind/fix-show-srv6-sid
Donald Sharp [Tue, 6 Feb 2024 16:40:14 +0000 (11:40 -0500)]
Merge pull request #15311 from louis-6wind/fix-show-srv6-sid

bgpd: fix displaying srv6 sid

14 months agoMerge pull request #15301 from opensourcerouting/fix/fqdn_capability_dynamic
Donald Sharp [Tue, 6 Feb 2024 16:36:03 +0000 (11:36 -0500)]
Merge pull request #15301 from opensourcerouting/fix/fqdn_capability_dynamic

bgpd: Send FQDN capability via dynamic capability if enabled

14 months agoMerge pull request #15308 from donaldsharp/update_source_documentation
Mark Stapp [Tue, 6 Feb 2024 13:24:17 +0000 (08:24 -0500)]
Merge pull request #15308 from donaldsharp/update_source_documentation

doc: Document `update-source <IFNAME>` command better

14 months agobgpd: remove dead label code in bgp_update 15305/head
Louis Scalbert [Mon, 5 Feb 2024 14:43:45 +0000 (15:43 +0100)]
bgpd: remove dead label code in bgp_update

No need to init new_attr. It is not used until it is overridden.

> new_attr = *attr;

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agotests: add topotest for static routes in VRF 15285/head
Igor Ryzhov [Fri, 2 Feb 2024 17:37:38 +0000 (19:37 +0200)]
tests: add topotest for static routes in VRF

Test how staticd handles VRF creation/deletion.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
14 months agozebra: Use uint16_t for DF preference 15314/head
Donatas Abraitis [Tue, 6 Feb 2024 12:03:36 +0000 (14:03 +0200)]
zebra: Use uint16_t for DF preference

It's 16-bits everywhere, not sure why it was here as 32.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agobgpd: Drop unused function bgp_evpn_attr_get_df_pref()
Donatas Abraitis [Tue, 6 Feb 2024 12:02:51 +0000 (14:02 +0200)]
bgpd: Drop unused function bgp_evpn_attr_get_df_pref()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
14 months agoMerge pull request #15287 from donaldsharp/rcu_doc
Donatas Abraitis [Tue, 6 Feb 2024 10:57:32 +0000 (12:57 +0200)]
Merge pull request #15287 from donaldsharp/rcu_doc

doc: Add some documentation around a new pthread call

14 months agoMerge pull request #15309 from donaldsharp/reorg_route_entry
Donatas Abraitis [Tue, 6 Feb 2024 10:52:25 +0000 (12:52 +0200)]
Merge pull request #15309 from donaldsharp/reorg_route_entry

zebra: Reorg `struct route_entry` to have important bits first

14 months agobgpd: fix displaying srv6 sid 15311/head
Louis Scalbert [Mon, 5 Feb 2024 15:34:27 +0000 (16:34 +0100)]
bgpd: fix displaying srv6 sid

98efa5bc6b ("bgpd: bgp_path_info_extra memory optimization") has removed
SID info from the extra structure.

Do not test for extra presence.

Fixes: 98efa5bc6b ("bgpd: bgp_path_info_extra memory optimization")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
14 months agoMerge pull request #15294 from okda-networks/sysrepo_set_sess_err
Donald Sharp [Mon, 5 Feb 2024 19:59:45 +0000 (14:59 -0500)]
Merge pull request #15294 from okda-networks/sysrepo_set_sess_err

lib: set change errmsg in sysrepo session