]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
15 months agolib: validate affinity-map bit position using the yang model
Igor Ryzhov [Thu, 18 Jan 2024 23:40:21 +0000 (01:40 +0200)]
lib: validate affinity-map bit position using the yang model

When affinity mode is "standard", bit position cannot be greater than
31. Add a "must" statement to the YANG model to validate this, and
remove our custom validation code that does the same.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: make affinity-map value unique in the yang model
Igor Ryzhov [Thu, 18 Jan 2024 21:39:32 +0000 (23:39 +0200)]
lib: make affinity-map value unique in the yang model

It allows us to remove the code that does the same thing manually.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: validate affinity-map reference using yang model
Igor Ryzhov [Thu, 18 Jan 2024 21:27:56 +0000 (23:27 +0200)]
lib: validate affinity-map reference using yang model

Change the type of affinity leaf-list in frr-zebra to a leafref with
"require-instance" property set to true. This change tells libyang to
automatically check that affinity-map exists before usage and doesn't
allow it to be deleted if it's referenced. It allows us to remove all
the manual code that is doing the same thing.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15172 from donaldsharp/evpn_mh_bridge_fix
Jafar Al-Gharaibeh [Thu, 18 Jan 2024 21:25:48 +0000 (15:25 -0600)]
Merge pull request #15172 from donaldsharp/evpn_mh_bridge_fix

tests: Fix test_evpn_mh.py to correctly call bridge program

15 months agotests: Fix test_evpn_mh.py to correctly call bridge program 15172/head
Donald Sharp [Thu, 18 Jan 2024 14:58:50 +0000 (09:58 -0500)]
tests: Fix test_evpn_mh.py to correctly call bridge program

Getting this error:

2024-01-17 19:05:20,688 WARNING: torm11: Router(torm11): proc failed: rc 255 pid 2436134
args: /usr/bin/nsenter --mount=/proc/2435168/ns/mnt --net=/proc/2435168/ns/net --uts=/proc/2435168/ns/uts -F /bin/bash -c /sbin/bridge vlan add vid 1000 dev bridge
stdout: RTNETLINK answers: Operation not supported
stderr: *empty*

As I understand it the correct thing to do here is pass in:
bridge vlan add vid 1000 dev bridge self

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15166 from LabNConsulting/chopps/fix-munet
Donatas Abraitis [Thu, 18 Jan 2024 07:18:04 +0000 (09:18 +0200)]
Merge pull request #15166 from LabNConsulting/chopps/fix-munet

tests: fix munet accessing missing attribute

15 months agoMerge pull request #15162 from opensourcerouting/fix/aspath4_set_flag
Donald Sharp [Wed, 17 Jan 2024 13:19:34 +0000 (08:19 -0500)]
Merge pull request #15162 from opensourcerouting/fix/aspath4_set_flag

bgpd: Set capability received flag only after sanity checks

15 months agotests: fix munet accessing missing attribute 15166/head
Christian Hopps [Wed, 17 Jan 2024 09:18:21 +0000 (09:18 +0000)]
tests: fix munet accessing missing attribute

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agotests: Adopt tests for AS4 handling 15162/head
Donatas Abraitis [Tue, 16 Jan 2024 14:28:41 +0000 (16:28 +0200)]
tests: Adopt tests for AS4 handling

When received malformed AS4 capability, it should return -1 (notification send),
and the received flag SHOULD NOT be set.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Send notification if AS4 capability failed to parse (malformed)
Donatas Abraitis [Tue, 16 Jan 2024 13:29:32 +0000 (15:29 +0200)]
bgpd: Send notification if AS4 capability failed to parse (malformed)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Set role capability received flag only if parsed correctly
Donatas Abraitis [Tue, 16 Jan 2024 12:37:51 +0000 (14:37 +0200)]
bgpd: Set role capability received flag only if parsed correctly

If we receive a malformed packet, we might end-up with a bad state.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Set hostname capability received flag only if parsed correctly
Donatas Abraitis [Tue, 16 Jan 2024 12:37:16 +0000 (14:37 +0200)]
bgpd: Set hostname capability received flag only if parsed correctly

If we receive a malformed packet, we might end-up with a bad state.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Set ADD-PATH capability received flag only if parsed correctly
Donatas Abraitis [Tue, 16 Jan 2024 12:36:20 +0000 (14:36 +0200)]
bgpd: Set ADD-PATH capability received flag only if parsed correctly

If we receive a malformed packet, we might end-up with a bad state.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Set AS4 capability received flag only if parsed correctly
Donatas Abraitis [Tue, 16 Jan 2024 12:35:10 +0000 (14:35 +0200)]
bgpd: Set AS4 capability received flag only if parsed correctly

If we receive a malformed packet, we might end-up with a bad state.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15160 from vjardin/doc_typo
Donatas Abraitis [Tue, 16 Jan 2024 07:44:41 +0000 (09:44 +0200)]
Merge pull request #15160 from vjardin/doc_typo

doc: typo, fix end of line

15 months agoMerge pull request #15161 from LabNConsulting/chopps/munet-0-13-12
Donatas Abraitis [Tue, 16 Jan 2024 07:44:04 +0000 (09:44 +0200)]
Merge pull request #15161 from LabNConsulting/chopps/munet-0-13-12

import munet 0.13.12

