Commit Graph
88907 Commits
Author SHA1 Message Date
Yu Watanabe acdaee339f test-dhcp-client: add test cases for discover attempt counter 2026-05-17 15:20:29 +09:00
Yu Watanabe 115c354b57 test-dhcp-client: add test cases for IPv6-only mode 2026-05-17 15:20:29 +09:00
Yu Watanabe 7df9210283 test-dhcp-client: add test case for BOOTP client mode 2026-05-17 15:20:29 +09:00
Yu Watanabe 9bd6b949d3 test-dhcp-client: add test case for INIT-REBOOT sequence 2026-05-17 15:20:29 +09:00
Yu Watanabe f7c144b9c7 test-dhcp-client: add test case for rapid commit mode 2026-05-17 15:20:24 +09:00
Yu Watanabe 3eba8d6265 test-dhcp-client: add test case for anonymized mode 2026-05-17 15:18:41 +09:00
Yu Watanabe 385cd74fca test-dhcp-client: rewrite the test by using sd_dhcp_message
More test cases will be added later.
2026-05-17 04:13:47 +09:00
Yu Watanabe 33c6d10749 sd-dhcp-client: allow to set socket fd externally
It will be used by the unit test and fuzzer for the DHCP client.
Preparation for later changes.
2026-05-17 04:13:47 +09:00
Yu Watanabe f2169cfe8e sd-dhcp-lease: coding style cleanups
Rename function arguments for storing results, and accept NULL for
them. Also, adjust the position of asterisk.
2026-05-17 04:13:47 +09:00
Yu Watanabe cec4d5e673 sd-dhcp-client: two tiny cleanups (#42129) 2026-05-17 04:16:32 +09:00
Yu Watanabe 5768f1dd6f Final batch of conversions to option and verb macros (#42127) 2026-05-17 03:50:48 +09:00
Yu Watanabe bd3bbacd24 sd-dhcp-client: drop unused legacy code (#42128) 2026-05-17 03:42:29 +09:00
Zbigniew Jędrzejewski-Szmek d512d3c6d3 treewide: get rid of remaing getopt/getopt_long stuff 2026-05-16 18:37:12 +02:00
Zbigniew Jędrzejewski-Szmek 39a3647539 tree-wide: get rid of old dispatch_verb
Also rename dispatch_verb_with_args to dispatch_verb.
2026-05-16 18:37:10 +02:00
Zbigniew Jędrzejewski-Szmek 40fed88f8e test-verbs: dispatch via _dispatch_verb_with_args() directly
Drops the global-optind dependency from the test helper. Verb fixtures
stay inline as static const Verb[] — the section-based VERB() macro
would force unique verb names across the three test cases, which they
deliberately share to exercise overlap.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek e934c6209a veritysetup: convert verbs to VERB macros
Place VERB() declarations above each dispatch function and use
verbs_get_help_table() in help(). run() switches to
dispatch_verb_with_args(); the argv_looks_like_help() shortcut is
preserved since this is an internal tool with no proper option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 65f83b0352 update-utmp: convert verbs to VERB macros
There is no --help implemented, so both verbs don't get help strings.
We should probably add --help + --version, and a proper description
of the program, but I'm leaving that for later.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 062f6892b3 integritysetup: convert verbs to VERB macros
Place VERB() declarations above each dispatch function and use
verbs_get_help_table() in help() so the command listing stays in sync.
run() switches to dispatch_verb_with_args(); the argv_looks_like_help()
shortcut is preserved since this is an internal tool with no proper
option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 1bf6be01c0 backlight: convert verbs to VERB macros
Place VERB() declarations directly above each dispatch function and use
verbs_get_help_table() in help() so the command listing stays in sync.
run() switches to dispatch_verb_with_args(); the argv_looks_like_help()
shortcut is preserved since this is an internal tool with no proper
option parsing.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 59db1f482a dissect: convert the other parser to option macros 2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 59ce15c406 storagectl: convert run_as_mount_helper to OPTION macros
This is the util-linux mount-helper interface (mount.storage), so all
options stay hidden via help=NULL — they are not user-facing. The
namespace "mount.storage" is distinct from the storagectl namespace
used for the user-facing CLI.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-16 18:36:08 +02:00
Zbigniew Jędrzejewski-Szmek 8bc7cf64d1 udev: drop leftover includes of getopt.h
Not sure why those were left and why clang-tidy didn't complain.
2026-05-16 18:36:08 +02:00
Yu Watanabe ff32569f2a sd-dhcp-client: set TOS and socket priority by default
Also this renames sd_dhcp_client_set_service_type() to _set_ip_service_type().
2026-05-17 01:34:44 +09:00
Yu Watanabe e7c550895a sd-dhcp-client: split out setting anonymize parameter
No effective functional change. Just refactoring.
2026-05-17 01:33:43 +09:00
Zbigniew Jędrzejewski-Szmek cf88903637 tree-wide: get rid of most uses of ALIGN_PTR
This bothered me for a while, but I didn't think too much about it and just
copied the existing usage pattern. But it really doesn't make sense. We expect
the compiler to align the section properly. But if it didn't align it, applying
alignment after the fact would just cause our pointer to point to the middle
of the structure. That'd be even worse than a misaligned pointer.

Similarly, when doing pointer arithmetic, p++ should really result in a value
with the appropriate alignment. This is the basic principle of C pointer
addition. So we really shouldn't try to adjust the pointer ourselves. At most,
we can assert that it is indeed aligned in tests.
2026-05-16 18:32:14 +02:00
Yu Watanabe 4095391bd6 dhcp-packet: drop unused dhcp_packet_verify_headers() 2026-05-17 01:31:43 +09:00
Yu Watanabe 4d1779a7c5 sd-dhcp-lease: drop several more unused functions and conditions 2026-05-17 01:31:43 +09:00
Yu Watanabe c63c262875 sd-dhcp-lease: drop unused dhcp_lease_save() and dhcp_lease_load()
They are not used anymore. Let's kill them.
2026-05-17 01:31:42 +09:00
Yu Watanabe ad350e6ecf network: drop serialization of DHCP lease
No one use it now anymore. Let's drop it.
2026-05-17 01:31:42 +09:00
Yu Watanabe 7f2c6185fe networkctl: always use DHCP message serialized in JSON desciption
Now the interface description by networkd always contains DHCP message
(of course when there is a bound DHCP lease). Let's use it.
2026-05-17 01:31:42 +09:00
Yu Watanabe c5bcbb4c85 network: drop unmet conditions
Now sd_dhcp_lease object always wraps sd_dhcp_message object, hence we
can unconditionally use it.
2026-05-17 01:31:42 +09:00
Yu Watanabe b2e64f53b7 sd-dhcp-client: use new message parser (#42123)
In 26b7c5ff3b, we introduced a new parser
for received DHCP message, but it was not used at that time. This PR
replaces the legacy parser with the new one, and makes the fuzzer also
use the new parser.
2026-05-17 00:33:43 +09:00
Zbigniew Jędrzejewski-Szmek d71c1e7d89 Convert machinectl to option and verb macros (#42117) 2026-05-16 17:18:10 +02:00
Zbigniew Jędrzejewski-Szmek 3b37439afb machinectl: convert to OPTION and VERB macros
For the shell verb we want switches specified after the program name to
be passed to the program to execute, not processed by us. Mirror the
approach in 'userdbctl ssh-authorized-keys': start with
OPTION_PARSER_RETURN_POSITIONAL_ARGS, then lates switch to
STOP_AT_FIRST_NONOPTION for "shell" or NORMAL otherwise.

VERB declarations are placed directly above each function; functions
that dispatch multiple verb names get stacked VERB() declarations.
chainload_importctl() now takes the args strv instead of relying on the
global optind.

--help output is mostly the same.
--no-pager/--no-legend/--no-ask-password/-q/--quiet are now at the end.
bind-volume/unbind-volume are documented.

Fixes c9f461a806.

Co-developed-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 15:59:15 +02:00
Zbigniew Jędrzejewski-Szmek cab5c5ef81 shared/verbs: add VERB_DEFAULT_NOARG 2026-05-16 15:54:18 +02:00
Yu Watanabe 8de24db5de sd-dhcp-client: do not trigger assertion when running on interface with small MTU
This also drops spurious default value. If mtu is unset, now the correct
default value is set in client_new_message() in dhcp-client-send.c.
2026-05-16 22:34:25 +09:00
Yu Watanabe 1a0f2c1fb2 sd-dhcp-client: drop unnecessary T1/T2 adjustment logic
It is already done in client_parse_ack() -> dhcp_lease_new_from_message().
2026-05-16 22:34:25 +09:00
Yu Watanabe de079ebc04 sd-dhcp-lease: drop unused dhcp_lease_unref_and_replace() 2026-05-16 22:34:25 +09:00
Yu Watanabe 0435151bc8 sd-dhcp-client: use dhcp_client_parse_message()
This also unify two IO event source handlers.
2026-05-16 22:34:25 +09:00
Yu Watanabe fcf2de89bb fuzz-dhcp-client: fuzz dhcp_client_parse_message()
Also, if the fuzzing engine provides a valid message, then try to build
json variant and UDP payload from the parsed message. We will drop
dhcp_lease_save() and dhcp_lease_load(), hence the tests for them are
dropped.
2026-05-16 22:34:25 +09:00
Yu Watanabe 6ae696a956 socket-util: extend the buffer in sockaddr_union to make it consistent with hw_addr_data
Concerned by Claude:
https://github.com/systemd/systemd/pull/42119#discussion_r3251133516
2026-05-16 22:33:40 +09:00
Yu Watanabe 8fe6094450 dhcp-message: introduce dhcp_message_send_{udp,raw}() 2026-05-16 22:33:00 +09:00
Daan De Meyer a0a6a614ce network: preparation for using serialized DHCP message in Describe() method (#42122) 2026-05-16 14:17:58 +02:00
Fco. Javier F. Serrador 980e4132ac po: Translated using Weblate (Spanish)
Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Fco. Javier F. Serrador <fserrador@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/es/
Translation: systemd/main
2026-05-16 13:16:50 +01:00
Luca Boccassi c043b90187 Revert "shared/pager: add support for more(1) pager in secure mode" 2026-05-16 09:38:25 +09:00
Yu Watanabe ace3a7b500 udev,sd-device: drop old database support (#40801)
Closes #40776.
2026-05-16 08:26:16 +09:00
Yu Watanabe c0e40b14ad networkctl: load information about DHCP client from varlink
By the previous commit, networkd now exposes the received DHCP message
in the Descibe() DBus/Varlink method. Let's make networkctl deserialize
the DHCP message and use it where necessary.
2026-05-16 08:05:01 +09:00
Yu Watanabe 29e221c9e6 network: append DHCP message in json output
Also, get private options from sd_dhcp_message object if sd_dhcp_lease
has it.

With this change, networkctl will be able to use the serialized DHCP
message object. Preparation for later changes.
2026-05-16 08:05:01 +09:00
Yu Watanabe 26b7c5ff3b sd-dhcp-lease: introduce dhcp_client_parse_message()
It parses a received DHCP message and create corresponding sd_dhcp_lease
object for the message. Internally, it uses sd_dhcp_message object.

Note, the new parser is not used yet. The currently used one will be
replaced in later commit.
2026-05-16 08:04:45 +09:00
Yu Watanabe f39c071f31 dhcp-client-send: introduce dhcp_client_send_message()
This internally uses sd_dhcp_message object, and replaces functions
for creating and sending DHCP messages.

By using sd_dhcp_message internally, now we can correctly send long
(> 255 bytes) option data that cannot be fit in a single DHCP option TLV.

This also fixes the value in DHCP option 57 (Maximum Message Size).
Previously the IP and UDP header size is subtracted from the interface
MTU, but it should not.

Except for the above, this should not change any effective behaviors.
2026-05-16 08:03:15 +09:00