Commit Graph
100 Commits
Author SHA1 Message Date
Yu Watanabe 5aa172e263 dbus-exporter: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe a5d54f52d6 check-version-history: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:47 +09:00
Yu Watanabe 53172028c8 check-efi-alignment: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 0965c5d719 catalog-report: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe ce9b618e46 analyze-dump-sort: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe b27bd1a399 TEST-69-SHUTDOWN: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 81b1f3dd9f test-udev: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe f8a3f9d135 test-tmpfiles: apply "ruff format" and "ruff check --fix"
This also dropped unnecessary existence check for subprocess.run.
2026-05-18 02:44:46 +09:00
Yu Watanabe 6e4c7f91f9 test-shutdown: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 1b94d7d7ec test-network: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 59199ec3bd test-network: drop old ip command support 2026-05-18 02:44:46 +09:00
Yu Watanabe 9c0c203db4 test-network: assume the test is running with newer udevd 2026-05-18 02:44:46 +09:00
Yu Watanabe cbc2990335 test-network: drop old kernel support and workaround for fixed kernel bug
- l3mdev in fib rules is supported since
https://github.com/torvalds/linux/commit/96c63fa7393d0a346acfe5a91e0c7d4c7782641b (v4.8).
- uid range in fib rules is supported since
https://github.com/torvalds/linux/commit/622ec2c9d52405973c9f1ca5116eb1c393adfc7d (v4.10).
- port range and ip proto in fib rules is supported since
https://github.com/torvalds/linux/commit/bfff4862653bb96001ab57c1edd6d03f48e5f035 (v4.17).
- interface alternative name is supported since
https://github.com/torvalds/linux/commit/36fbf1e52bd3ff8a5cb604955eedfc9350c2e6cc (v5.5).
- SRIOV on netdevsim is supported since
https://github.com/torvalds/linux/commit/79579220566cd33fe3b15ce8249c57e10251b258 (4.16).
- nexthop is supported since
https://github.com/torvalds/linux/commit/65ee00a9409f751188a8cdc0988167858eb4a536 (v5.3).
- bridge MDB entries on bridge master is supported since
https://github.com/torvalds/linux/commit/1bc844ee0faa1b92e3ede00bdd948021c78d7088 (v5.4).
2026-05-18 02:44:46 +09:00
Yu Watanabe 124bbf37de sys-script: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 87c0cf15fe sd-script: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe d89d23bc8f run-unit-tests: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 2c73e5b973 rule-syntax-check: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe ba90ffaef2 networkd-test: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe f6b2a27e59 TEST-04-JOURNAL: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe a562d59fd9 generate-directives: apply "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 8fd2385709 create-sys-script: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 58aa8824f3 test_ukify: apply "ruff format"
Also drops unnecessary noqa attribute for importing pefile.
2026-05-18 02:44:46 +09:00
Yu Watanabe d86df93f96 generate-syscall-list: apply "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 246e4594ed generate-dns_type: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 4084459014 ethtool-link-mode: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe cd7bb96049 log-generator: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe b0a06e2a81 generate-syscall: apply "ruff format" and "ruff check --fix"
Also, this makes opened files closed when not necessary.
2026-05-18 02:44:46 +09:00
Yu WatanabeandJörg Behrmann c5abf64d37 fuzz-bootspec: apply "ruff format"
This also replaces open().read() with Path().read_text().