15 months agotests: import munet 0.13.12 15161/head
Christian Hopps [Mon, 15 Jan 2024 22:43:06 +0000 (22:43 +0000)]
tests: import munet 0.13.12

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agotests: set environment variable munet 0.13.12 will use
Christian Hopps [Mon, 15 Jan 2024 22:25:41 +0000 (22:25 +0000)]
tests: set environment variable munet 0.13.12 will use

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agodoc: typo, fix end of line 15160/head
Vincent Jardin [Mon, 15 Jan 2024 21:51:09 +0000 (22:51 +0100)]
doc: typo, fix end of line

Signed-off-by: Vincent Jardin <vjardin@free.fr>
15 months agoMerge pull request #15154 from idryzhov/mgmt-get-data
Christian Hopps [Mon, 15 Jan 2024 12:03:34 +0000 (07:03 -0500)]
Merge pull request #15154 from idryzhov/mgmt-get-data

mgmtd get-data request expansion

15 months agoMerge pull request #15156 from LabNConsulting/chopps/yang-mtu-32
Donatas Abraitis [Mon, 15 Jan 2024 09:27:15 +0000 (11:27 +0200)]
Merge pull request #15156 from LabNConsulting/chopps/yang-mtu-32

yang: lib: interface MTUs can be larger than uint16

15 months agoMerge pull request #15034 from louis-6wind/topotest-rpki
Donatas Abraitis [Mon, 15 Jan 2024 09:26:43 +0000 (11:26 +0200)]
Merge pull request #15034 from louis-6wind/topotest-rpki

bgpd, topotests: add bgp_rpki_topo1 and RPKI fixes

15 months agotests: add tests for mgmt get-data exact node request 15154/head
Igor Ryzhov [Sat, 13 Jan 2024 22:54:08 +0000 (00:54 +0200)]
tests: add tests for mgmt get-data exact node request

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib, mgmtd: add ability to request the exact node in get-data request
Igor Ryzhov [Sat, 13 Jan 2024 22:53:21 +0000 (00:53 +0200)]
lib, mgmtd: add ability to request the exact node in get-data request

RESTCONF expects to receive the exact node as a result, not the whole
data tree.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix oper data leaf creation
Igor Ryzhov [Sat, 13 Jan 2024 22:41:54 +0000 (00:41 +0200)]
lib: fix oper data leaf creation

When creating an initial tree trunk for oper data walk, if the xpath
represents a leaf, the leaf is created with an incorrect empty value.
If it doesn't actually exist in daemon's oper data, its value is not
overwritten later and an empty value is returned in the result.

For example, when requesting
`/frr-interface:lib/interface[name='eth0']/description`, the result is:
```
{
  "frr-interface:lib": {
    "interface": [
      {
        "name": "eth0",
        "description": ""
      }
    ]
  }
}
```
instead of an empty JSON that it should be.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agotests: add tests for mgmt get-data with config
Igor Ryzhov [Sat, 13 Jan 2024 20:58:19 +0000 (22:58 +0200)]
tests: add tests for mgmt get-data with config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib, mgmtd: add ability to set content type in get-data request
Igor Ryzhov [Sat, 13 Jan 2024 20:51:45 +0000 (22:51 +0200)]
lib, mgmtd: add ability to set content type in get-data request

Like in RESTCONF GET request and NETCONF get-data request, make it
possible to request state-only, config-only, or all data.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15150 from LabNConsulting/chopps/config-file-integrated
Donatas Abraitis [Mon, 15 Jan 2024 06:43:44 +0000 (08:43 +0200)]
Merge pull request #15150 from LabNConsulting/chopps/config-file-integrated

doc: update config file doc for integrated requirement

15 months agolib, mgmtd: add separate get-data request for the frontend
Igor Ryzhov [Sat, 13 Jan 2024 20:34:17 +0000 (22:34 +0200)]
lib, mgmtd: add separate get-data request for the frontend

Currently it's the same as get-tree request for the backend, but it is
going to be expanded in the following commits.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agovtysh, mgmtd: send interface commands to mgmtd
Igor Ryzhov [Sat, 13 Jan 2024 20:26:15 +0000 (22:26 +0200)]
vtysh, mgmtd: send interface commands to mgmtd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: add option to specify netns as the vrf backend
Igor Ryzhov [Sun, 14 Jan 2024 14:55:46 +0000 (16:55 +0200)]
mgmtd: add option to specify netns as the vrf backend

mgmtd has to know if netns is used as the vrf backend to correctly
process interface names in northbound.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix yang_lyd_trim_xpath
Igor Ryzhov [Sat, 13 Jan 2024 20:09:18 +0000 (22:09 +0200)]
lib: fix yang_lyd_trim_xpath

We should traverse all top-level siblings, not only the first one.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15151 from idryzhov/mgmtd-vrf
Christian Hopps [Sun, 14 Jan 2024 17:04:46 +0000 (12:04 -0500)]
Merge pull request #15151 from idryzhov/mgmtd-vrf

mgmtd: remove full vrf initialization

15 months agoyang: lib: interface MTUs can be larger than uint16 15156/head
Christian Hopps [Sun, 14 Jan 2024 12:35:00 +0000 (12:35 +0000)]
yang: lib: interface MTUs can be larger than uint16

