]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
15 months agodoc, yang, zebra: allow bandwidth up to 1 terabit/sec
Philippe Guibert [Wed, 22 Apr 2020 11:33:20 +0000 (13:33 +0200)]
doc, yang, zebra: allow bandwidth up to 1 terabit/sec

Allow bandwidth up to 1000000 Mb/s (ie. 1 Tb/s) and document it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agozebra: fix speed set to UINT32_MAX
Philippe Guibert [Wed, 15 Apr 2020 13:16:11 +0000 (15:16 +0200)]
zebra: fix speed set to UINT32_MAX

get_iflink_speed() returns UINT32_MAX when the speeds is unknown.
Routing daemons (at least ospfd) interprets it as the high value.

Return errors in get_iflink_speed() to avoid the confusion.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
15 months agoMerge pull request #15181 from idryzhov/zebra-mgmtd
Christian Hopps [Mon, 29 Jan 2024 12:46:23 +0000 (07:46 -0500)]
Merge pull request #15181 from idryzhov/zebra-mgmtd

zebra interfaces NB conversion

15 months agoMerge pull request #15245 from idryzhov/disable-irdp
Christian Hopps [Mon, 29 Jan 2024 01:19:59 +0000 (20:19 -0500)]
Merge pull request #15245 from idryzhov/disable-irdp

zebra, build: disable irdp by default

15 months agozebra, build: disable irdp by default
Igor Ryzhov [Wed, 24 Jan 2024 03:11:07 +0000 (05:11 +0200)]
zebra, build: disable irdp by default

IRDP client (rdisc) was deleted from iputils more than 2 years ago. It's
time to drop IRDP, but first let's stop building and including it in the
packages by default to see if anyone will be complaining.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib, mgmtd, zebra: cleanup of zebra conversion to mgmtd
Igor Ryzhov [Sun, 28 Jan 2024 21:23:57 +0000 (23:23 +0200)]
lib, mgmtd, zebra: cleanup of zebra conversion to mgmtd

- use `apply_finish` callback when possible to avoid multiple applies per commit
- move table range working to the CLI handler
- remove unnecessary conditional compilation
- remove unnecessary boolean conversion

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert to mgmtd
Igor Ryzhov [Wed, 24 Jan 2024 21:04:23 +0000 (23:04 +0200)]
zebra: convert to mgmtd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobuild: remove mgmtd exception from xref2vtysh
Igor Ryzhov [Sat, 27 Jan 2024 04:20:22 +0000 (06:20 +0200)]
build: remove mgmtd exception from xref2vtysh

We may actually need to send CLI commands to mgmtd and another daemon at
the same time, for example, if this daemon is not mgmtd-converted. The
only daemon this exception protects is staticd. But we don't actually
need any configuration commands in staticd, so just remove the exception
and don't install unnecessary commands to staticd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: use shared candidate between vty and mgmtd client
Igor Ryzhov [Wed, 24 Jan 2024 20:59:07 +0000 (22:59 +0200)]
lib: use shared candidate between vty and mgmtd client

When the daemon is partially mgmtd-converted, it receives configuration
from vty and mgmtmd simultaneosly. This configuration must be
synchronized.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: convert affinity-map to mgmtd
Igor Ryzhov [Wed, 24 Jan 2024 20:53:00 +0000 (22:53 +0200)]
lib: convert affinity-map to mgmtd

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix yang_dnode_dup
Igor Ryzhov [Wed, 24 Jan 2024 20:26:47 +0000 (22:26 +0200)]
lib: fix yang_dnode_dup

When duplicating nodes, we should always keep flags, especially the
LYD_NEW flag that indicates not validated data. This allows to select a
new choice's case without the need to explicitly remove the existing one.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert vrf configuration output to NB
Igor Ryzhov [Sat, 27 Jan 2024 17:38:06 +0000 (19:38 +0200)]
zebra: convert vrf configuration output to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: make vrf netns commands do nothing
Igor Ryzhov [Sat, 27 Jan 2024 11:11:08 +0000 (13:11 +0200)]
zebra: make vrf netns commands do nothing

