Commit Graph

35139 Commits

Author SHA1 Message Date
Igor Ryzhov
d617c9175a zebra: convert interface ipv6 nd suppress-ra command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
10757acae6 zebra: convert interface evpn mh uplink command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
4a18818b02 zebra: convert interface evpn mh bypass command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
7c6e41ecff zebra: convert interface evpn mh es-df-pref command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
a6db1c14a4 zebra: convert interface evpn mh es-id commands to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
be712fc697 zebra: convert interface link-params packet-loss command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
20fe60f40d 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>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
0a5b944aef zebra: convert interface link-params delay commands to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
217b65e5bf zebra: convert interface link-params neighbor command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
93744dbe88 zebra: convert interface link-params bandwidth commands to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
e633296443 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>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
59e3ce08fa zebra: convert interface link-params metric command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
b688eb7e9e 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>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
7fc02c462c zebra: mark interface mpls command as yang
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
fa500fd8ec zebra: convert interface ip/ipv6 address commands to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
0c2c01c151 zebra: convert interface bandwidth command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
edd3c63170 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>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
df296d54ae zebra: convert interface link-detect command to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
efa18c6c6f 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>
2024-01-28 23:28:39 +02:00
Igor Ryzhov
d9a798e0ad 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>
2024-01-28 23:28:39 +02:00
Donald Sharp
259e3d4dac
Merge pull request #15243 from opensourcerouting/autoconf-dir-mess
*: fix a pile of directory and/or state retention related issues
2024-01-28 14:30:28 -05:00
Donatas Abraitis
e68c4f0539 packaging: Just permit anything if PAM is enabled
With a current pam_rootok.so, it works only with `root` account. If the user
is under `frrvty`, `frr` group, it gets the error:

```
% groups | grep -o -E "frrvty|frr"
frrvty
frr

% vtysh -c 'end'
vtysh_pam: Failed in account validation: Permission denied(6)
```

Checking the logs:

```
vtysh[23930]: pam_rootok(frr:account): root check failed
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-28 19:50:06 +02:00
Donald Sharp
4d92badcde
Merge pull request #15236 from louis-6wind/fix-label-cmp
bgpd: fix mpls label pointer comparison
2024-01-28 09:20:56 -05:00
Jafar Al-Gharaibeh
4cb03cacd9
Merge pull request #15242 from LabNConsulting/chopps/doc-dev-nb-cleanup
Cleanup the auto-converted northbound doc a little
2024-01-27 22:49:40 -06:00
Jafar Al-Gharaibeh
c62d77dabe
Merge pull request #15244 from idryzhov/mgmtd-fixes
A couple of mgmtd fixes
2024-01-27 22:46:27 -06:00
Igor Ryzhov
8785a3ad87 mgmtd: fix ripngd oper-data xpaths
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28 01:24:02 +02:00
Igor Ryzhov
be9209a7e4 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>
2024-01-28 01:18:10 +02:00
David Lamparter
bbd858935f 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>
2024-01-27 19:02:52 +01:00
David Lamparter
f1ad2c4631 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>
2024-01-27 19:02:52 +01:00
David Lamparter
bfd6d8ee19 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>
2024-01-27 19:02:52 +01:00
David Lamparter
567f5702c0 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>
2024-01-27 19:02:52 +01:00
David Lamparter
110945ba0d 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>
2024-01-27 19:02:52 +01:00
David Lamparter
e354c6e343 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>
2024-01-27 19:02:52 +01:00
David Lamparter
634f481113 *: 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>
2024-01-27 19:02:51 +01:00
David Lamparter
cd35ecc575 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>
2024-01-27 19:01:19 +01:00
David Lamparter
a97d0c5875 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>
2024-01-27 19:01:19 +01:00
David Lamparter
0f79e6b876 build: nuke LDPD_SOCKET
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
72783ecca2 build: nuke ZEBRA_SERV_PATH
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
80b6787e27 build: nuke BFDD_CONTROL_SOCKET
This just unnecessarily complicates things by involving autoconf.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
0d5a2497ca lib, mgmtd: fix wrong mgmtd socket paths
These paths were ignoring the `-N` namespacing option.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
42eeea090e *: rename frr_vtydir to frr_runstatedir
Also remove frr_init_vtydir(), just initialize to default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
444bc5e237 build: update packaging & docs for dir changes
`--sysconfdir` and `--localstatedir` now align with general autoconf
practices.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2024-01-27 19:01:19 +01:00
David Lamparter
ff62df2e44 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>
2024-01-27 19:01:19 +01:00
David Lamparter
27f6171a25 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>
2024-01-27 19:01:19 +01:00
David Lamparter
b052b18318 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>
2024-01-27 19:01:19 +01:00
David Lamparter
f8eb388b7e 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>
2024-01-27 19:01:19 +01:00
Donatas Abraitis
03fd7d589a
Merge pull request #15239 from cscarpitta/fix/fix-srv6-topotests
tests: Fix SRv6 topotest names
2024-01-27 19:47:28 +02:00
Christian Hopps
cdfff3e5b5 doc: cleanup the structure a bit
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-27 05:03:57 -05:00
Christian Hopps
e2a9eb908f doc: cleanup auto-converted "list" style mistake
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-27 05:03:51 -05:00
Igor Ryzhov
3f96dcfa86
Merge pull request #15240 from LabNConsulting/chopps/convert-ripngd
ripngd: convert ripngd to mgmtd
2024-01-27 05:42:34 +02:00