Technically changing a leaf from uint16 to uint32 is a NBC change; however,
increasing this to uint32 should not break anyone in reality.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15152 from LabNConsulting/chopps/doc-mgmtd-convert-update
Donald Sharp [Sun, 14 Jan 2024 01:46:36 +0000 (20:46 -0500)]
Merge pull request #15152 from LabNConsulting/chopps/doc-mgmtd-convert-update

doc: mgmtd: update mgmtd conversion doc to be current.

15 months agodoc: update config file doc for integrated requirement 15150/head
Christian Hopps [Fri, 12 Jan 2024 18:02:42 +0000 (18:02 +0000)]
doc: update config file doc for integrated requirement

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15149 from donaldsharp/pim_vxlan_issues_2
Donatas Abraitis [Sat, 13 Jan 2024 19:10:07 +0000 (21:10 +0200)]
Merge pull request #15149 from donaldsharp/pim_vxlan_issues_2

Some code realignment in pim

15 months agoMerge pull request #15135 from idryzhov/mgmt-unused
Donatas Abraitis [Sat, 13 Jan 2024 19:08:24 +0000 (21:08 +0200)]
Merge pull request #15135 from idryzhov/mgmt-unused

mgmtd: remove unused/redundant variables

15 months agoMerge pull request #15137 from spmzt/master
Donatas Abraitis [Sat, 13 Jan 2024 19:07:25 +0000 (21:07 +0200)]
Merge pull request #15137 from spmzt/master

build: make buildtest.sh BSD compatible

15 months agodoc: mgmtd: update mgmtd conversion doc to be current. 15152/head
Christian Hopps [Sat, 13 Jan 2024 14:26:55 +0000 (14:26 +0000)]
doc: mgmtd: update mgmtd conversion doc to be current.

Also change `be_client_xpaths` to `be_client_config_xpaths` referred in the doc
to make much clearer it's use (since there's a separate `be_client_oper_xpaths`.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agomgmtd: remove full vrf initialization 15151/head
Igor Ryzhov [Sat, 13 Jan 2024 13:51:59 +0000 (15:51 +0200)]
mgmtd: remove full vrf initialization

We don't really need full VRF infrastructure in mgmtd. We only need to
register vty commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15144 from LabNConsulting/chopps/cov-issue-2
Donatas Abraitis [Fri, 12 Jan 2024 21:38:23 +0000 (23:38 +0200)]
Merge pull request #15144 from LabNConsulting/chopps/cov-issue-2

lib: fix coverity issue

15 months agopimd: Use vrf name instead of id in some debugs 15149/head
Donald Sharp [Fri, 12 Jan 2024 20:01:46 +0000 (15:01 -0500)]
pimd: Use vrf name instead of id in some debugs

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopimd: Re-align pim_msg_get_jp_group_size
Donald Sharp [Fri, 12 Jan 2024 17:00:45 +0000 (12:00 -0500)]
pimd: Re-align pim_msg_get_jp_group_size

This function was/is heavily indented, let's refactor
this a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15138 from opensourcerouting/fix/drop_unused_var_bgp_damp
Donald Sharp [Fri, 12 Jan 2024 19:34:46 +0000 (14:34 -0500)]
Merge pull request #15138 from opensourcerouting/fix/drop_unused_var_bgp_damp

bgpd: Drop dampening `tmax` variable from struct

15 months agoMerge pull request #15121 from routingrocks/rajesh/bgp_peer_ttl
Donatas Abraitis [Fri, 12 Jan 2024 18:26:34 +0000 (20:26 +0200)]
Merge pull request #15121 from routingrocks/rajesh/bgp_peer_ttl

bgpd: Set correct TTL for the dynamic neighbor peers

15 months agoMerge pull request #15130 from donaldsharp/pim_vxlan_issues
Donatas Abraitis [Fri, 12 Jan 2024 18:26:10 +0000 (20:26 +0200)]
Merge pull request #15130 from donaldsharp/pim_vxlan_issues

Pim vxlan issues

15 months agolib: fix coverity issue 15144/head
Christian Hopps [Fri, 12 Jan 2024 16:37:30 +0000 (16:37 +0000)]
lib: fix coverity issue

** CID 1575595:  Null pointer dereferences  (REVERSE_INULL)

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15133 from LabNConsulting/chopps/coverity-fixes
Donatas Abraitis [Fri, 12 Jan 2024 14:06:26 +0000 (16:06 +0200)]
Merge pull request #15133 from LabNConsulting/chopps/coverity-fixes

lib: fix coverity issues

15 months agomgmtd: remove redundant next_phase variable 15135/head
Igor Ryzhov [Thu, 11 Jan 2024 21:41:29 +0000 (23:41 +0200)]
mgmtd: remove redundant next_phase variable

next_phase is always curr_phase + 1. It's not necessary to maintain it
separately. Also rename curr_phase to phase.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #14542 from idryzhov/nb-op-cb-split
Christian Hopps [Fri, 12 Jan 2024 11:07:57 +0000 (06:07 -0500)]
Merge pull request #14542 from idryzhov/nb-op-cb-split

Add more northbound operation types

15 months agobuild: make buildtest.sh BSD compatible 15137/head
Seyed Pouria Mousavizadeh Tehrani [Fri, 12 Jan 2024 10:38:10 +0000 (14:08 +0330)]
build: make buildtest.sh BSD compatible

