]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
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 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 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 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 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>
15 months agobgpd: data is set but never used
Donald Sharp [Fri, 5 Jan 2024 18:02:16 +0000 (13:02 -0500)]
bgpd: data is set but never used

I've kept the assignment in a comment because I am concerned
about new code being added later that the data pointer would
not be set correctly.  Next coder can see the commented
out line and uncomment it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoospf6d: Value set is never used
Donald Sharp [Fri, 5 Jan 2024 17:59:53 +0000 (12:59 -0500)]
ospf6d: Value set is never used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agopimd: Cleanup SA issue with value never used
Donald Sharp [Fri, 5 Jan 2024 17:57:06 +0000 (12:57 -0500)]
pimd: Cleanup SA issue with value never used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agobgpd: Clean up issues found in SA with clang 14
Donald Sharp [Fri, 5 Jan 2024 17:53:34 +0000 (12:53 -0500)]
bgpd: Clean up issues found in SA with clang 14

3 different issues:

a) length never used
b) safi never used
c) length never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: limits.h is not needed by zebra.h 15098/head
Donald Sharp [Fri, 5 Jan 2024 15:01:11 +0000 (10:01 -0500)]
lib: limits.h is not needed by zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agozebra: Nothing is using errno.h
Donald Sharp [Fri, 5 Jan 2024 14:59:40 +0000 (09:59 -0500)]
zebra: Nothing is using errno.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: string.h was only used by vector.c make it better
Donald Sharp [Fri, 5 Jan 2024 14:50:16 +0000 (09:50 -0500)]
lib: string.h was only used by vector.c make it better

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: stdbool.h is not being used by zebra.h
Donald Sharp [Fri, 5 Jan 2024 14:45:44 +0000 (09:45 -0500)]
lib: stdbool.h is not being used by zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: zebra.h is not using signal.h
Donald Sharp [Fri, 5 Jan 2024 14:36:09 +0000 (09:36 -0500)]
lib: zebra.h is not using signal.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: zebra.h uses pwd.h when it should not
Donald Sharp [Thu, 4 Jan 2024 21:25:09 +0000 (16:25 -0500)]
lib: zebra.h uses pwd.h when it should not

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months ago*: zebra.h should not have fcntl.h
Donald Sharp [Thu, 4 Jan 2024 21:22:05 +0000 (16:22 -0500)]
*: zebra.h should not have fcntl.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: zebra.h was including compiler.h two times
Donald Sharp [Thu, 4 Jan 2024 21:13:02 +0000 (16:13 -0500)]
lib: zebra.h was including compiler.h two times

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: remove net/route.h it is not used
Donald Sharp [Thu, 4 Jan 2024 21:09:47 +0000 (16:09 -0500)]
lib: remove net/route.h it is not used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months ago*: remove sys/stat.h from zebra.h
Donald Sharp [Thu, 4 Jan 2024 21:03:55 +0000 (16:03 -0500)]
*: remove sys/stat.h from zebra.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agolib: select.h is not being used by anyone
Donald Sharp [Thu, 4 Jan 2024 20:56:25 +0000 (15:56 -0500)]
lib: select.h is not being used by anyone

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15103 from LabNConsulting/chopps/oper-filter
Donald Sharp [Tue, 9 Jan 2024 17:31:36 +0000 (12:31 -0500)]
Merge pull request #15103 from LabNConsulting/chopps/oper-filter

Implement full XPath 1.0 functionality

15 months agoMerge pull request #15122 from opensourcerouting/fix/drop_packet_send_debugs
Donald Sharp [Tue, 9 Jan 2024 17:21:09 +0000 (12:21 -0500)]
Merge pull request #15122 from opensourcerouting/fix/drop_packet_send_debugs

bgpd: Change printing format show debugging for debug bgp updates

15 months agoMerge pull request #15108 from opensourcerouting/fix/debug_bgp_updates_detail
Russ White [Tue, 9 Jan 2024 15:18:50 +0000 (10:18 -0500)]
Merge pull request #15108 from opensourcerouting/fix/debug_bgp_updates_detail

bgpd: Add `debug bgp updates detail` command

15 months agoMerge pull request #15001 from pguibert6WIND/zebra_nexthop_rework
Russ White [Tue, 9 Jan 2024 15:11:35 +0000 (10:11 -0500)]
Merge pull request #15001 from pguibert6WIND/zebra_nexthop_rework

Zebra nexthop rework

15 months agoMerge pull request #15120 from opensourcerouting/fix/memory_leak_for_default_originate
Donald Sharp [Tue, 9 Jan 2024 15:03:29 +0000 (10:03 -0500)]
Merge pull request #15120 from opensourcerouting/fix/memory_leak_for_default_originate

bgpd: Fix memory leak for default-originate with route-map

