Commit Graph

35139 Commits

Author SHA1 Message Date
Christian Hopps
48ed48b5f9
tests: import munet 0.13.12
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-15 22:43:06 +00:00
Christian Hopps
37f26046f4
tests: set environment variable munet 0.13.12 will use
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-15 22:25:41 +00:00
Vincent Jardin
4654995915 doc: typo, fix end of line
Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-01-15 22:51:09 +01:00
Christian Hopps
f2bb687426
Merge pull request #15154 from idryzhov/mgmt-get-data
mgmtd get-data request expansion
2024-01-15 07:03:34 -05:00
Donatas Abraitis
bd9174f424
Merge pull request #15156 from LabNConsulting/chopps/yang-mtu-32
yang: lib: interface MTUs can be larger than uint16
2024-01-15 11:27:15 +02:00
Donatas Abraitis
563c2cd95c
Merge pull request #15034 from louis-6wind/topotest-rpki
bgpd, topotests: add bgp_rpki_topo1 and RPKI fixes
2024-01-15 11:26:43 +02:00
Igor Ryzhov
2764344bcb tests: add tests for mgmt get-data exact node request
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15 10:27:33 +02:00
Igor Ryzhov
9859f308d2 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>
2024-01-15 10:27:33 +02:00
Igor Ryzhov
10eac0a54d 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>
2024-01-15 10:27:33 +02:00
Igor Ryzhov
05c6081099 tests: add tests for mgmt get-data with config
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15 10:27:33 +02:00
Igor Ryzhov
e1cdb38ee6 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>
2024-01-15 10:27:33 +02:00
Donatas Abraitis
49cacc3184
Merge pull request #15150 from LabNConsulting/chopps/config-file-integrated
doc: update config file doc for integrated requirement
2024-01-15 08:43:44 +02:00
Igor Ryzhov
25d79af957 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>
2024-01-14 20:00:22 +02:00
Igor Ryzhov
88275d392a vtysh, mgmtd: send interface commands to mgmtd
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14 20:00:22 +02:00
Igor Ryzhov
b507ad54b4 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>
2024-01-14 20:00:22 +02:00
Igor Ryzhov
2b7d9532c8 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>
2024-01-14 19:08:15 +02:00
Christian Hopps
d9d5f79610
Merge pull request #15151 from idryzhov/mgmtd-vrf
mgmtd: remove full vrf initialization
2024-01-14 12:04:46 -05:00
Christian Hopps
c68246c069 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>
2024-01-14 12:38:25 +00:00
Donald Sharp
ef0ae6e815
Merge pull request #15152 from LabNConsulting/chopps/doc-mgmtd-convert-update
doc: mgmtd: update mgmtd conversion doc to be current.
2024-01-13 20:46:36 -05:00
Christian Hopps
3b1998061c
doc: update config file doc for integrated requirement
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-13 21:05:36 +00:00
Donatas Abraitis
4eafe41546
Merge pull request #15149 from donaldsharp/pim_vxlan_issues_2
Some code realignment in pim
2024-01-13 21:10:07 +02:00
Donatas Abraitis
fd690b9bc4
Merge pull request #15135 from idryzhov/mgmt-unused
mgmtd: remove unused/redundant variables
2024-01-13 21:08:24 +02:00
Donatas Abraitis
bbe239036a
Merge pull request #15137 from spmzt/master
build: make buildtest.sh BSD compatible
2024-01-13 21:07:25 +02:00
Christian Hopps
a9dc7e9cc0
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>
2024-01-13 14:26:55 +00:00
Igor Ryzhov
fe55bb15be 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>
2024-01-13 15:51:59 +02:00
Donatas Abraitis
9a042e0ba7
Merge pull request #15144 from LabNConsulting/chopps/cov-issue-2
lib: fix coverity issue
2024-01-12 23:38:23 +02:00
Donald Sharp
22427b5392 pimd: Use vrf name instead of id in some debugs
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-01-12 15:04:59 -05:00
Donald Sharp
413c0ebe5b 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>
2024-01-12 15:04:59 -05:00
Donald Sharp
8006207a92
Merge pull request #15138 from opensourcerouting/fix/drop_unused_var_bgp_damp
bgpd: Drop dampening `tmax` variable from struct
2024-01-12 14:34:46 -05:00
Donatas Abraitis
945318802e
Merge pull request #15121 from routingrocks/rajesh/bgp_peer_ttl
bgpd: Set correct TTL for the dynamic neighbor peers
2024-01-12 20:26:34 +02:00
Donatas Abraitis
ef85d4f5c3
Merge pull request #15130 from donaldsharp/pim_vxlan_issues
Pim vxlan issues
2024-01-12 20:26:10 +02:00
Christian Hopps
008ba3e3fb
lib: fix coverity issue
** CID 1575595:  Null pointer dereferences  (REVERSE_INULL)

Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-12 16:37:30 +00:00
Donatas Abraitis
d2c275a793
Merge pull request #15133 from LabNConsulting/chopps/coverity-fixes
lib: fix coverity issues
2024-01-12 16:06:26 +02:00
Igor Ryzhov
64d9f2f70d 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>
2024-01-12 13:29:15 +02:00
Christian Hopps
20d0d475cb
Merge pull request #14542 from idryzhov/nb-op-cb-split
Add more northbound operation types
2024-01-12 06:07:57 -05:00
Seyed Pouria Mousavizadeh Tehrani
17eb8599c5
build: make buildtest.sh BSD compatible
Signed-off-by: Seyed Pouria Mousavizadeh Tehrani <p.mousavizadeh@protonmail.com>
2024-01-12 14:08:10 +03:30
Donatas Abraitis
0f5a79af96
Merge pull request #15136 from idryzhov/ignore-cbs
lib, mgmtd: rename ignore_cbs to ignore_cfg_cbs
2024-01-12 11:56:59 +02:00
Donatas Abraitis
a3ad0d21fb bgpd: Drop dampening tmax variable from struct
Not used anywhere.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-12 11:29:43 +02:00
Christian Hopps
e1ec5b74a2
Merge pull request #15127 from opensourcerouting/fix/doc_libyang_artifacts
doc: libyang nits
2024-01-12 03:32:37 -05:00
Christian Hopps
e754620fb0
Merge pull request #15134 from idryzhov/fix-commit-clients
mgmtd: don't try to send config to disconnected clients
2024-01-12 03:32:03 -05:00
Igor Ryzhov
883f134921
Merge pull request #15131 from LabNConsulting/chopps/oper-choice-case
Chopps/oper choice case
2024-01-12 00:20:45 +02:00
Igor Ryzhov
34721972ba 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>
2024-01-11 23:47:48 +02:00
Igor Ryzhov
2148f70b1a mgmtd: remove unused pending_be_proc variable
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11 23:08:01 +02:00
Igor Ryzhov
0eac9b6f07 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>
2024-01-11 22:56:42 +02:00
Rajesh Varatharaj
68573c34d4 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>
2024-01-11 10:18:03 -08:00
Christian Hopps
29f2a300a3 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>
2024-01-11 18:14:58 +00:00
Donald Sharp
8e85c8b45e 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>
2024-01-11 11:50:52 -05:00
Donald Sharp
f80db3063d 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>
2024-01-11 11:50:52 -05:00
Donald Sharp
86cbd5831e
Merge pull request #15128 from opensourcerouting/fix/bgp_oad_ECOMMUNITY_ORIGIN_VALIDATION_STATE
bgpd: Recent EBGP-OAD improvements
2024-01-11 09:07:31 -05:00
Christian Hopps
7b7725f7b8
lib: change type of inner to struct lyd_node *, cleaner code
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-11 13:51:23 +00:00