Signed-off-by: Seyed Pouria Mousavizadeh Tehrani <p.mousavizadeh@protonmail.com>
15 months agoMerge pull request #15136 from idryzhov/ignore-cbs
Donatas Abraitis [Fri, 12 Jan 2024 09:56:59 +0000 (11:56 +0200)]
Merge pull request #15136 from idryzhov/ignore-cbs

lib, mgmtd: rename ignore_cbs to ignore_cfg_cbs

15 months agobgpd: Drop dampening `tmax` variable from struct 15138/head
Donatas Abraitis [Fri, 12 Jan 2024 09:29:43 +0000 (11:29 +0200)]
bgpd: Drop dampening `tmax` variable from struct

Not used anywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15127 from opensourcerouting/fix/doc_libyang_artifacts
Christian Hopps [Fri, 12 Jan 2024 08:32:37 +0000 (03:32 -0500)]
Merge pull request #15127 from opensourcerouting/fix/doc_libyang_artifacts

doc: libyang nits

15 months agoMerge pull request #15134 from idryzhov/fix-commit-clients
Christian Hopps [Fri, 12 Jan 2024 08:32:03 +0000 (03:32 -0500)]
Merge pull request #15134 from idryzhov/fix-commit-clients

mgmtd: don't try to send config to disconnected clients

15 months agoMerge pull request #15131 from LabNConsulting/chopps/oper-choice-case
Igor Ryzhov [Thu, 11 Jan 2024 22:20:45 +0000 (00:20 +0200)]
Merge pull request #15131 from LabNConsulting/chopps/oper-choice-case

Chopps/oper choice case

15 months agolib, mgmtd: rename ignore_cbs to ignore_cfg_cbs 15136/head
Igor Ryzhov [Thu, 11 Jan 2024 21:47:48 +0000 (23:47 +0200)]
lib, mgmtd: rename ignore_cbs to ignore_cfg_cbs

Setting this variable to true makes NB ignore only configuration-related
callbacks. CLI-related callbacks are still loaded and executed, so
rename the variable to make it clearer.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: remove unused pending_be_proc variable
Igor Ryzhov [Thu, 11 Jan 2024 21:08:01 +0000 (23:08 +0200)]
mgmtd: remove unused pending_be_proc variable

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: don't try to send config to disconnected clients 15134/head
Igor Ryzhov [Thu, 11 Jan 2024 18:58:09 +0000 (20:58 +0200)]
mgmtd: don't try to send config to disconnected clients

When determining the interested backend clients for a configuration
change, don't consider disconnected clients. This fixes a crash in
`mgmt_txn_send_be_txn_create` when trying to send data to a non-existing
adapter.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobgpd: Set correct TTL for the dynamic neighbor peers 15121/head
Rajesh Varatharaj [Fri, 29 Dec 2023 19:26:43 +0000 (11:26 -0800)]
bgpd: Set correct TTL for the dynamic neighbor peers

In an EBGP multihop configuration with dynamic neighbors, the TTL configured is not being updated for the socket.

Issue:
Assume the following topology:
Host (Dynamic peer to spine - 192.168.1.100) - Leaf - Spine (192.168.1.1)

When the host establishes a BGP multihop session to the spine,
the connection uses the MAXTTL value instead of the configured TTL (in this case, 2).
This issue is only observed with dynamic peers.

Logs: look at the TTL is still MAXTTL, instead of “2” configured.

18:13:18.872395 48:b0:2d:0c:58:0b > 48:b0:2d:66:64:6b, ethertype IPv4 (0x0800), length 85: (tos 0xc0, ttl 255, id 32078, offset 0, flags [DF], proto TCP (6), length 71)
192.168.1.100.179 > 192.168.1.1.40967: Flags [P.], cksum 0xfe89 (correct), seq 28406:28425, ack 28424, win 255, options [nop,nop,TS val 4192664793 ecr 2814447051], length 19: BGP
Keepalive Message (4), length: 19

Fix:
Whenever a dynamic peer is created, the socket TTL should be updated with the configured TTL, in this case 2.

19:13:24.894890 48:b0:2d:0c:58:0b > 48:b0:2d:66:64:6b, ethertype IPv4 (0x0800), length 85: (tos 0xc0, ttl 2, id 1131, offset 0, flags [DF], proto TCP (6), length 71)
    192.168.1.100.179 > 192.168.1.1.41937: Flags [P.], cksum 0x7a67 (correct), seq 2046150759:2046150778, ack 4286110599, win 255, options [nop,nop,TS val 4196270815 ecr 2818051226], length 19: BGP
        Keepalive Message (4), length: 19

Testing: UT

UT logs:
2023-12-29T19:13:21.892205+00:00 host bgpd[1591425]: [WWPV7-YSZB5] Dynamic Neighbor 192.168.1.1/32 matches group test listen range 192.168.1.0/30
2023-12-29T19:13:21.892654+00:00 host bgpd[1591425]: [GBPAR-M31QF] 192.168.1.1 Dynamic Neighbor added, group test count 1
2023-12-29T19:13:21.892993+00:00 host bgpd[1591425]: [GPE2H-K9QRE] bgp_set_socket_ttl:  set TxTTL on peer (rtrid 0.0.0.0) socket, err = 2, peer ttl 2

 Conflicts:
bgpd/bgp_network.c