15 months agobgpd: Change printing format `show debugging` for `debug bgp updates` 15122/head
Donatas Abraitis [Tue, 9 Jan 2024 08:06:36 +0000 (10:06 +0200)]
bgpd: Change printing format `show debugging` for `debug bgp updates`

Before:

```
BGP debugging status:
  BGP updates debugging is on (inbound) for 127.0.0.1 with prefix-list rn-dummy 192.168.10.18 with prefix-list rn-dummy 1.1.1.1
```

After:

```
BGP debugging status:
  BGP updates debugging is on (inbound) for:
   127.0.0.1 with prefix-list rn-dummy
   192.168.10.18 with prefix-list rn-dummy
   192.168.10.20
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agobgpd: Drop BGP_DEBUG_PACKET_SEND_DETAIL/BGP_DEBUG_PACKET_SEND consts
Donatas Abraitis [Tue, 9 Jan 2024 07:58:00 +0000 (09:58 +0200)]
bgpd: Drop BGP_DEBUG_PACKET_SEND_DETAIL/BGP_DEBUG_PACKET_SEND consts

Not used anywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15106 from opensourcerouting/fix/rename_thread_cli
Donald Sharp [Mon, 8 Jan 2024 18:51:36 +0000 (13:51 -0500)]
Merge pull request #15106 from opensourcerouting/fix/rename_thread_cli

vtysh: Add `show event ...` commands

15 months agobgpd: Fix memory leak for default-originate with route-map 15120/head
Donatas Abraitis [Mon, 8 Jan 2024 17:21:56 +0000 (19:21 +0200)]
bgpd: Fix memory leak for default-originate with route-map

```
Direct leak of 40 byte(s) in 1 object(s) allocated from:
    0 0x7fc4b81eed28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    1 0x7fc4b7bd60bb in qcalloc lib/memory.c:105
    2 0x56221dc19207 in aspath_dup bgpd/bgp_aspath.c:689
    3 0x56221daacd42 in route_set_aspath_prepend bgpd/bgp_routemap.c:2283
    4 0x7fc4b7c3891a in route_map_apply_ext lib/routemap.c:2687
    5 0x56221dace552 in subgroup_default_originate bgpd/bgp_updgrp_adv.c:906
    6 0x56221dabf79c in update_group_default_originate_route_map_walkcb bgpd/bgp_updgrp.c:2105
    7 0x56221dabde4e in update_group_walkcb bgpd/bgp_updgrp.c:1721
    8 0x7fc4b7b9d398 in hash_walk lib/hash.c:270
    9 0x56221dac94cb in update_group_af_walk bgpd/bgp_updgrp.c:2062
    10 0x56221dac9b0f in update_group_walk bgpd/bgp_updgrp.c:2071
    11 0x56221dac9fd5 in update_group_refresh_default_originate_route_map bgpd/bgp_updgrp.c:2118
    12 0x7fc4b7c7fc54 in event_call lib/event.c:1974
    13 0x7fc4b7bb9276 in frr_run lib/libfrr.c:1214
    14 0x56221d9217fd in main bgpd/bgp_main.c:510
    15 0x7fc4b6bf2c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