These commands don't really provide any functionality. VRF is associated
with netns automatically based on its name, and it's not possible to
associate VRF and netns with different names with these commands:

- When trying to assosiate a VRF with an already existing netns with a
  different name:
  `NS /run/netns/test is already configured with VRF 1(test)`

- When trying to assiciate a VRF with a non-existing netns, so they
  become linked once the netns is created:
  `Invalid pathname for /run/netns/test: No such file or directory`

- When doing "no netns" to unlink the netns and link it back to the same
  VRF:
  `VRF 1 is already configured with VRF test`

- When doing "no netns" to unlink the netns and link it to another VRF:
  `Can not associate NS 4294967295 with NETNS /run/netns/test`

As shown above, not a single usecase is working. We can't remove them
completely to preserve backwards-compatibility, so just make them empty.

The main reason for this change is not to spend a lot of time trying to
figure out how to convert them to northbound.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert table range command to NB
Igor Ryzhov [Sat, 27 Jan 2024 03:00:27 +0000 (05:00 +0200)]
zebra: convert table range command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert resolve-via-default commands to NB
Igor Ryzhov [Sat, 27 Jan 2024 02:04:28 +0000 (04:04 +0200)]
zebra: convert resolve-via-default commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: fix vni NB conversion
Igor Ryzhov [Sat, 27 Jan 2024 01:36:20 +0000 (03:36 +0200)]
zebra: fix vni NB conversion