Ticket: #
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
15 months agolib: fix coverity issues 15133/head
Christian Hopps [Thu, 11 Jan 2024 15:38:58 +0000 (15:38 +0000)]
lib: fix coverity issues

** CID 1575504:  Insecure data handling  (TAINTED_SCALAR) (maybe)
** CID 1575505:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
** CID 1575506:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
** CID 1575507:  Null pointer dereferences  (REVERSE_INULL)

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agopimd: Make some not very needed debugs more restrictive 15130/head
Donald Sharp [Wed, 10 Jan 2024 21:00:33 +0000 (16:00 -0500)]
pimd: Make some not very needed debugs more restrictive

When turning on debug pim trace, there are lots of messages
surrounding the timing of rpf lookup.  99% of the time
no-one cares about these anymore.  Let's make them
not seen unless we turn up debugs

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopimd: Receiving a Join or Prune should be under J_P debugs
Donald Sharp [Wed, 10 Jan 2024 20:58:45 +0000 (15:58 -0500)]
pimd: Receiving a Join or Prune should be under J_P debugs

The Join or Prune messages require you to turn on `trace`
but this is part of Join/Prune processing of the packet
let's use PIM_DEBUG_PIM_J_P instead of TRACE here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15128 from opensourcerouting/fix/bgp_oad_ECOMMUNITY_ORIGIN_VALIDA...
Donald Sharp [Thu, 11 Jan 2024 14:07:31 +0000 (09:07 -0500)]
Merge pull request #15128 from opensourcerouting/fix/bgp_oad_ECOMMUNITY_ORIGIN_VALIDATION_STATE

bgpd: Recent EBGP-OAD improvements

15 months agolib: change type of `inner` to `struct lyd_node *`, cleaner code 15131/head
Christian Hopps [Thu, 11 Jan 2024 13:26:32 +0000 (13:26 +0000)]
lib: change type of `inner` to `struct lyd_node *`, cleaner code

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agobgpd: fix debug rpki display in show run 15034/head
Philippe Guibert [Thu, 19 Sep 2019 07:14:25 +0000 (09:14 +0200)]
bgpd: fix debug rpki display in show run

Only include "debug rpki" in "show run" if it was requested from the
configure mode but not it was from the enabled mode.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib: implement missing YANG choice/case statements.
Christian Hopps [Thu, 11 Jan 2024 13:25:54 +0000 (13:25 +0000)]
lib: implement missing YANG choice/case statements.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agobgpd: add hooks for displaying module debug messages
Philippe Guibert [Thu, 19 Sep 2019 07:11:18 +0000 (09:11 +0200)]
bgpd: add hooks for displaying module debug messages

when a plugin is attached, some debugs may be attached to that plugin.
For that, add one hook that is interacting with vty: a boolean indicates
what the usage is for: either for impacting the 'show running-config',
or for impacting the 'show debugging' command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agodoc: add show rpki configuration
Louis Scalbert [Thu, 21 Dec 2023 16:31:09 +0000 (17:31 +0100)]
doc: add show rpki configuration

Add documentation about the new "show rpki configuration" command.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: do not show default rpki timers in show run
Philippe Guibert [Thu, 19 Sep 2019 07:14:53 +0000 (09:14 +0200)]
bgpd: do not show default rpki timers in show run

"show run" displays the default RPKI timers when at least one cache
server is configured.

Only display the RPKI timers that differs from the default values.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: remove double spaces with rpki running config & ssh
Philippe Guibert [Thu, 5 Sep 2019 10:01:54 +0000 (12:01 +0200)]
bgpd: remove double spaces with rpki running config & ssh

remove double spaces when doing show running-config.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix resetting rpki timer at no rpki
Louis Scalbert [Tue, 19 Dec 2023 16:33:14 +0000 (17:33 +0100)]
bgpd: fix resetting rpki timer at no rpki

RPKI configuration is not totally flushed when doing "no rpki". Timers
remains to default values.

> r2# sh run bgpd
> [...]
> rpki
>  rpki retry_interval 5
>  rpki cache 192.0.2.1 15432 preference 1
> exit
> [...]
> r2# conf t
> r2(config)# no rpki
> r2(config)# do sh run
> [...]
> rpki
>  rpki retry_interval 5
> exit

Reset the timers after doing "no rpki"

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix crash when re-adding a rpki server
Louis Scalbert [Tue, 19 Dec 2023 15:06:28 +0000 (16:06 +0100)]
bgpd: fix crash when re-adding a rpki server

Fix a crash when re-adding a rpki server:

> r2# sh run bgpd
> [...]
> rpki
>  rpki retry_interval 5
>  rpki cache 192.0.2.1 15432 preference 1
> exit
> [...]
> r2# conf t
> r2(config)# rpki
> r2(config-rpki)# no rpki cache 192.0.2.1 15432 preference 1
> r2(config-rpki)# do show rpki cache-connection
> Cannot find a connected group.
> r2(config-rpki)# rpki cache 192.0.2.1 15432 preference 1
> r2(config-rpki)# do show rpki cache-connection
> vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!

