Yu Watanabe [Thu, 22 Aug 2024 23:07:30 +0000 (08:07 +0900)]
network/routing-policy-rule: use log_section_warning_errno()
Yu Watanabe [Thu, 22 Aug 2024 23:07:12 +0000 (08:07 +0900)]
conf-parser: introduce log_section_full_errno() and friends
Yu Watanabe [Fri, 23 Aug 2024 14:15:10 +0000 (23:15 +0900)]
labeler: support varlink tag
Lennart Poettering [Fri, 23 Aug 2024 08:41:44 +0000 (10:41 +0200)]
varlinkctl: output an expressive error message in case invalid method/interface names are specified
Inspired by #34098 → let's make it easier for users to understand and
correct the mistakes they made: let's early refuse invalid
interface/method names.
Yu Watanabe [Fri, 23 Aug 2024 09:24:56 +0000 (18:24 +0900)]
updatectl: fix typo and drop space in empty lines
Follow-ups for
ec15bb71c2ccd57702325a6e6626053a343f3511 (#32363).
Yu Watanabe [Fri, 23 Aug 2024 14:07:57 +0000 (23:07 +0900)]
Merge pull request #34108 from mrc0mmand/update-translation-files
po: update translation files
Frantisek Sumsal [Fri, 23 Aug 2024 13:37:23 +0000 (15:37 +0200)]
po: drop placeholders and re-add SPDX line
Follow-up for
ecce45cd3f1b4d1fd7f6a6d893f7c12c47c70455.
Frantisek Sumsal [Fri, 23 Aug 2024 13:36:10 +0000 (15:36 +0200)]
po: update translation files
Yu Watanabe [Fri, 23 Aug 2024 09:06:06 +0000 (18:06 +0900)]
Merge pull request #34102 from yuwata/udev-net_id
udev/net_id: trivial cleanups
Yu Watanabe [Fri, 23 Aug 2024 01:14:45 +0000 (10:14 +0900)]
udevadm/test,test-builtin: enable debugging logs by default again
The lines were mistakenly dropped by
aa976d87889ae22b7347787a1ebd03a31dcc0a9e.
Yu Watanabe [Fri, 23 Aug 2024 00:46:09 +0000 (09:46 +0900)]
udev/net_id: update log messages
This also downgrades the log level of a message to debug.
Yu Watanabe [Fri, 23 Aug 2024 00:54:00 +0000 (09:54 +0900)]
udev/net_id: move naming scheme check
We usually do not set r = -1 when a functionality is disabled or not
supported. Even though the error code is not used, let's set a negative
errno in such case.
No functional change, just refactoring.
Follow-up for
0a4ecc54cb9f2d3418b970c51bfadb69c34ae9eb.
Yu Watanabe [Thu, 22 Aug 2024 23:25:53 +0000 (08:25 +0900)]
test: use ASSERT_EQ_ID128() and ASSERT_NE_ID128()
Etienne Champetier [Thu, 22 Aug 2024 20:30:56 +0000 (16:30 -0400)]
udev-builtin-net_id: ignore firmware_node/sun == 0
Since ID_NET_NAME_SLOT was introduced we ignore slot == 0
https://github.com/systemd/systemd/blob/
0035597a30d120f70df2dd7da3d6128fb8ba6051/src/udev/udev-builtin-net_id.c#L139
Qemu sets _SUN to PCI_SLOT() for all NICs, so _SUN is not unique.
https://gitlab.com/qemu-project/qemu/-/issues/2530
In my tests with libvirt I can only set 'slot="0x00"' in interface definition,
so all NICs end up with _SUN == 0, and this commit is enough to avoid the issue.
Fixes
0a4ecc54cb9f2d3418b970c51bfadb69c34ae9eb
Yu Watanabe [Thu, 22 Aug 2024 22:42:16 +0000 (07:42 +0900)]
Merge pull request #34087 from DaanDeMeyer/nspawn-init-revert
Revert "nspawn: Allow specifying custom init program"
Yu Watanabe [Thu, 22 Aug 2024 21:41:45 +0000 (06:41 +0900)]
Merge pull request #34092 from poettering/ambient-caps-fixup
minor tweaks to the recent ambient caps rework
Yu Watanabe [Thu, 22 Aug 2024 20:38:18 +0000 (05:38 +0900)]
Merge pull request #34096 from YHNdnzj/logind-followup-256
logind: two follow-ups
Lennart Poettering [Thu, 22 Aug 2024 16:20:20 +0000 (18:20 +0200)]
boot: use MAX() where appropriate
Yu Watanabe [Thu, 22 Aug 2024 20:25:19 +0000 (05:25 +0900)]
Merge pull request #34097 from YHNdnzj/journal-browse-prepare
shared/logs-show: introduce journal_browse_prepare()
Daan De Meyer [Thu, 22 Aug 2024 13:59:32 +0000 (15:59 +0200)]
Revert "nspawn: Allow specifying custom init program"
I don't actually need this anymore since we're going with a
unit based approach for the containers stuff internally so
let's just revert it.
Fixes #34085
This reverts commit
ce2291730d5f91190e97e7c515ac772ae4970062.
Daan De Meyer [Thu, 22 Aug 2024 20:20:36 +0000 (22:20 +0200)]
Revert "nspawn: fix settings leak for init parameter"
This reverts commit
1e2aa88bb238299cd982f9e3f14812a6c7211d31.
Mike Yuan [Sat, 17 Aug 2024 17:53:09 +0000 (19:53 +0200)]
shared/logs-show: introduce journal_browse_prepare()
which combines sigbus_install() and bumping fd limit.
Mike Yuan [Sat, 17 Aug 2024 17:40:55 +0000 (19:40 +0200)]
basic/sigbus: use FOREACH_ELEMENT where appropriate, assert >= 0 for success
Mike Yuan [Sat, 17 Aug 2024 16:34:46 +0000 (18:34 +0200)]
logind-session: downgrade user@.service dep to Wants=
This partially reverts
52bcc872b5f97a14a9b4e4e383f45bb3066e1643.
We explicitly support running without user manager,
hence only user-runtime-dir@.service should be
required.
Fixes #33405
Mike Yuan [Fri, 26 Jul 2024 13:31:39 +0000 (15:31 +0200)]
logind: DesignatedMaintenanceTime is added in v257 and constant
Follow-up for
0e10c3d8724b0a5d07871c9de71565ac91dd55b7
Addresses https://github.com/systemd/systemd/pull/25049#discussion_r1647513862
Lennart Poettering [Thu, 22 Aug 2024 16:36:23 +0000 (18:36 +0200)]
main: make sure the ambient caps set is valid in case we fail to read it
We ignore failures when reading this after all. Hence we better leave
the memory properly initialized.
Lennart Poettering [Thu, 22 Aug 2024 16:20:38 +0000 (18:20 +0200)]
main: generate warning when we cannot reset caps
Follow-up for: #32937
Lennart Poettering [Thu, 22 Aug 2024 16:18:41 +0000 (18:18 +0200)]
core: rename original_ambient_set → saved_ambient_set
We call similar other fields in main.c (notably: rlimit stuff, env vars) "saved",
rather than "original". Hence stick to that kind of naming here too.
Follow-up for: #32937
Daan De Meyer [Thu, 22 Aug 2024 13:22:37 +0000 (15:22 +0200)]
mkosi: Update to latest
Should fix the Fedora Rawhide CI failure.
Lennart Poettering [Wed, 21 Aug 2024 08:10:34 +0000 (10:10 +0200)]
man: document .membership files that nss-systemd processes
This has been a glaring omission the docs: when people create
.user/.group/.user-privileged/.group-privileged drop-in files, they
should also create matching .membership files.
Yu Watanabe [Thu, 22 Aug 2024 11:21:33 +0000 (20:21 +0900)]
Merge pull request #34051 from rpigott/resolved-demote-fallback
resolved: demote only the fallback servers in the global scope
Daan De Meyer [Thu, 22 Aug 2024 10:57:07 +0000 (12:57 +0200)]
Merge pull request #34033 from DaanDeMeyer/mkosi-cage
mkosi: Update to latest
Daan De Meyer [Mon, 19 Aug 2024 09:27:26 +0000 (11:27 +0200)]
mkosi: Update to latest
Lennart Poettering [Thu, 22 Aug 2024 08:56:53 +0000 (10:56 +0200)]
Merge pull request #34076 from yuwata/polkit-message
polkit: add missing period in polkit messages
Daan De Meyer [Mon, 19 Aug 2024 09:27:11 +0000 (11:27 +0200)]
mkosi: Improve formatting
Yu Watanabe [Thu, 22 Aug 2024 04:59:55 +0000 (13:59 +0900)]
Merge pull request #34079 from AdrianVovk/sysupdate-fixups
systemd-sysupdated follow-ups
Adrian Vovk [Thu, 22 Aug 2024 02:10:49 +0000 (22:10 -0400)]
sysupdate: man: Cleanup sections about flags
Adrian Vovk [Thu, 22 Aug 2024 01:44:53 +0000 (21:44 -0400)]
sysupdate: Simplify sysupdate_run_simple callsite
Allows the caller to optionally pass in a target, instead of making
everyone call target_get_argument at the call site.
Adrian Vovk [Thu, 22 Aug 2024 01:36:25 +0000 (21:36 -0400)]
sysupdated: Verify inputs more rigorously
Also return better errors
Adrian Vovk [Thu, 22 Aug 2024 01:35:25 +0000 (21:35 -0400)]
sysupdated: Fixup redundant constant name
SD_ stands for systemd, so SD_SYSTEMD_* is SYSTEMD_SYSTEMD_*
Adrian Vovk [Wed, 21 Aug 2024 20:15:24 +0000 (16:15 -0400)]
sysupdated: Fixup minor formatting issues
Yu Watanabe [Wed, 21 Aug 2024 21:43:32 +0000 (06:43 +0900)]
labeler: add more rules
Yu Watanabe [Wed, 21 Aug 2024 22:17:10 +0000 (07:17 +0900)]
Merge pull request #34072 from yuwata/networkd-routing-policy-rule-follow-up
network/routing-policy-rule: follow up for recent change
Yu Watanabe [Wed, 21 Aug 2024 22:10:47 +0000 (07:10 +0900)]
po: update Japanese translations
Yu Watanabe [Wed, 21 Aug 2024 22:08:05 +0000 (07:08 +0900)]
polkit: add missing period in messages
Yu Watanabe [Wed, 21 Aug 2024 20:02:56 +0000 (05:02 +0900)]
po: update Japanese translations
Adrian Vovk [Wed, 21 Aug 2024 19:35:34 +0000 (15:35 -0400)]
Merge pull request #32363 from CodethinkLabs/sysupdate-dbus
sysupdate: Implement dbus service
Yu Watanabe [Wed, 21 Aug 2024 19:34:11 +0000 (04:34 +0900)]
Merge pull request #34053 from YHNdnzj/follow-ups
Two follow-ups for recent PRs
Alyssa Ross [Wed, 21 Aug 2024 12:21:47 +0000 (14:21 +0200)]
bootctl: don't load etc/machine-info from cwd
arg_root defaults to null, so if --root isn't given, this would try reading
etc/machine-info from the current working directory, which is likely to fail.
Fixes:
77db9ef2ab ("boot: Make sure we take --root into account everywhere.")
A. Wilcox [Wed, 21 Aug 2024 14:35:58 +0000 (09:35 -0500)]
man: Ensure notify example includes <string.h>
This ensures that memcpy and strerror are defined. This is especially
important with GCC 14 as implicit function declarations are now an error.
Yu Watanabe [Wed, 21 Aug 2024 17:08:20 +0000 (02:08 +0900)]
hwdb: rename hwdb_bin_paths -> HWDB_BIN_PATHS
We usually use upper letters for constant definitions.
Ivan Shapovalov [Wed, 21 Aug 2024 17:36:08 +0000 (19:36 +0200)]
core/exec-invoke: document calling setpriority() after sched_setattr()
Fixes:
711a157738b ("core/exec-invoke: call setpriority() after sched_setattr()")
Yu Watanabe [Wed, 21 Aug 2024 19:20:51 +0000 (04:20 +0900)]
test-network: also test routing policy rules are configured as expected after reconfiguration
For issue #34068.
Yu Watanabe [Wed, 21 Aug 2024 19:16:09 +0000 (04:16 +0900)]
test-network: find routing policy rule by priority
We usually configure a test rule with a unique priority. Hence, finding
rule by priority reduces the lines of output, and we can debug easily.
Also print short comments on check. That's helpful when the check is
called several times.
Yu Watanabe [Wed, 21 Aug 2024 19:11:52 +0000 (04:11 +0900)]
network/routing-policy-rule: use address family of existing rule when judging if existing rule can be updated
Otherwise, the other RoutingPolicyRule object may not have a valid
address family yet, and the existing rule may be wrongly handled as
that it is not requested by any interface, and it may be removed.
Follow-up for
727235006a7e8904f8493d32376cffa6969c5fa9.
Fixes #34068.
Ronan Pigott [Wed, 21 Aug 2024 14:49:59 +0000 (07:49 -0700)]
resolved: demote the fallback dns servers
This softens the behavior originally introduced in
eded61e410df to apply
only to the fallback dns servers.
The intent is that the global FallbackDNS (instead of DNS) can now be
used in conjunction with the per-link dns, providing a fallback behavior
without introducing a scope overlap.
References:
eded61e410df (resolved: demote the global unicast scope, 2024-08-19)
Ronan Pigott [Tue, 20 Aug 2024 17:25:28 +0000 (10:25 -0700)]
resolved: use the fallback servers when no default dns is configured
This expands the role of fallback servers so they are applied not only
when there are no dns servers configured, but when all the configured
dns servers are configured only for non-default-route links.
Ronan Pigott [Wed, 21 Aug 2024 16:41:35 +0000 (09:41 -0700)]
resolved: introduce link_set_default_route
Ronan Pigott [Wed, 21 Aug 2024 16:36:13 +0000 (09:36 -0700)]
resolved: introduce dns_server_is_fallback
Yu Watanabe [Wed, 21 Aug 2024 16:34:35 +0000 (01:34 +0900)]
Merge pull request #34055 from whot/wip/eviocrevoke-warnings
Update warnings for failed EVIOCREVOKE invocations
Yu Watanabe [Wed, 21 Aug 2024 16:22:29 +0000 (01:22 +0900)]
Merge pull request #34054 from yuwata/network-failed-state
network: several fixlets for reconfiguration after entered failed state
Yu Watanabe [Wed, 21 Aug 2024 06:31:57 +0000 (15:31 +0900)]
networkctl: split networkctl.c into small pieces
No functional change, just refactoring.
Daan De Meyer [Wed, 21 Aug 2024 15:19:09 +0000 (17:19 +0200)]
Merge pull request #33498 from DaanDeMeyer/btrfs
repart: Allow Subvolumes= when running offline
Ronan Pigott [Wed, 21 Aug 2024 13:59:22 +0000 (06:59 -0700)]
Revert "resolved: demote the global unicast scope"
This commit may have been a breaking change for sd-resolved foreign
resolv.conf mode, where a legacy network management daemon directly
modifies resolv.conf and sd-resolved consumes that.
This reverts commit
eded61e410dfa6c16ae68cb624c58122fb18fd0e.
Mike Yuan [Tue, 20 Aug 2024 18:04:46 +0000 (20:04 +0200)]
process-util: always retry with pidfd_spawn() w/o cgroup first
Follow-up for
7ac58157ca67ab001307f1fd72e0cc7c0c4e846a
With the mentioned commit, iff E2BIG we'd retry pidfd_spawn()
with POSIX_SPAWN_SETCGROUP disabled. However, the same strategy
should actually apply to EOPNOTSUPP/ENOSYS/EPERM too -
they can mean two things here: no clone3() or no CLONE_PIDFD.
Therefore, let's first try clone() + CLONE_PIDFD, and fall further back
to plain clone() (posix_spawn()) only as last resort. Plus, record
the fact so that we don't unnecessarily retry every single time
if CLONE_PIDFD is the one that's unavailable.
Mike Yuan [Tue, 20 Aug 2024 20:01:09 +0000 (22:01 +0200)]
process-util: check the flag instead of 'cgroup' param
We might skip CLONE_INTO_CGROUP wholly if not supported.
Mike Yuan [Tue, 20 Aug 2024 10:32:57 +0000 (12:32 +0200)]
man: use standard-options for --no-ask-password everywhere
Daan De Meyer [Wed, 21 Aug 2024 09:25:46 +0000 (11:25 +0200)]
Revert "cgroup-util: Don't try to open pidfd for kernel threads"
The kernel patch was reverted so let's try again to open pidfds
for kernel threads.
This reverts commit
ead48ec35c863650944352a3455f26ce3b393058.
Luca Boccassi [Wed, 21 Aug 2024 10:46:37 +0000 (12:46 +0200)]
Merge pull request #34049 from yuwata/network-routing-policy-rule
network: further rework for routing policy rule
Daan De Meyer [Wed, 26 Jun 2024 18:33:06 +0000 (20:33 +0200)]
repart: Allow Subvolumes= and DefaultSubvolume= when running offline
mkfs.btrfs has recently learned new options --subvol and --default-subvol
so let's stop failing when Subvolumes= and DefaultSubvolume= are used offline
and use the new --subvol and --default-subvol options instead to create subvolumes
in the generated root filesystem without root privileges or loop devices.
Daan De Meyer [Wed, 14 Aug 2024 15:31:30 +0000 (17:31 +0200)]
repart: Don't add same dir to MakeDirectories= or Subvolumes= twice
Daan De Meyer [Thu, 8 Aug 2024 18:16:55 +0000 (20:16 +0200)]
repart: Constify partition_needs_populate()
Daan De Meyer [Wed, 26 Jun 2024 18:32:13 +0000 (20:32 +0200)]
repart: Use loop_device_error_is_fatal() in one more place
Tom Coldrick [Thu, 20 Jun 2024 09:26:24 +0000 (10:26 +0100)]
sysupdate: Add integration test for updatectl updates
Adrian Vovk [Fri, 14 Jul 2023 00:23:12 +0000 (20:23 -0400)]
sysupdate: Implement updatectl
This is the command-line tool to manage systemd-sysudpated
Co-authored-by: Tom Coldrick <thomas.coldrick@codethink.co.uk>
Co-authored-by: Abderrahim Kitouni <abderrahim.kitouni@codethink.co.uk>
Adrian Vovk [Fri, 30 Jun 2023 02:58:41 +0000 (22:58 -0400)]
sysupdate: Implement systemd-sysupdated dbus service
Co-authored-by: Tom Coldrick <thomas.coldrick@codethink.co.uk>
Co-authored-by: Abderrahim Kitouni <abderrahim.kitouni@codethink.co.uk>
Peter Hutterer [Mon, 12 Aug 2024 04:05:13 +0000 (14:05 +1000)]
logind: warn about EVIOCREVOKE errors other than EINVAL too
EINVAL means the kernel doesn't support it, ENODEV means it's
already revoked or the device is no longer there which has the same
effect anyway. All others - let's print an error to the logs.
Yu Watanabe [Wed, 21 Aug 2024 01:47:09 +0000 (10:47 +0900)]
network/ipv4acd: adjust comment and logging
Yu Watanabe [Wed, 21 Aug 2024 01:31:34 +0000 (10:31 +0900)]
sd-dhcp-client: actually restart daemon after sending DECLINE message
client_stop() sets DHCP_STATE_STOPPED to client->state, thus the server
never restarted.
Yu Watanabe [Wed, 21 Aug 2024 01:24:44 +0000 (10:24 +0900)]
sd-dhcp-client: stop client without calling notification after sending RELEASE
Otherwise, even the acquired lease is released, the client may be in
e.g. BOUND state or so, and may send renew or rebind after timeout
later.
Yu Watanabe [Wed, 21 Aug 2024 01:23:06 +0000 (10:23 +0900)]
sd-dhcp-client: refuse to send RELEASE or friends gracefully when the daemon is stopped or so
We can easily hit the assertions without checking the internal states of
the DHCP client before calling these functions. That's annoying.
Let's do more gracefully.
Yu Watanabe [Wed, 21 Aug 2024 02:24:14 +0000 (11:24 +0900)]
sd-dhcp-client: do not call callback with SD_DHCP_CLIENT_EVENT_STOP if already stopped
When an interface enters the failed state, even if the DHCP client is
stopped, the acquired DHCP lease is not unreferenced, as the callback
dhcp4_handler() do nothing in that case. When the failed interface is
being reconfigured after that, the DHCP client is stopped again
(though it is already stopped), and SD_DHCP_CLIENT_EVENT_STOP event is
triggered and sd_dhcp_client_send_release() is called, and the
assertion in the function is triggered.
E.g.
===
systemd-networkd[98588]: wlp59s0: DHCPv4 address 192.168.86.250/24, gateway 192.168.86.1 acquired from 192.168.86.1
systemd-networkd[98588]: wlp59s0: Could not set DHCPv4 route: Nexthop has invalid gateway. Network is unreachable
systemd-networkd[98588]: wlp59s0: Failed
systemd-networkd[98588]: wlp59s0: State changed: configuring -> failed
systemd-networkd[98588]: wlp59s0: The interface entered the failed state frequently, refusing to reconfigure it automatically.
systemd-networkd[98588]: wlp59s0: DHCPv4 client: STOPPED
systemd-networkd[98588]: wlp59s0: DHCPv4 client: State changed: bound -> stopped
systemd-networkd[98588]: Got message type=method_call sender=:1.449 destination=org.freedesktop.network1 path=/org/freedesktop/network1 interface=org.freedesktop.network1.Manager member=ReconfigureLink ...
systemd-networkd[98588]: wlp59s0: State changed: failed -> initialized
systemd-networkd[98588]: wlp59s0: found matching network '/etc/systemd/network/50-wifi.network'.
systemd-networkd[98588]: wlp59s0: Configuring with /etc/systemd/network/50-wifi.network.
systemd-networkd[98588]: wlp59s0: DHCPv4 client: STOPPED
systemd-networkd[98588]: Assertion 'sd_dhcp_client_is_running(client)' failed at src/libsystemd-network/sd-dhcp-client.c:2197, function sd_dhcp_client_send_release(). Aborting.
===
Yu Watanabe [Tue, 20 Aug 2024 22:07:05 +0000 (07:07 +0900)]
network: log and enter failed state in link_reconfigure()
No functional change, just refactoring.
Yu Watanabe [Tue, 20 Aug 2024 22:01:47 +0000 (07:01 +0900)]
network: enter initialized state when the interface will be reconfigured
When the interface is in the failed state, link_getlink_handler_internal()
will do nothing and return zero, thus the interface will not be
reconfigured, especially when the reconfiguration is triggered in
link_enter_failed().
Follow-up for
c2eb7753dd47ec04ae0d66400e70bc87fbf1adcc.
Yu Watanabe [Tue, 20 Aug 2024 22:17:19 +0000 (07:17 +0900)]
network: introduce reconfigure_data_free() and _freep()
No functional change, just refactoring.
Yu Watanabe [Tue, 20 Aug 2024 17:05:22 +0000 (02:05 +0900)]
Merge pull request #34018 from yuwata/network-address-label
network: allow to configure IPv6 address label in networkd.conf
Kornilios Kourtis [Thu, 15 Aug 2024 15:22:35 +0000 (17:22 +0200)]
process-util: handle pidfd_spawn() returning E2BIG
In some kernels (specifically, 5.4) even though the clone3 syscall is
supported, setting CLONE_INTO_CGROUP is not. The error message returned
in this case is E2BIG.
If posix_spawn_wrapper encounters this error, it does not retry, and
cannot spawn any programs in said kernels.
This commit adds a check for the E2BIG error and retries pidfd_spawn()
without the POSIX_SPAWN_SETCGROUP flag.
If we encounter an E2BIG error, and the pidfd_spawn() succeeds after
removing the POSIX_SPAWN_SETCGROUP flag, then we cache the result so
that we do not retry every time.
Originally, this issue was reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=
1077204.
Signed-off-by: Kornilios Kourtis <kornilios@gmail.com>
Daan De Meyer [Tue, 20 Aug 2024 12:39:45 +0000 (14:39 +0200)]
tests: Don't override QemuKvm= value if TEST_NO_KVM=0
Let's disable KVM if TEST_NO_KVM=1 is set but let's not specify anything
if it's not set so the QemuKvm= setting from mkosi.conf is used.
Yu Watanabe [Tue, 20 Aug 2024 01:33:42 +0000 (10:33 +0900)]
test-network: add test for ManageForeignRoutingPolicyRules=
Yu Watanabe [Tue, 20 Aug 2024 01:07:10 +0000 (10:07 +0900)]
test-network: add tests for Type=table, goto, and nop
Yu Watanabe [Tue, 20 Aug 2024 11:56:35 +0000 (20:56 +0900)]
test-network: do not pass '[detached]' to 'ip rule del'
That indicates the interface name in 'iif' or 'oif' cannot be resolved
when 'ip rule' command is invoked. That's natural when networkd fail to
remove rule but the corresponding interface is already removed.
To make not the residual rules interfere subsequent test cases, let's
ignore the flag and actually remove unwanted rules.
Yu Watanabe [Mon, 19 Aug 2024 20:16:53 +0000 (05:16 +0900)]
network/routing-policy-rule: support all known type of rule
This also adds GoTo= to specify the target priority of goto rule.
Note, table was the default but could not be specified in Type=.
Yu Watanabe [Mon, 19 Aug 2024 22:00:44 +0000 (07:00 +0900)]
network/routing-policy-rule: also manage remaining attributes
Currently, these attributes are not configured by us, but there may be a
existing rule created by user manually with one of these attribute.
To correctly manage such foreign rules, let's read these attributes.
Yu Watanabe [Mon, 19 Aug 2024 21:56:53 +0000 (06:56 +0900)]
sd-netlink: introduce sd_netlink_message_read_u64()
Yu Watanabe [Mon, 19 Aug 2024 21:19:46 +0000 (06:19 +0900)]
network/routing-policy-rule: remove rules that have conflicting flags
The kernel does not distinguish rules with different flags in
rule_exists(), but the flags of an existing rule cannot be updated.
Let's remove rules that have conflicting flags, and configure new rules
later with requested flags.
Yu Watanabe [Mon, 19 Aug 2024 19:11:19 +0000 (04:11 +0900)]
network/routing-policy-rule: anyway detach rule even when we fail to remove it
When we fail to remove a rule, that mostly means the rule does not exist
in the kernel anymore, e.g. already removed manually and we have not
received notification about that yet.
Let's detach the rule in that case.
Yu Watanabe [Mon, 19 Aug 2024 19:02:46 +0000 (04:02 +0900)]
network/routing-policy-rule: do not save rule to Manager before it is configured
Otherwise, if we fail to configure the rule, then the manager will keep
nonexistent rule forever. So, let's first copy the rule and put it on
Request, then on success generate a new copy based on the netlink
notification and store it to Manager.
This is the same as
0a0c2672dbd22dc85d660e5baa7e1bef701beb88, but for
routing policy rule.
Yu Watanabe [Mon, 19 Aug 2024 18:56:33 +0000 (03:56 +0900)]
network/routing-policy-rule: skip requesting when rule is already requested
If it is already requested, the new request will be anyway silently refused by
link_queue_request_safe(), which returns 0 in such case. Let's return earlier.
There should be no functional change, just refactoring.
Yu Watanabe [Sat, 17 Aug 2024 04:33:35 +0000 (13:33 +0900)]
network/address-label: allow to configure IPv6 address label in networkd.conf
Closes #23159.
Yu Watanabe [Sat, 17 Aug 2024 04:04:03 +0000 (13:04 +0900)]
network/queue: introduce manager_queue_request_full()
Currently it is not used, but will be used later.