- unnecessary command duplication
- usage of oper data during validation
- unnecessary checks for things that can't happen

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert route-map delay-timer command to NB
Igor Ryzhov [Sat, 27 Jan 2024 00:15:56 +0000 (02:15 +0200)]
zebra: convert route-map delay-timer command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert ip nht commands to NB
Igor Ryzhov [Fri, 26 Jan 2024 23:51:33 +0000 (01:51 +0200)]
zebra: convert ip nht commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert ip protocol commands to NB
Igor Ryzhov [Fri, 26 Jan 2024 23:50:04 +0000 (01:50 +0200)]
zebra: convert ip protocol commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert router-id commands to NB
Igor Ryzhov [Fri, 26 Jan 2024 22:16:17 +0000 (00:16 +0200)]
zebra: convert router-id commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface configuration output to NB
Igor Ryzhov [Wed, 24 Jan 2024 14:50:26 +0000 (16:50 +0200)]
zebra: convert interface configuration output to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: fix build with --disable-rtadv
Igor Ryzhov [Wed, 24 Jan 2024 02:35:03 +0000 (04:35 +0200)]
zebra: fix build with --disable-rtadv

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert PTM configuration to NB
Igor Ryzhov [Wed, 24 Jan 2024 01:03:50 +0000 (03:03 +0200)]
zebra: convert PTM configuration to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: add support for "features" when loading YANG modules
Igor Ryzhov [Wed, 24 Jan 2024 01:02:15 +0000 (03:02 +0200)]
lib: add support for "features" when loading YANG modules

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd dnssl command to NB
Igor Ryzhov [Tue, 23 Jan 2024 21:00:45 +0000 (23:00 +0200)]
zebra: convert interface ipv6 nd dnssl command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd rdnss command to NB
Igor Ryzhov [Tue, 23 Jan 2024 20:14:53 +0000 (22:14 +0200)]
zebra: convert interface ipv6 nd rdnss command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd prefix command to NB
Igor Ryzhov [Tue, 23 Jan 2024 19:32:16 +0000 (21:32 +0200)]
zebra: convert interface ipv6 nd prefix command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd router-preference command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:57:29 +0000 (18:57 +0200)]
zebra: convert interface ipv6 nd router-preference command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd home-agent-lifetime command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:31:27 +0000 (18:31 +0200)]
zebra: convert interface ipv6 nd home-agent-lifetime command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd home-agent-preference command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:30:29 +0000 (18:30 +0200)]
zebra: convert interface ipv6 nd home-agent-preference command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd adv-interval-option command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:29:36 +0000 (18:29 +0200)]
zebra: convert interface ipv6 nd adv-interval-option command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd home-agent-config-flag command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:28:33 +0000 (18:28 +0200)]
zebra: convert interface ipv6 nd home-agent-config-flag command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd ra-fast-retrans command to NB
Igor Ryzhov [Tue, 23 Jan 2024 16:25:31 +0000 (18:25 +0200)]
zebra: convert interface ipv6 nd ra-fast-retrans command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd ra-hop-limit command to NB
Igor Ryzhov [Tue, 23 Jan 2024 15:20:22 +0000 (17:20 +0200)]
zebra: convert interface ipv6 nd ra-hop-limit command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd ra-retrans-interval command to NB
Igor Ryzhov [Tue, 23 Jan 2024 15:19:41 +0000 (17:19 +0200)]
zebra: convert interface ipv6 nd ra-retrans-interval command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd mtu command to NB
Igor Ryzhov [Tue, 23 Jan 2024 15:18:41 +0000 (17:18 +0200)]
zebra: convert interface ipv6 nd mtu command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd other-config-flag command to NB
Igor Ryzhov [Tue, 23 Jan 2024 15:17:48 +0000 (17:17 +0200)]
zebra: convert interface ipv6 nd other-config-flag command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd managed-config-flag command to NB
Igor Ryzhov [Tue, 23 Jan 2024 15:16:50 +0000 (17:16 +0200)]
zebra: convert interface ipv6 nd managed-config-flag command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd reachable-time command to NB
Igor Ryzhov [Tue, 23 Jan 2024 14:28:43 +0000 (16:28 +0200)]
zebra: convert interface ipv6 nd reachable-time command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd ra interval/lifetime commands to NB
Igor Ryzhov [Tue, 23 Jan 2024 14:04:39 +0000 (16:04 +0200)]
zebra: convert interface ipv6 nd ra interval/lifetime commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ipv6 nd suppress-ra command to NB
Igor Ryzhov [Tue, 23 Jan 2024 12:20:49 +0000 (14:20 +0200)]
zebra: convert interface ipv6 nd suppress-ra command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface evpn mh uplink command to NB
Igor Ryzhov [Mon, 22 Jan 2024 20:21:38 +0000 (22:21 +0200)]
zebra: convert interface evpn mh uplink command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface evpn mh bypass command to NB
Igor Ryzhov [Mon, 22 Jan 2024 20:21:04 +0000 (22:21 +0200)]
zebra: convert interface evpn mh bypass command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface evpn mh es-df-pref command to NB
Igor Ryzhov [Mon, 22 Jan 2024 19:52:09 +0000 (21:52 +0200)]
zebra: convert interface evpn mh es-df-pref command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface evpn mh es-id commands to NB
Igor Ryzhov [Mon, 22 Jan 2024 19:34:35 +0000 (21:34 +0200)]
zebra: convert interface evpn mh es-id commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params packet-loss command to NB
Igor Ryzhov [Sat, 20 Jan 2024 01:55:42 +0000 (03:55 +0200)]
zebra: convert interface link-params packet-loss command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix conversion of yang decimal64 to double
Igor Ryzhov [Sat, 20 Jan 2024 01:43:18 +0000 (03:43 +0200)]
lib: fix conversion of yang decimal64 to double