> #0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
> #1  0x00007f3fd2d16e57 in core_handler (signo=11, siginfo=0x7ffffd5931b0, context=0x7ffffd593080) at lib/sigevent.c:246
> #2  <signal handler called>
> #3  0x00007f3fd26926b4 in tommy_list_head (list=0x2e322e302e323931) at /home/lscalber/git/rtrlib/./third-party/tommyds/tommylist.h:125
> #4  0x00007f3fd2693812 in rtr_mgr_get_first_group (config=0x55fbf31d7f00) at /home/lscalber/git/rtrlib/rtrlib/rtr_mgr.c:409
> #5  0x00007f3fd2ebef59 in get_connected_group () at bgpd/bgp_rpki.c:718
> #6  0x00007f3fd2ec0b39 in show_rpki_cache_connection_magic (self=0x7f3fd2ec69c0 <show_rpki_cache_connection_cmd>, vty=0x55fbf31f9ef0, argc=3, argv=0x55fbf31f99d0, uj=0x0)
> #   at bgpd/bgp_rpki.c:1575
> #7  0x00007f3fd2ebd4da in show_rpki_cache_connection (self=0x7f3fd2ec69c0 <show_rpki_cache_connection_cmd>, vty=0x55fbf31f9ef0, argc=3, argv=0x55fbf31f99d0) at ./bgpd/bgp_rpki_clippy.c:648
> #8  0x00007f3fd2c8a142 in cmd_execute_command_real (vline=0x55fbf31f9990, vty=0x55fbf31f9ef0, cmd=0x0, up_level=0) at lib/command.c:978
> #9  0x00007f3fd2c8a25c in cmd_execute_command (vline=0x55fbf31e5260, vty=0x55fbf31f9ef0, cmd=0x0, vtysh=0) at lib/command.c:1028
> #10 0x00007f3fd2c8a7f1 in cmd_execute (vty=0x55fbf31f9ef0, cmd=0x55fbf3200680 "do show rpki cache-connection ", matched=0x0, vtysh=0) at lib/command.c:1203
> #11 0x00007f3fd2d36548 in vty_command (vty=0x55fbf31f9ef0, buf=0x55fbf3200680 "do show rpki cache-connection ") at lib/vty.c:594
> #12 0x00007f3fd2d382e1 in vty_execute (vty=0x55fbf31f9ef0) at lib/vty.c:1357
> #13 0x00007f3fd2d3a519 in vtysh_read (thread=0x7ffffd5963c0) at lib/vty.c:2365
> #14 0x00007f3fd2d2faf6 in event_call (thread=0x7ffffd5963c0) at lib/event.c:1974
> #15 0x00007f3fd2cc238e in frr_run (master=0x55fbf2a0cd60) at lib/libfrr.c:1214
> #16 0x000055fbf073de40 in main (argc=9, argv=0x7ffffd596618) at bgpd/bgp_main.c:510

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agotopotests: bgp_rpki_topo1, failure on error packet
Louis Scalbert [Tue, 26 Dec 2023 15:07:48 +0000 (16:07 +0100)]
topotests: bgp_rpki_topo1, failure on error packet

RPKI FRR module should not send any RPKI error packet during the tests.

Exit rtrd when receiving error packet. Skip tests with errors if rtrd
has stopped.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agotopotests: log bgp_rpki_topo1 pyrtr output
Louis Scalbert [Tue, 26 Dec 2023 13:33:58 +0000 (14:33 +0100)]
topotests: log bgp_rpki_topo1 pyrtr output

Log bgp_rpki_topo1 pyrtr output

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agotopotests: add bgp_rpki_topo1
Louis Scalbert [Fri, 15 Dec 2023 15:31:44 +0000 (16:31 +0100)]
topotests: add bgp_rpki_topo1

Add bgp_rpki_topo1 topotest to validate the RPKI feature. Use a RTR RPKI
server from the above link with a black cleaning.

Link: https://raw.githubusercontent.com/tmshlvck/pyrtr/90df586375396aae08b07069187308b5b7b8823b/pyrtr/__init__.py
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix rpki compilation without rtrlib ssh
Louis Scalbert [Thu, 21 Dec 2023 10:41:53 +0000 (11:41 +0100)]
bgpd: fix rpki compilation without rtrlib ssh

Fix RPKI module compilation when rtrlib is compiled without SSH support,
ie. with cmake option:

> -D RTRLIB_TRANSPORT_SSH=No

