Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe 4d05a19c95 bootctl: honour architecture when updating boot loaders (#37913)
Fixes: #33413
Follow-up for: #30418
2025-06-21 02:25:17 +09:00
Yu Watanabe 73e95bcca0 logind inhibitor code fixes (#37907)
Fixes: #35565
2025-06-21 02:09:52 +09:00
Yu Watanabe 6e272b5f20 resolved: enforce RefuseRecordTypes= also in proxy mode (#37902)
Fixes: #36491
2025-06-20 05:59:24 +09:00
Yu Watanabe 1b675afdbd Several assorted cleanups (#37888) 2025-06-20 00:58:48 +09:00
Yu Watanabe 68650ed391 test-bpf-firewall: use ASSERT_XYZ() and bpf_program_pin() 2025-06-19 19:08:45 +09:00
Yu Watanabe cef4ec347f ioprio-util: move from basic/ to shared/
It is not used by libsystemd.
2025-06-19 19:08:45 +09:00
Yu Watanabe d26faa3186 missing_network: IPPROTO_MPTCP is already defined in linux/in.h
And the header is already included through (our implementation of)
netinet/in.h, hence we can safely drop the definition here.
2025-06-19 19:08:45 +09:00
Yu Watanabe 92b64168f6 sd-lldp: replace ETHERTYPE_LLDP with ETH_P_LLDP
ETH_P_LLDP is defined in linux/if_ether.h.
2025-06-19 19:08:45 +09:00
Yu Watanabe dbfe2faa48 port write_env_file() to label_os_pre() + teach firstboot a bit of relabelling (#37869)
This is a clean-up, and also addresses some of the points of #37857.
2025-06-19 18:03:12 +09:00
Yu Watanabe 079a135eee test-cpu-set-util: use ASSERT_XYZ() macros 2025-06-18 16:36:14 +01:00
Yu Watanabe 43aacae83a dirent-util: use getdents64() as is
This partially reverts e86a492ff0.

The function getdents64() was introduced in glibc-2.30, and our baseline
on glibc is 2.31. Hence, we can assume the function always exists.
The posix_getdents() wrapper was introduced for compatibility with musl.
However, even the latest release of musl does not provide posix_getdents()
yet. Also, even with musl, by defining _LARGEFILE64_SOURCE, we can get
getdents64() and struct dirent64. Hence, the wrapper is anyway not
necessary.
2025-06-18 10:45:49 +02:00
Yu Watanabe abb99d3168 mallinfo-util: assume mallinfo() exists
The check existed for musl. Let's remove it, as we explicitly request glibc.

While removing the check, this also drops generic_mallinfo, introduces
a tiny converter from struct mallinfo to struct mallinfo2 if mallinfo2()
does not exist, and renames mallinfo-util.h to malloc.h.

With this change, we can drop many ifdefs and casts in .c files.
2025-06-18 10:45:27 +02:00
Yu Watanabe 2c7f35b144 sd-lldp: several improvements (#37845)
This makes
- sd-lldp-tx not send machine ID as chassis ID, but use application
specific machine ID,
- sd-lldp-tx emit vlan ID if it is running on a vlan interface,
- Describe() DBus method also reply LLDP configurations,
- io.systemd.Network.GetLLDPNeighbors varlink method provides vlan ID,
if received.

Closes #37613.
2025-06-18 04:58:04 +09:00
Yu Watanabe 9d5f05ae22 bus-util: coding style cleanups
- replace `type *func()` -> `type* func()`,
- rename arguments for storing results.
2025-06-18 01:55:46 +09:00
Yu Watanabe 31a1e15ccb sd-bus: coding style cleanups
- replace `type *func()` -> `type* func()`,
- rename arguments for storing results,
- add several missing assertions.
2025-06-18 01:54:07 +09:00
Yu Watanabe 8cec3cbeb1 sd-bus: BusMessageContainer.begin is always zero in sd_bus_message_open_container() 2025-06-18 01:54:07 +09:00
Yu Watanabe e08fdfdd7d test-network: compare LLDP sender and receiver information 2025-06-18 01:51:19 +09:00
Yu Watanabe f0a05209f9 network: also include information about LLDP sender in reply for Describe() method
Addresses https://github.com/systemd/systemd/pull/37845#issuecomment-2973257825.
2025-06-18 01:51:19 +09:00
Yu Watanabe b6f96f635f sd-lldp-tx: introduce sd_lldp_tx_describe() to dump current settings 2025-06-18 01:51:16 +09:00
Yu Watanabe aeac400d1b boot: fix typo
Follow-up for cab9c7b5a4.
2025-06-18 01:47:49 +09:00
Yu Watanabe 4c45437b60 sd-lldp-rx: also dump received MUD URL 2025-06-18 00:53:24 +09:00
Yu Watanabe 2da3957b63 network/lldp-tx: also emit VLAN ID 2025-06-18 00:53:24 +09:00
Yu Watanabe 898513783e sd-lldp-tx: allow to emit VLAN ID 2025-06-18 00:53:24 +09:00
Yu Watanabe 0597109ddf sd-lldp-tx: append capabilities before MUD URL
No functional change, but let's append vendor specific informations
after others to sort the TLVs with their type.
2025-06-18 00:53:24 +09:00
Yu Watanabe 27546b769c sd-lldp-tx: do not expose machine ID by default
Previously, systemd-networkd sent machine ID as chassis ID.
Let's use application specific machine ID.

This is a kind of backward compat breaking. Hence, this also introduces
the support of $SD_LLDP_SEND_MACHINE_ID environment variable.

Closes #37613.
2025-06-18 00:53:20 +09:00
Yu Watanabe 75e638671c Update distro packaging commits (#37765) 2025-06-17 04:46:44 +09:00
Yu Watanabe 65f20d58f4 resolve: several further fixes for reloading config (#37856)
Fixes #37843.
2025-06-17 00:23:56 +09:00
Yu Watanabe a4eb5094e6 terminal-util: fix doubled 'to' in log messages
Follow-up for 3390be38d1.
2025-06-16 22:25:27 +09:00
Yu Watanabe 888e3f4357 TEST-75-RESOLVED: add test case for reloading DNSStubListenerExtra= 2025-06-16 22:04:52 +09:00
Yu Watanabe 752cdf5051 manager: also restart stub listner on reload
Previously, the extra stub listners were stopped but new ones were not
started. Also, the main stub listners were not restarted, hence the
new settings were not applied. This fixes the above two issues.

Note, to fix the issue, we need to keep CAP_NET_BIND_SERVICE capability
to make it allow to bind stub listner later.

Fixes #37843.
2025-06-16 22:02:30 +09:00
Yu Watanabe 9ed99b0793 resolve: several cleanups for manager_dispatch_reload_signal()
- set defaults after all existing configs and setups cleared,
- mention failures are ignored in log messages,
- drop one redundant log message,
- do not return negative errno but exit event loop on critical failure.
2025-06-16 22:02:30 +09:00
Yu Watanabe 872603b583 resolve: several cleanups for manager_new()
- mention the error is ignored in the log message,
- drop redundant log message, as dnssd_load() logs on failure,
- voidify manager_load_delegates().
2025-06-16 22:02:30 +09:00
Yu Watanabe 450a4edfc3 resolve: coding style fix 2025-06-16 22:02:30 +09:00
Yu Watanabe 5d5edcd3f4 resolve: fix indentation 2025-06-16 22:02:30 +09:00
Yu Watanabe 18d79a7f9c network/tunnel: several cleanups for Mode= setting and make sit and ipip tunnel support it (#37853)
Closing #37377.
2025-06-16 20:07:38 +09:00
Yu Watanabe 312e3835ee test-network: add tests for tunnel mode 2025-06-16 17:01:37 +09:00
Yu Watanabe fe94aa316d network/tunnel: make sit and ipip tunnel support Mode= setting
Closing #37377.
2025-06-16 17:01:20 +09:00
Yu Watanabe 8424a70caf network/tunnel: rename Ip6TnlMode to TunnelMode
This also makes ip6tnl can be created without specifying Mode= setting,
as the kernel accepts new-link netlink message without the
IFLA_IPTUN_PROTO attribute.

No effective functional change, just refactoring and preparation for
later change.
2025-06-16 16:58:38 +09:00
Yu Watanabe ce5a54ed9b test-network: add test case for issue #37714
I cannot reproduce the issue with the current git HEAD.
Let's add a test case that is used by the reporter of the issue.
2025-06-15 09:33:23 +09:00
Yu Watanabe 5509fa8450 NEWS: mention PersistLeases=runtime in [DHCPServer] 2025-06-14 03:53:10 +09:00
Yu Watanabe b5610d6360 network: use PersistLeases=runtime on container/VM/namespace network interfaces
Follow-up for 9ccc369ff3.

Then, we can safely restart networkd or reconfigure the interface.
2025-06-14 03:46:24 +09:00
Yu Watanabe 009d64dddd test-network: add test case for PersistLeases=runtime 2025-06-14 03:42:24 +09:00
Yu Watanabe a145343b90 network/dhcp-server: save and load leases in runtime directory when PersistLeases=runtime
With 9ccc369ff3, PersistLeases= is
disabled on the host side virtual interfaces for containers.

However, even it is not necessary to save the leases for containers
on a persistent storage, still we should save them on somewhere.
Otherwise, leases will be lost when networkd on the host is restarted
or the host side interface is reconfigured.

This introduce PersistLeases=runtime to save and load leases on runtime
storage.
2025-06-14 03:41:20 +09:00
Yu Watanabe 98b02dd7e7 sd-dhcp-server: reopen fd only when it is valid
Fixes a bug in 11b88419ae.
2025-06-14 02:53:31 +09:00
Yu Watanabe 7ce370c466 network: hash_ops related fixlets (#37832)
Fixes #37830.
2025-06-14 02:51:08 +09:00
Yu Watanabe 2c154c54e1 network: use dns_name_hash_ops_free to manage domains 2025-06-14 00:17:14 +09:00
Yu Watanabe 38de38a70d ordered-set: introduce ordered_set_put_strdup_full() and friends which take hash ops 2025-06-14 00:06:43 +09:00
Yu Watanabe 6ffc16dfd9 network: use the same hash ops used when allocated
Fixes #37830.
2025-06-13 23:46:29 +09:00
Yu Watanabe a7deadd763 udev/rules.d: import hwdb before calling net_id builtin
The commit cdcb1eeeb8 adds
ID_NET_NAME_INCLUDE_DOMAIN property support in net_id builtin.
The property is basically set through hwdb. However, previously hwdb was
imported after calling net_id builtin, hence when net_id is called, the
property was never set.

This makes hwdb is imported before calling net_id builtin, so that the
property is set when net_id is called if hwdb has an entry about that
for the interface.

Follow-up for cdcb1eeeb8.
Fixes #37758.
2025-06-13 10:43:21 +01:00
Yu Watanabe d3b7e63068 network/dhcpv4: add ability to use BOOTP (#34888)
BOOTP can be used to sign a static IP to clients. Instead of using the
four message exchange, and Option 53 (DHCP Message Type) there is only a
two message exchange.

Add the following network option to enable BOOTP:

[DHCPv4]
BOOTP=yes

This will allow a two message request / reply sequence that doesn't
require DHCP message types.

Fixes: #34885
2025-06-13 17:12:19 +09:00
Yu Watanabe 1f87275736 network/dhcp4: release previously acquired DHCP lease when BOOTP will be enabled 2025-06-13 14:15:04 +09:00
Yu Watanabe 98a9b0f92a sd-dhcp-client: move comment to relevant place 2025-06-13 13:35:21 +09:00
Yu Watanabe 556f641fb5 dhcp: several coding style cleanups
- rename arguments for storing results,
- reorder arguments to move ret_xyz at the end,
- add several missing assertions.
2025-06-13 13:35:21 +09:00
Yu Watanabe 984ae058dc discover-image: several cleanups around image_discover() (#37813) 2025-06-13 07:57:28 +09:00
Yu Watanabe d604341ca5 sysext: drop unnecessary struct MethodListParameters 2025-06-13 05:13:54 +09:00
Yu Watanabe 361b13ca7e include/linux: update kernel headers from v6.16-rc1 2025-06-12 16:04:40 +01:00
Yu Watanabe 78f8d5ed71 network: also check ID_NET_MANAGED_BY property on reconfigure
Previously, the property was checked only when an uevent is received,
so even if an interface has ID_NET_MANAGED_BY property, the interface
will be configured by networkd when reconfiguration is triggered e.g.
when interface state is changed.

Follow-up for ba87a61d05.
Fixes #36997.
2025-06-12 14:24:50 +09:00
Yu Watanabe a954c1945b test-network: improve bonding tests (#37808) 2025-06-12 14:24:03 +09:00
Yu Watanabe 050d6599ed network: use up_or_down() at several more places 2025-06-11 17:16:08 +01:00
Yu Watanabe 624d369868 discover-image: make image_discover() allocate hashmap when necessary 2025-06-11 22:45:08 +09:00
Yu Watanabe d654b9dcfd discover-image: coding style fixlets 2025-06-11 22:45:08 +09:00
Yu Watanabe b52d575845 machinectl: use _RUNNER_MAX rather than ELEMENTSOF() 2025-06-11 22:41:54 +09:00
Yu Watanabe 093b025548 machinectl: align table 2025-06-11 22:41:54 +09:00
Yu Watanabe 6f5958c74d man/machinectl: underscore is not allowed in machine name
Fixes #27481.
2025-06-11 22:41:53 +09:00
Yu Watanabe c6aae2cd8a test-network: add test case for issue #32186
The reporter said that the issue is caused by BindCarrier=, but
I cannot reproduce it. Anyway, let's test it.
2025-06-11 17:32:46 +09:00
Yu Watanabe 8882519583 test-network: read the current link flags of bond interface
Follow-up for 2700d2c7dc.
2025-06-11 17:18:43 +09:00
Yu Watanabe 114ad16c4d login: drop unnecessary dependency to libacl
With c960ca2be1, logind does not handle
ACL anymore, but triggers events for udevd and udevd updates ACL.
Hence, libacl is not necessary for logind.
2025-06-11 09:18:54 +02:00
Yu Watanabe 5814acca9a resolve: exit from loop for transactions when transactions has been regenerated
Fixes #37458.
2025-06-10 17:30:03 +01:00
Yu Watanabe 75f8298770 Two coding style fixlets (#37799) 2025-06-10 15:28:51 +09:00
Yu Watanabe bdf42d9fd4 sysusers: always initialize ret_xyz when write_temporary_xyz() succeed
No functional change. Just for following our coding style.
2025-06-10 12:57:01 +09:00
Yu Watanabe 58bb08be6d dirent-util: follow our coding style 2025-06-10 12:57:01 +09:00
Yu Watanabe 4081e072ee Several follow-ups for recent header cleanups (#37785) 2025-06-10 01:01:05 +09:00
Yu Watanabe 169d270e81 meson: update generating lists
- config.h is not necessary when generating lists, hence drop it.
- linux/audit.h and libaudit.h are included by missing_audit.h,
  hence not necessary to include them explicitly.
2025-06-09 16:29:49 +01:00
Yu Watanabe afe1567297 include: net/if.h requires features.h
The header uses __THROW, which is defined in features.h, to make the
header self-consistent.
Note, src/basic/include/sys/mount.h also uses __THROW, and includes
features.h.
2025-06-09 22:45:23 +09:00
Yu Watanabe 8139906eaa journal: use poll.h rather than sys/poll.h
This does not change anything, as poll.h is a one-line wrapper of sys/poll.h.
Note that man pages e.g. poll(2) indicate to include poll.h rather than sys/poll.h.
So, let's use poll.h.
2025-06-09 22:45:23 +09:00
Yu Watanabe b5aed60222 selinux-setup.c: drop redundant inclusion of selinux/selinux.h
The header is anyway included by selinux-util.h in below.
2025-06-09 22:45:23 +09:00
Yu Watanabe f37b4031f8 tree-wide: drop unnecessary inclusion of sys/quota.h
As it is included by quota-util.h anyway.
2025-06-09 22:45:23 +09:00
Yu Watanabe e11f01b78a utmp-wtmp: replace _PATH_WTMPX -> WTMPX_FILE
_PATH_WTMPX is a kind of internal definition in glibc, and
WTMPX_FILE should be an exposed definition. Both are same,
let's use WTMPX_FILE.
Note, for utmp, we use UTMPX_FILE, rather than _PATH_UTMPX.
Let's use consistent macros.
2025-06-09 22:45:23 +09:00
Yu Watanabe afcb6d671b forward: also include paths.h
It provides several important constants, especially _PATH_BSHELL, which
is used in PID1, executor, and run. The header has been included
indirectly through e.g. libmount.h, mntent.h, utmpx.h, and so on.
Let's explicitly include it in forward.h, as libmount.h and friends that
includes paths.h are irrelevant to _PATH_BSHELL, and we may easily fail
to build when code is touched.
The header is not heavy, hence should not hurt anything.
2025-06-09 22:45:23 +09:00
Yu Watanabe a60495c44b cryptsetup-util: move definition of crypt_token_max()
As it uses streq(), but string-util.h is not included in the header.
2025-06-09 22:45:23 +09:00
Yu Watanabe 14dc330c9c libcrypt-util: include random-util.h
Necessary for crypto_random_bytes(), which is used in the branch that
HAVE_CRYPT_GENSALT_RA is false. Unfortunately, our CIs tested only the
other branch.
2025-06-09 22:45:23 +09:00
Yu Watanabe 6c12289fc8 meson: fix doubled # before include
Follow-up for b5337d1d52.
2025-06-09 10:20:54 +01:00
Yu Watanabe b5bd717fcd test: extend timeout and enable generating debugging logs
Not sure why the test failed, but maybe the test environment is too
slow? Even this does not fix the failure, by enabling debugging logs,
this hopefully provides more useful information for debugging.

For issue #37685.
2025-06-06 19:43:32 +01:00
Yu Watanabe c928defc08 run: ignore bus connection error in acquiring invocation ID (#37763)
This introduce bus_error_is_connection(), and use it where applicable.
Then, this makes connection errors in acquiring invocation ID by
systemd-run handled gracefully, like we already do other places.

Fixes #37675.
2025-06-07 01:55:21 +09:00
Yu Watanabe 6c2558a2fc tree-wide: allow building with -Wgnu-variable-sized-type-not-at-end option for clang (#37499)
Follow-up for #36993.
Closes #37497.
2025-06-07 01:02:38 +09:00
Yu Watanabe eb09b4b546 run: ignore bus connection error in acquiring invocation ID
Similar to 2b983b43c6, but for acquiring
invocation ID.

Fixes #37675.
2025-06-07 00:01:15 +09:00
Yu Watanabe 687a92a1b6 sd-device: replace '!' with '/' before calling sd_device_new_from_subsystem_sysname()
Device ID uses device directory name as is, hence may contain '!', but
sd_device_new_from_subsystem_sysname() expects that the input is sysname.
So, we need to replace '!' with '/'.

Follow-up for 1393c5a2a4.
Fixes #37711.
2025-06-06 23:59:02 +09:00
Yu Watanabe ac004f4cc9 tree-wide: introduce bus_error_is_connection() and use it where applicable 2025-06-06 21:42:25 +09:00
Yu Watanabe f2a8cc943d sd-lldp-rx: add VLAN ID parsing (#37725)
While the `port_vlan_id` field was already present in the
`sd_lldp_neighbor`, it wasn't currently parsed from the LLDP packet.
Added support for that as well as a small parsing test.

Closes #28354.
2025-06-06 19:12:48 +09:00
Yu Watanabe b1bfa60254 TODO: drop completed entry 2025-06-06 19:09:49 +09:00
Yu Watanabe 44875628ff systemctl: replace basename() with path_extract_filename() 2025-06-06 19:06:48 +09:00
Yu Watanabe 59829bb37a delta: rework how enumerate files 2025-06-06 19:06:48 +09:00
Yu Watanabe eefcf8de64 core: adding CGroup for io.systemd.Unit.List (second PR) (#37646)
This PR adds CGroup context/runtime for io.systemd.Unit.List method.

This is follow up for https://github.com/systemd/systemd/pull/37432.
2025-06-06 06:07:35 +09:00
Yu Watanabe 3b1850d906 Bugprone argument comment 10 (#37755)
Follow up from https://github.com/systemd/systemd/pull/37712
2025-06-06 06:07:05 +09:00
Yu Watanabe 23f9ff4724 ptyfwd: introduce pty_forward_set_window_title() helper function 2025-06-05 19:06:02 +09:00
Yu Watanabe 356e9bc018 test-network: extend comments how to run the test 2025-06-04 16:46:41 +01:00
Yu Watanabe b21483720c Several follow-ups for userdb lookup from udevd and networkd (#37719) 2025-06-04 23:32:24 +09:00
Yu Watanabe ca783b43b8 doc: tweaks to root storage daemon docs (#37727) 2025-06-04 22:34:28 +09:00
Yu Watanabe 6e47959685 Bugprone argument comment 9 (#37712)
Follow up from https://github.com/systemd/systemd/pull/37678
2025-06-04 22:33:51 +09:00
Yu Watanabe a4dae8e42f Revert "github/mkosi: tentatively disable mkosi(opensuse) job"
This reverts commit 48a092afbb.
2025-06-04 21:54:37 +09:00