```

tmp_pi.attr should be flushed since it's already interned (new_attr) or the
origin value is used (attr).

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15119 from donaldsharp/pytest_mgmtd
Donatas Abraitis [Mon, 8 Jan 2024 18:48:30 +0000 (20:48 +0200)]
Merge pull request #15119 from donaldsharp/pytest_mgmtd

tests: Add mgmtd to the official pytest.mark list

15 months agoMerge pull request #15111 from donaldsharp/json_vpn_wait_what
Donatas Abraitis [Mon, 8 Jan 2024 13:57:25 +0000 (15:57 +0200)]
Merge pull request #15111 from donaldsharp/json_vpn_wait_what

bgpd: show_adj_route_vpn always leaked json memory

15 months agotests: Add mgmtd to the official pytest.mark list 15119/head
Donald Sharp [Mon, 8 Jan 2024 12:58:14 +0000 (07:58 -0500)]
tests: Add mgmtd to the official pytest.mark list

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15110 from donaldsharp/revert_zrouter.stale_client
Christian Hopps [Mon, 8 Jan 2024 12:35:20 +0000 (07:35 -0500)]
Merge pull request #15110 from donaldsharp/revert_zrouter.stale_client

Revert "zebra: Cleanup zrouter.stale_client_list on shutdown"

15 months agobgpd: show_adj_route_vpn always leaked json memory 15111/head
Donald Sharp [Sun, 7 Jan 2024 20:55:15 +0000 (15:55 -0500)]
bgpd: show_adj_route_vpn always leaked json memory

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
15 months agoMerge pull request #15101 from LabNConsulting/chopps/new-libyang-req
Donald Sharp [Sun, 7 Jan 2024 20:03:13 +0000 (15:03 -0500)]
Merge pull request #15101 from LabNConsulting/chopps/new-libyang-req

build: require libyang 2.1.128

15 months agoRevert "zebra: Cleanup zrouter.stale_client_list on shutdown" 15110/head
Donald Sharp [Sun, 7 Jan 2024 18:14:54 +0000 (13:14 -0500)]
Revert "zebra: Cleanup zrouter.stale_client_list on shutdown"

This reverts commit 71f7ecb571cd8a87c97ae952db1f1fafa7ef627a.

15 months agoMerge pull request #15102 from opensourcerouting/Revert-memleak-PR14811
Donald Sharp [Sun, 7 Jan 2024 17:30:22 +0000 (12:30 -0500)]
Merge pull request #15102 from opensourcerouting/Revert-memleak-PR14811

Revert "bgpd: On shutdown do not create a workqueue for the self peer"

15 months agotests: test new XPath 1.0 predicate functionality 15103/head
Christian Hopps [Sat, 6 Jan 2024 09:47:04 +0000 (09:47 +0000)]
tests: test new XPath 1.0 predicate functionality

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agolib: use libyang functions if they are present
Christian Hopps [Sat, 6 Jan 2024 11:06:38 +0000 (11:06 +0000)]
lib: use libyang functions if they are present

Add configure.ac tests for libyang functions, if not present supply the
functionality ourselves in yang.[ch]

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agolib: mgmtd: implement full XPath 1.0 predicate functionality
Christian Hopps [Sat, 6 Jan 2024 09:45:29 +0000 (09:45 +0000)]
lib: mgmtd: implement full XPath 1.0 predicate functionality

Allow user to specify full YANG compatible XPath 1.0 predicates. This
allows for trimming results of generic queries using functions and other
non-key predicates from XPath 1.0

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agolib: fix clang SA warnings
Christian Hopps [Sun, 7 Jan 2024 09:41:32 +0000 (09:41 +0000)]
lib: fix clang SA warnings

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agobgpd: Add `debug bgp updates detail` command 15108/head
Donatas Abraitis [Sun, 7 Jan 2024 13:43:30 +0000 (15:43 +0200)]
bgpd: Add `debug bgp updates detail` command

When filtering with `debug bgp updates in x.x.x.x prefix-list plist`, we want
to filter out unnecessary messages like:

```
127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5
```

Such a line as above will be repeated for all the paths received and it's useless
without knowing the prefix (because NLRIs are not parsed yet).

But want to see only relevant ones:

```
127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002
127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast
```

With `debug bgp updates detail` we can combine this to something like:

```
127.0.0.1(Unknown) rcvd UPDATE w/ attr: nexthop 127.0.0.1, origin i, path 65002
127.0.0.1(Unknown) rcvd UPDATE wlen 0 attrlen 20 alen 5
127.0.0.1(Unknown) rcvd 10.255.255.1/32 IPv4 unicast
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15104 from donaldsharp/label_pool_manager
Donatas Abraitis [Sun, 7 Jan 2024 13:11:38 +0000 (15:11 +0200)]
Merge pull request #15104 from donaldsharp/label_pool_manager

bgpd: bgp_sync_label_manager failure case

15 months agodoc: Rename `Thread` to `Event` in events example 15106/head
Donatas Abraitis [Sun, 7 Jan 2024 12:33:10 +0000 (14:33 +0200)]
doc: Rename `Thread` to `Event` in events example

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agovtysh: Rename `show thread ...` to `show event ...`
Donatas Abraitis [Sun, 7 Jan 2024 11:46:04 +0000 (13:46 +0200)]
vtysh: Rename `show thread ...` to `show event ...`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agotests: Rename `show thread ...` to `show event ...`
Donatas Abraitis [Sun, 7 Jan 2024 11:30:48 +0000 (13:30 +0200)]
tests: Rename `show thread ...` to `show event ...`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agotools: Rename `show thread ...` to `show event ...`
Donatas Abraitis [Sun, 7 Jan 2024 11:29:57 +0000 (13:29 +0200)]
tools: Rename `show thread ...` to `show event ...`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agodoc: Rename `show thread ...` to `show event ...`
Donatas Abraitis [Sun, 7 Jan 2024 11:29:08 +0000 (13:29 +0200)]
doc: Rename `show thread ...` to `show event ...`

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
15 months agoMerge pull request #15105 from donaldsharp/event_thread_mishap
Donatas Abraitis [Sun, 7 Jan 2024 11:27:02 +0000 (13:27 +0200)]
Merge pull request #15105 from donaldsharp/event_thread_mishap

lib: Use event name instead of thread

15 months agolib: Use event name instead of thread 15105/head
Donald Sharp [Sun, 7 Jan 2024 01:41:20 +0000 (20:41 -0500)]
lib: Use event name instead of thread

The thread system has been renamed, let's use the proper
terminology now in the show commands.  Also realign
output a tiny bit for stuff that was missing.

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