> bgpd/bgp_rpki.c: In function ‘config_write’:
> bgpd/bgp_rpki.c:1062:3: error: enumeration value ‘SSH’ not handled in switch [-Werror=switch-enum]
>  1062 |   switch (cache->type) {
>       |   ^~~~~~
> bgpd/bgp_rpki.c: In function ‘show_rpki_cache_connection_magic’:
> bgpd/bgp_rpki.c:1598:3: error: enumeration value ‘SSH’ not handled in switch [-Werror=switch-enum]
>  1598 |   switch (cache->type) {
>       |   ^~~~~~
> cc1: all warnings being treated as errors

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: add json error message to rpki
Louis Scalbert [Tue, 26 Dec 2023 17:30:15 +0000 (18:30 +0100)]
bgpd: add json error message to rpki

Add error messages to rpki JSON output instead of an empty JSON.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agobgpd: fix show rpki json void output
Louis Scalbert [Fri, 15 Dec 2023 16:26:41 +0000 (17:26 +0100)]
bgpd: fix show rpki json void output

"show rpki XX json" should not return a void output because json.loads()
considers it to be an incorrect JSON.

> >>> json.loads("")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
>     return _default_decoder.decode(s)
>   File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
>     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
>   File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
>     raise JSONDecodeError("Expecting value", s, err.value) from None
> json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
> >>> json.loads("{}")
> {}

Return "{}" instead in such a case.

Link: https://github.com/FRRouting/frr/pull/15034
Fixes: dff41cc8a9 ("bgpd: Add JSON output for `show rpki prefix` and other show commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agolib: explain semantics of northbound operations 14542/head
Igor Ryzhov [Mon, 13 Nov 2023 22:39:59 +0000 (23:39 +0100)]
lib: explain semantics of northbound operations

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmt, lib: implement REPLACE operation
Igor Ryzhov [Mon, 9 Oct 2023 00:21:16 +0000 (03:21 +0300)]
mgmt, lib: implement REPLACE operation

Replace operation removes the current data node configuration and sets
the provided value. As current northbound code works only with one
xpath at a time, the operation only makes sense to clear the config of
a container without deleting it itself. However, the next step is to
allow passing JSON-encoded complex values to northbound operations which
will make replace operation much more useful.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: move dnode creation into a separate function
Igor Ryzhov [Mon, 9 Oct 2023 00:10:18 +0000 (03:10 +0300)]
lib: move dnode creation into a separate function

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmt, lib: differentiate DELETE and REMOVE operations
Igor Ryzhov [Fri, 6 Oct 2023 12:01:16 +0000 (15:01 +0300)]
mgmt, lib: differentiate DELETE and REMOVE operations

Currently, there's a single operation type which doesn't return error
if the object doesn't exists. To be compatible with NETCONF/RESTCONF,
we should support differentiate between DELETE (fails when object
doesn't exist) and REMOVE (doesn't fail if the object doesn't exist).

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd, lib: implement CREATE_EXCL operation
Igor Ryzhov [Thu, 5 Oct 2023 23:58:58 +0000 (02:58 +0300)]
mgmtd, lib: implement CREATE_EXCL operation

Currently, there's no difference between CREATE and MODIFY operations.
To be compatible with NETCONF/RESTCONF, add new CREATE_EXCL operation
that throws an error if the configuration data already exists.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: split nb_operation into two types
Igor Ryzhov [Thu, 5 Oct 2023 21:13:16 +0000 (00:13 +0300)]
lib: split nb_operation into two types

Currently, nb_operation enum means two different things - edit operation
type (frontend part), and callback type (backend part). These types
overlap, but they are not identical. We need to add more operation
types to support NETCONF/RESTCONF integration, so it's better to have
separate enums to identify different entities.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2
Donatas Abraitis [Thu, 11 Jan 2024 12:50:21 +0000 (14:50 +0200)]
Merge pull request #15098 from donaldsharp/lib_zebra_h_cleanup_2

Lib zebra h cleanup 2

15 months agobgpd: Allow sending Origin Validation State extended community over EBGP-OAD 15128/head
Donatas Abraitis [Thu, 11 Jan 2024 09:18:14 +0000 (11:18 +0200)]
bgpd: Allow sending Origin Validation State extended community over EBGP-OAD

https://datatracker.ietf.org/doc/html/draft-uttaro-idr-bgp-oad#section-3.13

Extended communities which are non-transitive across an AS boundary MAY be
advertised over an EBGP-OAD session if allowed by explicit policy configuration.

If allowed, all the members of the OAD SHOULD be configured to use the same
criteria.

For example, the Origin Validation State Extended Community, defined as
non-transitive in [RFC8097], can be advertised to peers in the same OAD.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agotests: Check if the route over eBGP is preferred when eBGP-OAD is used
Donatas Abraitis [Thu, 11 Jan 2024 08:34:05 +0000 (10:34 +0200)]
tests: Check if the route over eBGP is preferred when eBGP-OAD is used

If at least one of the candidate routes was received via EBGP, remove from
consideration all routes that were received via EBGP-OAD and IBGP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Show external session sub-type (OAD) if exists
Donatas Abraitis [Thu, 11 Jan 2024 08:47:33 +0000 (10:47 +0200)]
bgpd: Show external session sub-type (OAD) if exists

```
r1# sh ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 1
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  192.168.1.2 192.168.1.4
  65002 65003
    192.168.1.2 from 192.168.1.2 (192.168.2.2)
      Origin incomplete, metric 123, localpref 123, valid, external (oad)
      Last update: Thu Jan 11 10:46:32 2024
  65004 65005
    192.168.1.4 from 192.168.1.4 (192.168.4.4)
      Origin incomplete, metric 123, localpref 123, valid, external, best (Peer Type)
      Last update: Thu Jan 11 10:46:30 2024
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Prefer routes over eBGP versus eBGP-OAD
Donatas Abraitis [Thu, 11 Jan 2024 08:36:41 +0000 (10:36 +0200)]
bgpd: Prefer routes over eBGP versus eBGP-OAD

If at least one of the candidate routes was received via EBGP, remove from
consideration all routes that were received via EBGP-OAD and IBGP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agodoc: Fix documentation warning on the required version of libyang 15127/head
Donatas Abraitis [Thu, 11 Jan 2024 07:23:41 +0000 (09:23 +0200)]
doc: Fix documentation warning on the required version of libyang

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agodoc: Change the link to libyang for 2.1.x
Donatas Abraitis [Thu, 11 Jan 2024 07:22:54 +0000 (09:22 +0200)]
doc: Change the link to libyang for 2.1.x

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15124 from fdumontet6WIND/large_fds
Donald Sharp [Thu, 11 Jan 2024 01:24:26 +0000 (20:24 -0500)]
Merge pull request #15124 from fdumontet6WIND/large_fds

lib snmp: use snmp's large fd sets for agentx

15 months agopimd: Send up to 10 NULL registers on vxlan startup
Donald Sharp [Wed, 10 Jan 2024 20:36:47 +0000 (15:36 -0500)]
pimd: Send up to 10 NULL registers on vxlan startup

When doing pim vxlan multicast bum handling, setup
the register to send up to 10 null registers on
immediate startup.  If the null register packet
gets dropped this delays the formation of the
S,G tree from the RP towards the FHR.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: use snmp's large fd sets for agentx 15124/head
Edwin Brossette [Fri, 8 Dec 2023 15:02:11 +0000 (16:02 +0100)]
lib: use snmp's large fd sets for agentx

The maximum number of file descriptors in an fd set is limited by
FD_SETSIZE. This limitation is important because the libc macros
FD_SET(), FD_CLR() and FD_ISSET() will invoke a sigabort if the size of
the fd set given to them is above FD_SETSIZE.

We ran into such a sigabort with bgpd because snmp can return an fd set
of size higher than FD_SETSIZE when calling snmp_select_info(). An
unfortunate FD_ISSET() call later causes the following abort:

Received signal 6 at 1701115534 (si_addr 0xb94, PC 0x7ff289a16a7c); aborting...
/lib/x86_64-linux-gnu/libfrr.so.0(zlog_backtrace_sigsafe+0xb3) [0x7ff289d62bba]
/lib/x86_64-linux-gnu/libfrr.so.0(zlog_signal+0x1b4) [0x7ff289d62a1f]
/lib/x86_64-linux-gnu/libfrr.so.0(+0x102860) [0x7ff289da4860]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7ff2899c2520]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c) [0x7ff289a16a7c]
/lib/x86_64-linux-gnu/libc.so.6(raise+0x16) [0x7ff2899c2476]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd3) [0x7ff2899a87f3]
/lib/x86_64-linux-gnu/libc.so.6(+0x896f6) [0x7ff289a096f6]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x2a) [0x7ff289ab676a]
/lib/x86_64-linux-gnu/libc.so.6(+0x1350c6) [0x7ff289ab50c6]
/lib/x86_64-linux-gnu/libc.so.6(+0x1366ab) [0x7ff289ab66ab]
/lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x36f5) [0x7ff2897736f5]
/lib/x86_64-linux-gnu/libfrrsnmp.so.0(+0x3c27) [0x7ff289773c27]
/lib/x86_64-linux-gnu/libfrr.so.0(thread_call+0x1c2) [0x7ff289dbe105]
/lib/x86_64-linux-gnu/libfrr.so.0(frr_run+0x257) [0x7ff289d56e69]
/usr/bin/bgpd(main+0x4f4) [0x560965c40488]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ff2899a9d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ff2899a9e40]
/usr/bin/bgpd(_start+0x25) [0x560965c3e965]
in thread agentx_timeout scheduled from /build/make-pkg/output/_packages/cp-routing/src/lib/agentx.c:122 agentx_events_update()

Also, the following error is logged by snmp just before the abort:
snmp[err]: Use snmp_sess_select_info2() for processing large file descriptors

snmp uses a custom struct netsnmp_large_fd_set to work above the limit
imposed by FD_SETSIZE. It is noteworthy that, when calling
snmp_select_info() instead of snmp_select_info2(), snmp uses the same
code working with its custom, large structs, and copy/paste the result
to a regular, libc compatible fd_set. So there should be no downside
working with snmp_select_info2() instead of snmp_select_info().

Replace every use of the libc file descriptors sets by snmp's extended
file descriptors sets in agentx to acommodate for the high number of
file descriptors that can come out of snmp. This should prevent the
abort seen above.

Signed-off-by: Edwin Brossette <edwin.brossette@6wind.com>
15 months agoMerge pull request #15100 from donaldsharp/SA_problems_local
Donatas Abraitis [Wed, 10 Jan 2024 10:17:19 +0000 (12:17 +0200)]
Merge pull request #15100 from donaldsharp/SA_problems_local

Sa problems local

15 months agoMerge pull request #15123 from LabNConsulting/chopps/fix-oper-state-memleak
Donatas Abraitis [Wed, 10 Jan 2024 10:16:37 +0000 (12:16 +0200)]
Merge pull request #15123 from LabNConsulting/chopps/fix-oper-state-memleak

lib: fix oper-state memleak

15 months agolib: fix oper-state memleak 15123/head
Christian Hopps [Tue, 9 Jan 2024 21:52:41 +0000 (21:52 +0000)]
lib: fix oper-state memleak

Fix memleak when a key-ed query was done for which the key didn't exist.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agozebra: SA incorrectly believes a NULL pointer 15100/head
Donald Sharp [Fri, 5 Jan 2024 18:24:59 +0000 (13:24 -0500)]
zebra: SA incorrectly believes a NULL pointer

SA has decided that old_re could be a NULL pointer
even though the zebra_redistribute_check function
checks for NULL and returns false that would
not allow a NULL pointer deref.

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