Co-authored-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
2026-05-18 02:44:46 +09:00
Yu Watanabe a89c11b672 filesystem-sets: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 4758d1f71a man/notify-example: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 5481961700 man/check-os-release: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 14848f1f71 man/check-os-release-simple: apply "ruff format" 2026-05-18 02:44:46 +09:00
Yu Watanabe 522fdd7d96 man/90-rearrange-path: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:46 +09:00
Yu Watanabe 4fa9302fa4 hwdb/parse_hwdb: apply "ruff format" and "ruff check --fix" 2026-05-18 02:44:40 +09:00
Yu Watanabe 1c98dff834 hwdb/ids_parser: apply "ruff format" and "ruff check --fix" 2026-05-18 02:32:42 +09:00
Yu Watanabe a3dc3dc61b hwdb/acpi-update: apply "ruff format" 2026-05-18 02:32:42 +09:00
Yu Watanabe f74118be4f ycm: apply "ruff format" and "ruff check --fix" 2026-05-18 02:32:42 +09:00
Yu Watanabe 75f7304512 ruff: do not warn about too long line and lambda assignment 2026-05-18 02:32:42 +09:00
Yu Watanabe c54decc406 ruff: use single quotes for multiline strings 2026-05-18 02:32:39 +09:00
Yu Watanabe aa0f03eb03 networkctl: introduce 'dhcp-lease' command to dump acquired DHCP lease (#42137) 2026-05-18 01:28:11 +09:00
Yu Watanabe ba22984544 sd-dhcp-client: use dhcp_message_send_{udp,raw}() and update BPF code (#42138) 2026-05-18 01:26:55 +09:00
Yu Watanabe a72f23d2b8 sd-dhcp-client: drop unused data in sd_dhcp_client
With the previous commit, now sd_dhcp_client.link is not used anymore.
Let's drop it.
2026-05-17 22:44:17 +09:00
Yu Watanabe 0c69b24741 dhcp-client-send: move/update BPF code and socket initialization from dhcp-network.c
- BPF code now supports the case when IP header has IP packet options,
- also set socket priority to UDP socket.

Co-developed-by: Google Gemini Pro
2026-05-17 22:44:17 +09:00
Yu Watanabe 89cf6d81f7 dhcp-client-send: use dhcp_message_send_{udp,raw}() 2026-05-17 22:44:17 +09:00
Yu Watanabe ddd535a424 NEWS: mention new 'networkctl dhcp-lease' command 2026-05-17 21:03:55 +09:00
Yu Watanabe 6cbf8222ca networkctl: add dhcp-lease verb to dump DHCP lease
This shows the DHCP message of an acquired DHCP lease.
Example:
```
$ networkctl dhcp-lease eth0
Header:
              KEY VALUE
   Hardware Type: ETHER
Hardware Address: 41:42:43:31:32:33
  Client Address: 192.0.2.123
  Server Address: 192.0.2.1

Options:
CODE NAME               DATA
   1 subnet mask        255.255.255.0
   3 router             192.0.2.1
   6 domain name server 192.0.2.1
  12 hostname           test-node
  15 domain name        lan
  28 broadcast address  192.0.2.255
  42 NTP server         192.0.2.11
                        192.0.2.12
  51 lease time         1d
  53 message type       5
  54 server identifier  192.0.2.1
  58 renewal time       11h 5min 38s
  59 rebinding time     20h 5min 38s
 119 domain search      hoge.example.com
                        foo.example.com
```
2026-05-17 21:02:20 +09:00
Yu Watanabe 9022ccc219 dhcp: cleanups for sd-dhcp-lease.c and rewrite test-dhcp-client (#42135) 2026-05-17 20:12:37 +09:00
Yu Watanabe 149adb2fdc dhcp-message-dump: introduce dump_dhcp_message()
It dumps DHCP messages in a human friendly format.
It will be used in networkctl in a later commit.
2026-05-17 20:09:47 +09:00
Yu Watanabe a192c67630 ci/alpine: do not install util-linux-login
For some reasons, after util-linux is bumped from 2.41.4-r0 to 2.42-r0,
the 'su' command from util-linux-login seems to not correctly run commands in
https://github.com/jirutka/setup-alpine/blob/v1.4.1/alpine.sh
and causes the following spurious failure:
```
2026-05-15T21:19:15.6539432Z ##[group]Set up user runner
2026-05-15T21:19:15.6981963Z /bin/sh: line 0: ��: not found
2026-05-15T21:19:15.6982503Z /bin/sh: line 1: ␡ELF␂␁␁␃: not found
2026-05-15T21:19:15.6985788Z /bin/sh: line 10: ␒␐␆␒B␈␒�␄␒y␄␒�␁␒␞␇␒:␁␒�␃␒�␄␒@␁␒9␈␒?␆␒␚␈␒x: not found
2026-05-15T21:19:15.7010731Z /bin/sh: line 33: can't open ␂␒-␂␒�: no such file
2026-05-15T21:19:15.7016026Z /bin/sh: line 33: syntax error: unexpected word (expecting ")")
2026-05-15T21:19:15.7049583Z
2026-05-15T21:19:15.7050199Z ␛[1;31mError occurred at line 338:␛[0m
2026-05-15T21:19:15.7050830Z   335 | 		echo 'permit nopass keepenv $SUDO_USER' | tee /etc/doas.d/root.conf
2026-05-15T21:19:15.7051287Z   336 | 	fi
2026-05-15T21:19:15.7051549Z   337 | SHELL
2026-05-15T21:19:15.7052039Z ␛[1;31m> 338 | abin/"$INPUT_SHELL_NAME" --root /.setup.sh␛[0m
2026-05-15T21:19:15.7052506Z   339 |
2026-05-15T21:19:15.7052796Z   340 | rm .setup.sh
2026-05-15T21:19:15.7053172Z   341 | endgroup
2026-05-15T21:19:15.7096322Z ##[error]Error occurred at line 338: abin/"$INPUT_SHELL_NAME" --root /.setup.sh (see the job log for more information)
2026-05-15T21:19:15.7101400Z ##[error]Process completed with exit code 1.
```
Let's not install the package. It seems no command provided by the
package is used.
2026-05-17 10:56:34 +01:00
Yu Watanabe 335ac4a71d fuzz-dhcp-client: externally set socket fd, rather than override functions 2026-05-17 15:20:29 +09:00
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 cec4d5e673 sd-dhcp-client: two tiny cleanups (#42129) 2026-05-17 04:16:32 +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 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
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
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
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
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
Yu Watanabe 206f0391a6 varlink: MethodNotImplemented: drop extraneous dot; vl_error_MethodNotFound: an method (#42112) 2026-05-16 05:10:38 +09:00
Yu Watanabe c5997b2bbf dhcp-message: allow to serialize/deserialize sd_dhcp_message object
By using this, we can expose received DHCP message in Describe()
DBus/Varlink methods. Preparation for later change.
2026-05-15 14:23:58 +02:00
Yu Watanabe 3b64024464 udev/node: drop support of old file format in /run/udev/links/
The new file format in /run/udev/links/ has been introduced in
377a83f0d8 (v250, released on 2021-12-23).
Let's drop the old format support, to simplify the logic.
2026-05-15 13:47:45 +02:00
Yu Watanabe dfe0e81de6 udev/watch: use mapping from device ID -> watch on restart
The mapping from device ID to watch handle has been introduced by
e7f781e473 (v249, released on 2021-07-07).
Let's drop the runtime upgradability of udevd from an ancient version.
2026-05-15 13:47:45 +02:00
Yu Watanabe 1fdcf3ee40 sd-device: drop support of udev database version 0
The udev database versioning has been introduced in v247, which is
released on 2020-11-26.
Let's drop the support of old udev database.
2026-05-15 13:47:45 +02:00
Yu Watanabe bbf69974a8 TODO: fix typo 2026-05-15 15:33:11 +09:00
Yu Watanabe c33a9eb858 sd-journal: update comments 2026-05-15 15:04:02 +09:00
Yu Watanabe f795ecc3d7 A few more conversions of options and verbs (#41795)
I had those prepared before but I didn't submit them because the
automatic layout didn't work well. In two cases now the sync of widths
between verbs and options is disabled and one case is left with the
automatic alignment. I think it'd good enough to merge.
2026-05-15 02:47:23 +09:00
Yu Watanabe a7c76ceaef meson: don't use Python module for host Python (#41959)
Checking for pefile required that module to be made available for the
Python used to build systemd, even though it's only used at runtime,
potentially via a different Python installation.

Furthermore, Meson's Python module doesn't do the right thing when cross
compiling and looking up a Python for the host system, so this would end
up uselessly checking whether the build Python had the pefile module,
which is not needed. Even if it were made to check the host Python using
find_program, it still relies on being able to run its Python, which in
a cross scenario it probably wouldn't be able to do.

All in all, this check does more harm than good, and prevents building
ukify in valid configurations, so remove it.
2026-05-15 00:38:19 +09:00
Yu Watanabe d6c79c13ff Implement Socket Context/Runtime for io.systemd.Unit.List (#42057)
The PR implements the following objects + tests for
io.systemd.Unit.List:
- SocketContext
- Socket Runtime

It's a continuation of the following PRs:

* https://github.com/systemd/systemd/pull/37432
* https://github.com/systemd/systemd/pull/37646
* https://github.com/systemd/systemd/pull/38032
* https://github.com/systemd/systemd/pull/38212
* https://github.com/systemd/systemd/pull/39391
* https://github.com/systemd/systemd/pull/41980
2026-05-14 23:29:47 +09:00
Yu Watanabe 7e612d5c15 dhcp-message: introduce dhcp_message_get_option_dnr()
This is for DHCP option 162 (DNR).
2026-05-13 09:41:24 +09:00
Yu Watanabe 64846d9d8a dhcp-message: introduce dhcp_message_{append,get}_option_6rd()
These are for DHCP option 212 (6rd).
2026-05-13 09:41:24 +09:00
Yu Watanabe ff9d98423c dhcp-message: introduce dhcp_message_{append,get}_option_routes()
These are for DHCP options 33 (static route), 121 (classless static
route), and 249 (private classless static route).
2026-05-13 09:41:24 +09:00
Yu Watanabe 08249b359b dhcp: move definition of sd_dhcp_route and related functions to dhcp-route.[ch]
This also renames arguments for storing results.
No functional change, just refactoring and preparation for later commits.
2026-05-13 09:41:24 +09:00
Yu Watanabe e178adc6e1 dhcp-message: add SIP server option support
The DHCP option 120 (SIP server) option takes a list of addresses or
domain names, and the first byte in the data classifies which type is
stored. Let's extend _addresses() and _domains() to make them support
the SIP server option.
2026-05-13 09:41:24 +09:00
Yu Watanabe c588c31144 dhcp-message: introduce dhcp_message_get_option_domains()
This is for e.g. DHCP option 119 (domain search).
2026-05-13 09:41:24 +09:00
Yu Watanabe 295a4dd6ed dhcp-message: introduce dhcp_message_{append,get}_option_length_prefixed_data()
This is for e.g. User Class option.
2026-05-13 09:41:24 +09:00