Current denominators are not integers and some of them lose precision
because of that, for example, 1e-6 is actually stored as
9.9999999999999995e-07 and 1-e12 is stored as 9.9999999999999998e-13.
When multiplying by such denominators, we receive incorrect values.
Changing denominators to integers and using division instead of
multiplication improves precision and solves the problem.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params delay commands to NB
Igor Ryzhov [Fri, 19 Jan 2024 23:38:26 +0000 (01:38 +0200)]
zebra: convert interface link-params delay commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params neighbor command to NB
Igor Ryzhov [Fri, 19 Jan 2024 23:02:37 +0000 (01:02 +0200)]
zebra: convert interface link-params neighbor command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params bandwidth commands to NB
Igor Ryzhov [Fri, 19 Jan 2024 22:13:14 +0000 (00:13 +0200)]
zebra: convert interface link-params bandwidth commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: don't set LP_EXTEND_ADM_GRP by default
Igor Ryzhov [Fri, 19 Jan 2024 16:49:52 +0000 (18:49 +0200)]
lib: don't set LP_EXTEND_ADM_GRP by default

It shouldn't be set unless some affinity is configured. NB callbacks
set this flag correctly when necessary.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params metric command to NB
Igor Ryzhov [Fri, 19 Jan 2024 12:34:27 +0000 (14:34 +0200)]
zebra: convert interface link-params metric command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-params command to NB
Igor Ryzhov [Fri, 19 Jan 2024 11:06:53 +0000 (13:06 +0200)]
zebra: convert interface link-params command to NB

Make link-params a presence container and activate it when entering the
node. The "enable" command is not necessary anymore but kept hidden for
backwards compatibility.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: mark interface mpls command as yang
Igor Ryzhov [Fri, 19 Jan 2024 09:53:46 +0000 (11:53 +0200)]
zebra: mark interface mpls command as yang

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface ip/ipv6 address commands to NB
Igor Ryzhov [Thu, 18 Jan 2024 18:21:00 +0000 (20:21 +0200)]
zebra: convert interface ip/ipv6 address commands to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface bandwidth command to NB
Igor Ryzhov [Wed, 17 Jan 2024 15:24:44 +0000 (17:24 +0200)]
zebra: convert interface bandwidth command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface shutdown command to NB
Igor Ryzhov [Wed, 17 Jan 2024 13:58:17 +0000 (15:58 +0200)]
zebra: convert interface shutdown command to NB

Replace "shutdown" leaf with "enabled" leaf in frr-zebra YANG module
to make it in line with standard YANG models.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert interface link-detect command to NB
Igor Ryzhov [Wed, 17 Jan 2024 12:58:03 +0000 (14:58 +0200)]
zebra: convert interface link-detect command to NB

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agozebra: convert inteface multicast command to NB
Igor Ryzhov [Wed, 17 Jan 2024 12:28:13 +0000 (14:28 +0200)]
zebra: convert inteface multicast command to NB

Introduce new "[no] multicast <enable|disable>" command to be able to
remove the configuration. Current "[no] multicast" command cannot be
removed. Current command is hidden but still works for backwards
compatibility.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agotests: fix test_bgp_recursive_route_ebgp_multi_hop
Igor Ryzhov [Mon, 22 Jan 2024 11:51:52 +0000 (13:51 +0200)]
tests: fix test_bgp_recursive_route_ebgp_multi_hop

We shouldn't pass "lo" as an interface to create_interface_in_kernel.
It always exists, and this function flushes all configured IP addresses
from it.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agoMerge pull request #15243 from opensourcerouting/autoconf-dir-mess
Donald Sharp [Sun, 28 Jan 2024 19:30:28 +0000 (14:30 -0500)]
Merge pull request #15243 from opensourcerouting/autoconf-dir-mess

*: fix a pile of directory and/or state retention related issues

15 months agoMerge pull request #15236 from louis-6wind/fix-label-cmp
Donald Sharp [Sun, 28 Jan 2024 14:20:56 +0000 (09:20 -0500)]
Merge pull request #15236 from louis-6wind/fix-label-cmp

bgpd: fix mpls label pointer comparison

15 months agoMerge pull request #15242 from LabNConsulting/chopps/doc-dev-nb-cleanup
Jafar Al-Gharaibeh [Sun, 28 Jan 2024 04:49:40 +0000 (22:49 -0600)]
Merge pull request #15242 from LabNConsulting/chopps/doc-dev-nb-cleanup

Cleanup the auto-converted northbound doc a little

