Commit Graph

34801 Commits

Author SHA1 Message Date
Carmine Scarpitta
b1f1cb9c23 fpm: Add functions to encode nexthop in protobuf
Add two helper functions to encode/decode nexthops in protobuf.

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

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

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-02-18 18:31:13 +01:00
Carmine Scarpitta
4ec8ef5098 fpm: Add SRv6 VPN SIDs to fpm.proto
Add two optional fields to the AddRoute protobuf message to support
SRv6 VPN use cases:
* `srv6_vpn_sid`: used to associate an SRv6 VPN SID to a route; if
present, the router will steer the traffic that matches the prefix by
encapsulating the payload in an outer IPv6 header where the destination
address is the SRv6 VPN SID provided
* `srv6_encap_source_address`: source Address of outer encapsulating
IPv6 header

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

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-02-18 18:31:13 +01:00
Carmine Scarpitta
7052c94ba3 fpm: Add SRv6 Local SIDs to fpm.proto
Add several protobuf messages to support the installation and removal
of SRv6 Local SIDs via FPM protobuf.

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

Signed-off-by: Carmine Scarpitta <cscarpit@cisco.com>
2024-02-18 18:31:13 +01:00
Donatas Abraitis
311eac53e8
Merge pull request #15357 from dpward/master
github: Replace issue template with issue form
2024-02-18 14:43:21 +02:00
Donatas Abraitis
c872610f7d
Merge pull request #15376 from sri-mohan1/srib-24-babel
babeld: changes for code maintainability
2024-02-16 22:29:06 +02:00
Donald Sharp
9aec0d5a18
Merge pull request #15378 from idryzhov/ospf-suppress-fa
tests: fix ospf_suppress_fa timing issue
2024-02-16 07:26:24 -05:00
Igor Ryzhov
cb570d87d0
Merge pull request #15382 from donaldsharp/more_sa_failures
More sa failures
2024-02-16 13:55:35 +02:00
Donald Sharp
863e6ddf11 bgpd: Fix value stored to group never being read
SA Reports:

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-02-15 23:28:18 -05:00
Donald Sharp
0f7b5fcffb ospfd: Fix assignment with never being used
SA finds this:

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

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-02-15 23:27:38 -05:00
Igor Ryzhov
fa67c0b91c
Merge pull request #15371 from LabNConsulting/chopps/mgmtd-fixes
Fixes for the northbound/mgmtd
2024-02-15 20:02:23 +02:00
Igor Ryzhov
829443fd83 tests: fix ospf_suppress_fa timing issue
Set static router-id for OSPF, because otherwise it depends on timing of
router-id updates received from zebra and may differ between test runs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-15 15:38:26 +02:00
Christian Hopps
dff28248c3 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>
2024-02-15 06:13:08 -05:00
Christian Hopps
b8e07049a8 lib: fix memleak on success
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-15 06:13:08 -05:00
David Ward
16308917a2 github: Replace issue template with issue form
Signed-off-by: David Ward <david.ward@gatech.edu>
2024-02-15 03:16:54 -05:00
Donatas Abraitis
2fd5e51d4c
Merge pull request #15332 from donaldsharp/nhg_stuffs
Nhg stuffs
2024-02-14 16:14:19 +02:00
Donatas Abraitis
4952f23cee
Merge pull request #15288 from donaldsharp/shell_access_removal
vtysh: Remove deprecated shell_access code
2024-02-14 11:20:36 +02:00
Igor Ryzhov
cccfedb345
Merge pull request #15359 from LabNConsulting/chopps/reap-unused-phase
mgmtd: remove unused commit phase SEND_CFG
2024-02-14 11:15:06 +02:00
Donatas Abraitis
d5bec7b081 build: FRR 10.1 development version
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-02-13 21:18:45 +02:00
sri-mohan1
21b7f32a2c babeld: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2024-02-14 00:00:31 +05:30
Donald Sharp
9fd7bf4cbb
Merge pull request #15234 from opensourcerouting/snmp-topotest-fixes
topotests: fix snmptrap log OID parsing
2024-02-13 10:59:30 -05:00
Russ White
e74c3b0746
Merge pull request #15320 from donaldsharp/vtysh_limit_fds
lib, ospfclient, vtysh: Allow for a minimum fd poll size
2024-02-13 09:50:00 -05:00
Russ White
17a0a625f0
Merge pull request #15284 from opensourcerouting/feature/bgpd_announce_rpki_state_knob
bgpd: Add neighbor X send-community extended rpki command
2024-02-13 09:35:10 -05:00
Christian Hopps
7b94a923ae
Merge pull request #15042 from Orange-OpenSource/ospf-te
ospfd: Add Opaque LSA decoder for json output
2024-02-13 05:37:29 -05:00
Christian Hopps
60cb834ead
Merge pull request #15361 from idryzhov/fix-be-interested
mgmtd: fix be_is_client_interested
2024-02-12 20:11:20 -05:00
Donatas Abraitis
26faf341ef
Merge pull request #15352 from louis-6wind/fix-leak-recursive
bgpd: fix route recursion on leaked routes
2024-02-12 21:42:03 +02:00
Igor Ryzhov
745a2bd8b3 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>
2024-02-12 20:55:34 +02:00
Igor Ryzhov
24ca4f408b
Merge pull request #15358 from LabNConsulting/chopps/doc-update
update doc with new more strict protobuf requirements
2024-02-12 19:52:35 +02:00
Olivier Dugeon
b46a1fe826 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>
2024-02-12 17:52:00 +01:00
Olivier Dugeon
6fcc86d37a 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>
2024-02-12 17:52:00 +01:00
Olivier Dugeon
b27d9e4d3b 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>
2024-02-12 17:52:00 +01:00
Olivier Dugeon
95c9cb9aa9 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>
2024-02-12 17:52:00 +01:00
Olivier Dugeon
aa2b539bf5 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>
2024-02-12 17:52:00 +01:00
Christian Hopps
40e51d2257 mgmtd: remove unused commit phase SEND_CFG
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-12 07:57:28 -05:00
Christian Hopps
8d6e7a350f tests: fix grpc test
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-12 07:48:50 -05:00
Christian Hopps
6374970cb8 doc: docker: update with new more strict protobuf requirements
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-02-12 06:48:12 -05:00
Christian Hopps
d71710a910
Merge pull request #15355 from idryzhov/fix-mgmtd-notif
Fix and rework YANG notifications
2024-02-12 06:17:38 -05:00
Donald Sharp
9800590ccc
Merge pull request #15346 from opensourcerouting/fix/memory_optimizations
Some more memory optimizations
2024-02-11 21:33:44 -05:00
Donald Sharp
6d3f9bf605
Merge pull request #15356 from idryzhov/configure-sysconfdir
build: fix configure output
2024-02-11 21:33:00 -05:00
Donatas Abraitis
400fe8db63
Merge pull request #15347 from askorichenko/test-bgp-ttl
bgpd: fix minttl copying during peer reset
2024-02-11 22:12:32 +02:00
Igor Ryzhov
e9d41d1441 build: fix configure output
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-02-11 13:34:59 +02:00
Igor Ryzhov
3ac3a6605d 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>
2024-02-11 13:26:52 +02:00
Donald Sharp
8aeb63634d
Merge pull request #15354 from cscarpitta/fix/fpm-pb-add-missing-include
qpb: Add missing `#include nexthop.h`
2024-02-10 20:52:47 -05:00
Carmine Scarpitta
6d1c04f4d0 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>
2024-02-10 00:44:50 +01:00
Igor Ryzhov
7d8064c6d4
Merge pull request #15353 from vjardin/yang_converted
mgmtd: ripng, libs fully converted
2024-02-10 01:27:23 +02:00
Igor Ryzhov
d94f80fbc4 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>
2024-02-10 01:00:24 +02:00
Vincent JARDIN
14fc0782d4 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>
2024-02-09 19:23:01 +01:00
Louis Scalbert
59a544c39b 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>
2024-02-09 18:25:01 +01:00
Louis Scalbert
1a348ec050 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>
2024-02-09 18:25:01 +01:00
Alexander Skorichenko
f4da4398f4 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>
2024-02-09 16:58:52 +01:00
Donatas Abraitis
4dccc31884 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>
2024-02-09 17:29:35 +02:00