15 months agoMerge pull request #15244 from idryzhov/mgmtd-fixes
Jafar Al-Gharaibeh [Sun, 28 Jan 2024 04:46:27 +0000 (22:46 -0600)]
Merge pull request #15244 from idryzhov/mgmtd-fixes

A couple of mgmtd fixes

15 months agomgmtd: fix ripngd oper-data xpaths
Igor Ryzhov [Sat, 27 Jan 2024 23:24:02 +0000 (01:24 +0200)]
mgmtd: fix ripngd oper-data xpaths

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix get-data transaction hangup
Igor Ryzhov [Sat, 27 Jan 2024 23:18:10 +0000 (01:18 +0200)]
mgmtd: fix get-data transaction hangup

When no data requests were sent to the backends, return immediately,
instead of waiting for a timeout. This can happen if backends providing
the requested data are not connected to mgmtd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agobuild: homologize path handling
David Lamparter [Thu, 25 Jan 2024 19:29:14 +0000 (20:29 +0100)]
build: homologize path handling

Use consistent `e_somepath` names for expanded versions of `somepath`.
Also remove all paths from `config.h` and put them into
`lib/config_paths.h` - this is to make more obvious when someone is
doing something probably not quite properly structured.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobabeld: remove bogus config path print
David Lamparter [Thu, 25 Jan 2024 19:26:39 +0000 (20:26 +0100)]
babeld: remove bogus config path print

This doesn't align with what the code actually loads, remove it.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib, mgmtd: fix commit history location
David Lamparter [Thu, 25 Jan 2024 18:59:22 +0000 (19:59 +0100)]
lib, mgmtd: fix commit history location

Both of these belong in `/var/lib`, not `/var/run`.

Rather hilariously, the history read in
`mgmt_history_read_cmt_record_index` was always failing, because it was
doing a `file_exists(MGMTD_COMMIT_FILE_PATH)` check.  Which is the wrong
macro - it's `.../commit-%s.json`, including the unprocessed `%s`, which
would never exist.

I guess noone ever tried if this actually works.  Cool.

On the plus side, this means I don't have to implement legacy
compatibility for this, since it never worked to begin with.

(SQLite3 DB location is also changed in this commit since it also uses
`DAEMON_DB_DIR`.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agoospf6d: fix GR & auth seqno state location
David Lamparter [Thu, 25 Jan 2024 18:37:26 +0000 (19:37 +0100)]
ospf6d: fix GR & auth seqno state location

Unfortunately, `ospf6d` is much worse than `ospfd` and `isisd` regarding
its state saving, due to the existence of the auth trailer code.

Again, this belongs in `/var/lib`, not `/var/run`.

Merge both state files into one, and add reconciliation code for the
auth seqno.

I'm gonna save my comment on the fact that `ospf6_auth_seqno_nvm_delete`
is not in fact used anywhere.  Which is now a warning because it's
`static`.  Well.  It probably should be used somewhere, so leave it in.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agoospfd: fix GR state location
David Lamparter [Thu, 25 Jan 2024 17:10:08 +0000 (18:10 +0100)]
ospfd: fix GR state location

This belongs in `/var/lib`, not `/var/run`.

Use library facility to load/save, support previous path as fallback,
and do proper fsync().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agoisisd: fix overload state location
David Lamparter [Thu, 25 Jan 2024 15:47:35 +0000 (16:47 +0100)]
isisd: fix overload state location

This belongs in `/var/lib`, not `/var/run`.  Also the filename was
typo'd (`isid-restart.json`).

Change to proper location and fall back to previous in case it's the
first restart after an FRR update from a version with the bugged path.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months ago*: fix `frr_daemon_info` indentation
David Lamparter [Thu, 25 Jan 2024 17:30:10 +0000 (18:30 +0100)]
*: fix `frr_daemon_info` indentation

clang-format doesn't understand FRR_DAEMON_INFO is a long macro where
laying out items semantically makes sense.

(Also use only one `FRR_DAEMON_INFO(` in isisd so editors don't get
confused with the mismatching `( ( )`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib: create `frr_daemon_state_{load,save}`
David Lamparter [Thu, 25 Jan 2024 17:09:17 +0000 (18:09 +0100)]
lib: create `frr_daemon_state_{load,save}`

These functions load daemon-specific persistent state from
`/var/lib/frr` and supersede open-coded variants of similar calls in
ospfd, ospf6d and isisd to save GR state and/or sequence numbers.

Unlike the open-coded variants, the save call correctly `fsync()`s the
saved data to ensure disk contents are consistent.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib: set up `frr_libstatedir`
David Lamparter [Thu, 25 Jan 2024 15:47:31 +0000 (16:47 +0100)]
lib: set up `frr_libstatedir`

This needs to be used for persistent state, which currently is misplaced
into `/var/run` / `/run` where it gets deleted across reboots.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `LDPD_SOCKET`
David Lamparter [Wed, 24 Jan 2024 20:50:26 +0000 (21:50 +0100)]
build: nuke `LDPD_SOCKET`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `ZEBRA_SERV_PATH`
David Lamparter [Wed, 24 Jan 2024 20:43:15 +0000 (21:43 +0100)]
build: nuke `ZEBRA_SERV_PATH`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: nuke `BFDD_CONTROL_SOCKET`
David Lamparter [Wed, 24 Jan 2024 20:38:18 +0000 (21:38 +0100)]
build: nuke `BFDD_CONTROL_SOCKET`

This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agolib, mgmtd: fix wrong mgmtd socket paths
David Lamparter [Wed, 24 Jan 2024 20:17:13 +0000 (21:17 +0100)]
lib, mgmtd: fix wrong mgmtd socket paths

These paths were ignoring the `-N` namespacing option.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months ago*: rename `frr_vtydir` to `frr_runstatedir`
David Lamparter [Wed, 24 Jan 2024 20:01:22 +0000 (21:01 +0100)]
*: rename `frr_vtydir` to `frr_runstatedir`

Also remove frr_init_vtydir(), just initialize to default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: update packaging & docs for dir changes
David Lamparter [Thu, 25 Jan 2024 15:35:29 +0000 (16:35 +0100)]
build: update packaging & docs for dir changes

`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: untangle sysconfdir & localstatedir
David Lamparter [Wed, 24 Jan 2024 18:32:10 +0000 (19:32 +0100)]
build: untangle sysconfdir & localstatedir

`--sysconfdir` should be `/etc` and `--localstatedir` should be `/var`.
The package-specific subdirectory should be added by configure, not
given by the user, to match established behavior by other packages.

Note that `--bindir`, `--sbindir`, `--libdir` and `--libexecdir` have
different established/expected behavior due to distro specific
multi-arch support.  That's why these are left unchanged.

The reason this is getting fixed now is that we need to use
`--localstatedir` for its actual value to put things in `/var/lib`.  As
it is now, being overloaded for `/run`, the configured `/var` path
becomes inaccessible.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: use AX_RECURSIVE_EVAL
David Lamparter [Wed, 24 Jan 2024 18:54:56 +0000 (19:54 +0100)]
build: use AX_RECURSIVE_EVAL

Replace inline expansion loop.  (Also correctly handles prefix=NONE and
exec_prefix=NONE inside the macro.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: add recursion limit for AX_RECURSIVE_EVAL
David Lamparter [Thu, 25 Jan 2024 15:09:20 +0000 (16:09 +0100)]
build: add recursion limit for AX_RECURSIVE_EVAL

The autoconf version can just loop forever, abort instead.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agobuild: add ax_recursive_eval.m4
David Lamparter [Wed, 24 Jan 2024 18:47:10 +0000 (19:47 +0100)]
build: add ax_recursive_eval.m4

As found in the GNU autoconf archive
https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
15 months agoMerge pull request #15239 from cscarpitta/fix/fix-srv6-topotests
Donatas Abraitis [Sat, 27 Jan 2024 17:47:28 +0000 (19:47 +0200)]
Merge pull request #15239 from cscarpitta/fix/fix-srv6-topotests

tests: Fix SRv6 topotest names

15 months agodoc: cleanup the structure a bit
Christian Hopps [Sat, 27 Jan 2024 10:03:57 +0000 (05:03 -0500)]
doc: cleanup the structure a bit

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agodoc: cleanup auto-converted "list" style mistake
Christian Hopps [Sat, 27 Jan 2024 09:27:35 +0000 (04:27 -0500)]
doc: cleanup auto-converted "list" style mistake

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15240 from LabNConsulting/chopps/convert-ripngd
Igor Ryzhov [Sat, 27 Jan 2024 03:42:34 +0000 (05:42 +0200)]
Merge pull request #15240 from LabNConsulting/chopps/convert-ripngd

ripngd: convert ripngd to mgmtd

15 months agoripngd: convert ripngd to mgmtd
Christian Hopps [Fri, 26 Jan 2024 22:40:55 +0000 (17:40 -0500)]
ripngd: convert ripngd to mgmtd

- a couple small fixes for ripd conversion as well.

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agoMerge pull request #15220 from LabNConsulting/chopps/ripd-convert
Igor Ryzhov [Fri, 26 Jan 2024 21:29:59 +0000 (23:29 +0200)]
Merge pull request #15220 from LabNConsulting/chopps/ripd-convert

ripd to mgmtd

15 months agoMerge pull request #15237 from donaldsharp/sharp_watch_neighbors_more
Donatas Abraitis [Fri, 26 Jan 2024 19:09:30 +0000 (21:09 +0200)]
Merge pull request #15237 from donaldsharp/sharp_watch_neighbors_more

sharpd: Add ability to turn off watching of redistribution

15 months agoripd: ripd convert to mgmtd
Christian Hopps [Fri, 19 Jan 2024 16:40:12 +0000 (16:40 +0000)]
ripd: ripd convert to mgmtd

Signed-off-by: Christian Hopps <chopps@labn.net>
15 months agomgmtd: fix commit request overwrite
Igor Ryzhov [Thu, 25 Jan 2024 11:54:45 +0000 (13:54 +0200)]
mgmtd: fix commit request overwrite

There are places, where we can receive an existing commit transaction.
If we don't check that the request already exists, it gets overwritten
and we start having problems with transaction refcounters. Forbid having
multiple configuration sessions simultaneously.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix memleak
Igor Ryzhov [Thu, 25 Jan 2024 11:53:53 +0000 (13:53 +0200)]
mgmtd: fix memleak

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: cleanup txn without scheduling
Igor Ryzhov [Thu, 25 Jan 2024 11:51:58 +0000 (13:51 +0200)]
mgmtd: cleanup txn without scheduling

If the transaction is not cleaned up immediately, it can be still
referenced by some threds. If it's a commit thread and it's executed
before the actual cleanup, mgmtd crashes because of the missing
commit_cfg_req.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix log type
Igor Ryzhov [Thu, 25 Jan 2024 11:48:52 +0000 (13:48 +0200)]
mgmtd: fix log type

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agomgmtd: fix sending the same value to multiple clients
Igor Ryzhov [Wed, 24 Jan 2024 21:03:24 +0000 (23:03 +0200)]
mgmtd: fix sending the same value to multiple clients

The value should not be cleared after sending it to the first client,
otherwise other clients receive an empty string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: fix removing access/prefix lists
Igor Ryzhov [Fri, 26 Jan 2024 14:57:41 +0000 (16:57 +0200)]
lib: fix removing access/prefix lists

CLI for access/prefix list removal was using `nb_cli_apply_changes`
multiple times in the same command. It's fine for regular daemons but
not for mgmtd. Refactor the code to apply changes only once.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
15 months agolib: add yang function for counting data nodes
Igor Ryzhov [Fri, 26 Jan 2024 14:54:36 +0000 (16:54 +0200)]
lib: add yang function for counting data nodes

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>