Yu Watanabe
c1062559a9
Merge pull request #34307 from yuwata/linux-more-network-headers
...
linux: import more network headers
2024-09-09 19:33:14 +09:00
Yu Watanabe
ef32235db1
Merge pull request #34067 from LukeShu/lukeshu/nspawn-fuse
...
nspawn: enable FUSE in containers
2024-09-09 19:32:16 +09:00
Yu Watanabe
85fd8df03d
missing_socket: drop unnecessary definitions
...
Now, we have copy of vm_sockets.h, hence these definitions are not
necessary anymore.
2024-09-09 14:52:18 +09:00
Yu Watanabe
47a71f9852
missing_network: drop unnecessary definition
...
Now we have ipv6.h, hence the definition is not necessary anymore.
2024-09-09 14:52:18 +09:00
Yu Watanabe
0ca88780d6
arphrd-list: use imported linux/if_arp.h
2024-09-09 14:52:18 +09:00
Yu Watanabe
a84649592c
linux: import more network related headers from v6.11-rc6
...
Hopefully, no effective change.
2024-09-09 14:52:18 +09:00
Yu Watanabe
a9987de62c
NEWS: fix typo
...
Follow-up for 7a3a49386c .
2024-09-07 22:26:24 +09:00
Yu Watanabe
c8f2409574
man/varlinkctl: fix typo
...
Follow-up for 39ce86d19c .
2024-09-07 22:24:58 +09:00
Yu Watanabe
14a499ed77
network/route: fix typo
...
Follow-up for 195bb6f97e .
2024-09-07 22:22:44 +09:00
Yu Watanabe
5573e067d0
Merge pull request #34295 from poettering/uki-with-many-ukify
...
ukify: add multi-profile UKI support
2024-09-07 08:08:48 +09:00
Yu Watanabe
195bb6f97e
network/route: ignore EEXIST reply when the corresponding request is already detached
...
Follow-ups for db8dc7c1dd .
Fixes #34275 .
2024-09-06 16:07:25 +09:00
Yu Watanabe
204529d0fc
tree-wide: check if non-empty password is acquired
2024-09-06 15:00:32 +09:00
Yu Watanabe
623a8b1922
ask-password: refuse empty password strv
...
Fixes #34270 .
2024-09-06 14:58:46 +09:00
Yu Watanabe
20040416e9
sd-netlink: fix typo
...
Fixes #34273 .
2024-09-06 07:37:13 +02:00
Yu Watanabe
efedb6b0f3
nspawn: refuse to bind mount device node from host when --private-users= is specified
...
Also do not chown if a device node is bind-mounted.
Fixes #34243 .
2024-09-06 13:28:17 +09:00
Yu Watanabe
48878074d6
test: add test cases for --volatile= with -U
...
For issue #34254 .
2024-09-06 13:24:36 +09:00
Yu Watanabe
025be2361b
nspawn: only remount /usr/ with idmap when --volatile=yes
...
The root directory is already mounted with a picked UID shift, hence
it is not necessary to remount with idmap. However, /usr/ is a bind-mount,
hence it must be remounted with idmap.
With this change, now '-U --volatile=yes' works fine.
Fixes #34254 .
2024-09-06 13:24:12 +09:00
Yu Watanabe
2c2511aa73
nspawn: mount /var/ after remount_idmap() when --volatile=state
...
Previously, remount_idmap() failed as /var/ was already mounted, thus
remounting (strictly speaking, unmounting old root directory) failed
with -EBUSY.
As tmpfs /var/ is mounted with picked UID shift, it should not be
remounted with idmap, but needs to be mounted after the root directory
being remounted.
This makes '-U --volatile=state' work as expected.
2024-09-06 13:22:26 +09:00
Yu Watanabe
21cd84df69
nspawn: use strv_extend() and friends to build directories passed to remount_idmap()
...
No functional change, just refactoring and preparation for later change.
2024-09-06 13:13:15 +09:00
Yu Watanabe
31a9aedf03
test: fix copy-and-paste error in comment
2024-09-06 13:10:19 +09:00
Yu Watanabe
0e40a26341
nspawn: fix indentation
2024-09-06 13:10:04 +09:00
Yu Watanabe
fe7a126ce8
base-filesystem: use FOREACH_ELEMENT()
2024-09-06 13:09:36 +09:00
Yu Watanabe
dd86e6c45c
mount-util: wrap long line
2024-09-06 13:09:36 +09:00
Yu Watanabe
74fe65480c
Merge pull request #34203 from yuwata/network-conf-parser
...
network: several cleanups for conf parser
2024-09-06 13:07:39 +09:00
Yu Watanabe
03ec7311f1
Merge pull request #34267 from DaanDeMeyer/script
...
mkosi: Install util-linux-script on Rawhide
2024-09-06 10:43:04 +09:00
Yu Watanabe
dd1de202d7
network/address: use log_section_warning()
2024-09-06 10:38:57 +09:00
Yu Watanabe
c6f2197fcf
network/address: use generic section parser more
...
This also
- rename variable n -> address,
- use log_syntax_parse_error() where applicable,
- add one more assertion for lvalue in config_parse_address().
2024-09-06 10:38:15 +09:00
Yu Watanabe
6cf41d4603
network/address: introduce generic config parser for [Address] section
...
Then, use generic conf parsers defined in conf-parser.[ch].
2024-09-06 10:37:23 +09:00
Yu Watanabe
174c5c5f06
firewall-util: several cleanups for config_parse_nft_set()
...
- use log_syntax_parse_error(),
- return 1 on success,
- drop unnecessary or redundant assertions,
- add missing log_oom().
2024-09-06 10:35:02 +09:00
Yu Watanabe
ff616da459
conf-parser: introduce config_parse_uint32_invert_flag()
...
It is similar to config_parse_uint32_flag(), but drops the specified flag
when true.
2024-09-06 10:35:02 +09:00
Yu Watanabe
c2e8e1f020
network: align table in network-gperf
2024-09-06 10:35:02 +09:00
Yu Watanabe
e208fad798
network/address-label: use log_section_warning_errno()
2024-09-06 10:35:02 +09:00
Yu Watanabe
934cf1c06b
network/address-label: introduce generic conf parser for [IPv6AddressLabel] section
...
This also
- renames n -> label,
- use log_syntax_parse_error().
No functional change, just refactoring.
2024-09-06 10:34:53 +09:00
Yu Watanabe
152b8a4e71
conf-parser: introduce config section parser wrapper
...
It will be used later.
2024-09-06 10:33:05 +09:00
Yu Watanabe
b9f208643b
timesync: make manager_is_connected() static
2024-09-06 10:21:07 +09:00
Yu Watanabe
c58f4100cc
timesync: downgrade log level about network configuration change
...
These message may be unnecessarily shown multiple times when e.g.
networkd is restarted, system is wakeup from suspend, and so on.
Closes #34262 .
2024-09-06 10:20:48 +09:00
Yu Watanabe
ccd62e6d4d
Merge pull request #34155 from poettering/gmtime-safe
...
handle gmtime_r() errors more robustly
2024-09-06 09:07:48 +09:00
Yu Watanabe
a00006861b
Merge pull request #34261 from yuwata/repart-seed-random
...
repart: initialize seed earlier
2024-09-06 08:30:12 +09:00
Yu Watanabe
fe6049d021
test: fix indentation
2024-09-05 18:01:42 +09:00
Yu Watanabe
56d6ebd404
test: add test case for systemd-repart --seed=random
...
For issue #34257 .
2024-09-05 18:01:42 +09:00
Yu Watanabe
b8a8000aba
repart: initialize seed earlier
...
As the seed is used by context_load_partition_table() -> derive_uuid().
Fixes #34257 .
2024-09-05 15:49:24 +09:00
Yu Watanabe
8d78191a46
man: ARP=no also disables IPv6 Neighbor Discovery Protocol
...
Addresses https://github.com/systemd/systemd/issues/18063#issuecomment-2323410288 .
2024-09-05 10:20:18 +09:00
Yu Watanabe
3ce22ee7f8
Merge pull request #34090 from DaanDeMeyer/cow-fix
...
Rework COW <=> NOCOW copying behavior
2024-09-05 10:19:49 +09:00
Yu Watanabe
c47f2a26b0
test: add test cases of "systemctl cat" for nonexistent units
2024-09-05 10:08:03 +09:00
Yu Watanabe
1306567a40
Merge pull request #34212 from YHNdnzj/recvmsg-safe-trunc
...
tree-wide: handle MSG_TRUNC with recvmsg_safe()
2024-09-05 07:22:28 +09:00
Yu Watanabe
cdf006973d
resolve: fix typo
...
Follow-up for 67d0ce8843 .
2024-09-03 14:00:18 +09:00
Yu Watanabe
4edbea7de2
pretty-print: introduce WITH_BUFFERED_STDERR macro to enable buffering
...
Then, the buffer will be flushed and buffering will be disabled on
exiting from the scope.
2024-09-03 09:34:50 +09:00
Yu Watanabe
b9e4b2c569
pretty-print: rename {draw,clear}_progress_bar_unbuffered() -> {draw,clear}_progress_bar_impl()
...
Addresses https://github.com/systemd/systemd/pull/34205#discussion_r1739648525 .
Follow-ups for 5f9dd9c64d .
2024-09-03 09:06:18 +09:00
Yu Watanabe
a833dc9b35
Merge pull request #34140 from yuwata/conf-parser-log-message
...
conf-parser: introduce log_syntax_parse_error() and use it
2024-09-03 08:20:07 +09:00
Yu Watanabe
304e2419c7
network/tclass: do not save tclass to Link before it is configured
...
Otherwise, if the same kind of tclass is already assigned, parameters
configured in .network file will not be used. So, let's first copy the
tclass and put it on Request, then on success generate a new copy based
on the netlink notification and store it to Link.
This is the same as 0a0c2672db ,
65f5f58156 , and friends, but for tclass.
2024-09-02 14:12:49 +09:00
Yu Watanabe
0a35458f5e
network/qdisc: do not save qdisc to Link before it is configured
...
Otherwise, if the same kind of qdisc is already assigned, parameters
configured in .network file will not be used. So, let's first copy the
qdisc and put it on Request, then on success generate a new copy based
on the netlink notification and store it to Link.
This is the same as 0a0c2672db ,
65f5f58156 , and friends, but for qdisc.
Preparation for fixing #31226 .
2024-09-02 14:12:49 +09:00
Yu Watanabe
3d7f26d9f2
network/tclass: make tclass_drop() static
...
This also drops unused constant return value.
2024-09-02 14:12:49 +09:00
Yu Watanabe
4a31c768a9
network/qdisc: make qdisc_drop() static
...
This also drops unused constant return value.
2024-09-02 14:12:49 +09:00
Yu Watanabe
e3f91033ae
network/tclass: skip requesting tclass if it is already requested
2024-09-02 14:12:49 +09:00
Yu Watanabe
998973e313
network/qdisc: skip requesting qdisc if it is already requested
2024-09-02 14:12:49 +09:00
Yu Watanabe
4bdc3d85ae
network/neighbor: skip requesting neighbor if it is already requested
2024-09-02 14:12:37 +09:00
Yu Watanabe
541d0ed20a
network/tclass: introduce tclass_ref() and tclass_unref()
...
No functional change, just refactoring and preparation for later change.
2024-09-02 14:12:35 +09:00
Yu Watanabe
9b294afa2d
network/qdisc: introduce qdisc_ref() and qdisc_unref()
...
No functional change, just refactoring and preparation for later change.
2024-09-02 14:12:35 +09:00
Yu Watanabe
6f12cb91bc
conf-parser: use log_syntax_parse_error() and friends more
...
This also makes all conf parsers defined in conf-parser.c return 1
on success, 0 on non-critical error.
Also, use free_and_strdup_warn() where applicable.
2024-09-02 06:17:05 +09:00
Yu Watanabe
3c8dc3a3e0
conf-parser: several cleanups for DEFINE_CONFIG_PARSE_ENUMV() macro
...
- use GREEDY_REALLOC() and FOREACH_ARRAY(),
- do not set an array with only terminating 'invalid' value.
Note, this macro is only used by parsing NamePolicy= and AlternativeNamesPolicy=
in .link files. and udevd correctly handles both an empty array and an
array with only 'invalid'. Hence, this does not change any behavior.
2024-09-02 06:11:50 +09:00
Yu Watanabe
42efe5be1d
tree-wide: drop msg argument for DEFINE_CONFIG_PARSE() macro and friends
...
This makes the macros use log_syntax_parse_error(), hopefully which provides
more informative log message in general, and reduces binary size.
2024-09-02 05:45:09 +09:00
Yu Watanabe
382886fe11
log: protect errno from log_syntax_invalid_utf8_internal()
...
Potentially, utf8_escape_invalid() called by
log_syntax_invalid_utf8_internal() may update errno.
2024-09-02 05:45:09 +09:00
Yu Watanabe
1e04eb00f7
log: introduce log_syntax_parse_error()
...
This provides generic error message for failures in conf parsers.
Currently this is not used, but will be used later.
2024-09-02 05:45:04 +09:00
Yu Watanabe
b043f651c8
test: modernize test-networkd-conf
2024-09-02 05:41:55 +09:00
Yu Watanabe
7094e6d9e4
test: modernize test-conf-parser.c
2024-09-02 05:41:55 +09:00
Yu Watanabe
c33aacdcb4
conf-parser: make config_parse_strv() stricter and optionally drop duplicated entries
2024-09-02 05:41:55 +09:00
Yu Watanabe
8b4ef777fd
conf-parser: fix memleak in config_parse_calendar()
...
Fixes a bug introduced by 0e10c3d872 (#25049 ).
2024-09-02 05:41:55 +09:00
Yu Watanabe
9afb4aea00
network/route: fix typo
...
Follow-up for c8dbf9acc1 .
2024-09-01 22:03:12 +09:00
Yu Watanabe
c8dbf9acc1
network/route: fix adjustment of nexthop weight
...
Fixes #34167 .
2024-09-01 11:54:32 +09:00
Yu Watanabe
db8dc7c1dd
network/route: also update source, status, and so on EEXIST
...
Otherwise, an existing route may be labeled as foreign even after we
reconfigure it.
2024-09-01 11:54:32 +09:00
Yu Watanabe
0074a7d8c0
network/route: also show weight of gateway in debugging logs
2024-09-01 11:54:32 +09:00
Yu Watanabe
7876f3d63a
test-network: use the same MTU bytes for veth interfaces
...
Hopefully fixes #34204 .
2024-08-31 11:24:56 +01:00
Yu Watanabe
94c80f3ef5
labeler: set network label when tests for networkd or friends are updated
2024-08-31 11:54:13 +02:00
Yu Watanabe
6434d0bbf7
Merge pull request #34198 from AdrianVovk/updatectl-bugfixes
...
updatectl: Bugfixes
2024-08-31 15:20:15 +09:00
Yu Watanabe
3722db214b
man: fix typo
...
Follow-up for 1ff0164be5 .
2024-08-31 11:19:15 +09:00
Yu Watanabe
7571cb42a8
Merge pull request #34189 from poettering/cryptenroll-slot-fix
...
cryptenroll: don't return slot 0 when we have no policy to search for
2024-08-31 04:26:02 +09:00
Yu Watanabe
16d70515e1
hwdb: add entry for Dell AlpsPS/2 ALPS DualPoint TouchPad
...
Closes #34133 .
2024-08-30 09:37:52 +02:00
Yu Watanabe
c5d5d76988
test: add test for GetUnitByPID() D-Bus method
...
For issue #34104 .
2024-08-29 14:16:43 +01:00
Yu Watanabe
ee9a70ccc7
Merge pull request #34160 from weblate/weblate-systemd-main
...
Translations update from Fedora Weblate
2024-08-29 07:54:03 +09:00
Yu Watanabe
9f563bcd74
Merge pull request #34123 from yuwata/sd-device
...
sd-device: expose sd_device_get_device_id() and sd_device_get_driver_subsystem()
2024-08-28 11:33:09 +09:00
Yu Watanabe
29d41efd44
Merge pull request #34139 from yuwata/sd-device-monitor
...
sd-device-monitor: introduce sd_device_monitor_get_events() and _get_timeout()
2024-08-28 11:32:51 +09:00
Yu Watanabe
5ab1250534
sd-device-monitor: introduce sd_device_monitor_get_events() and _get_timeout()
...
Follow-up for bab889c51e (#33032 ).
Currently, they unconditionally returns EPOLLIN and USEC_INFINITY, respectively.
Just for consistency with sd-bus, sd-journal, sd-varlink, and so on. All
they have _get_fd(), _get_events(), and _get_timeout().
Closes #34094 .
2024-08-28 05:35:07 +09:00
Yu Watanabe
d36d71cade
test: use more suitable assertions
2024-08-28 05:35:07 +09:00
Yu Watanabe
bbb7a0e6ed
sd-varlink: make the argument type consistent with header
2024-08-28 05:35:07 +09:00
Yu Watanabe
3fe0fd20c9
udevadm/info: also show driver subsystem and device ID
...
This adds two more fields in 'udevadm info':
- J for device ID, e.g. b128:1, c10:1, n1, and so on.
- B for driver subsystem, e.g. pci, i2c, and so on.
These, especially the device ID field may be useful to find udev
database file under /run/udev/data for a device.
2024-08-28 05:26:26 +09:00
Yu Watanabe
cd7c71154c
sd-device: make sd_device_new_from_subsystem_sysname() stricter
...
As workarounded by fc0cbed2db , the pair of
subsystem and sysname is not unique. For examples,
- /sys/bus/gpio and /sys/class/gpio, both have gpiochip%N. However, these point to different devpaths.
- /sys/bus/mdio_bus and /sys/class/mdio_bus,
- /sys/bus/mei and /sys/class/mei,
- /sys/bus/typec and /sys/class/typec, and so on.
Let's refuse to provide sd_device object in such cases.
2024-08-28 05:26:08 +09:00
Yu Watanabe
1ff0164be5
sd-device: make device_get_device_id() public
...
We have already exposed sd_device_new_from_device_id(), but we have
never provide the way to get device ID from an existing sd_device
object.
2024-08-28 05:26:04 +09:00
Yu Watanabe
44bc6f3cab
sd-device: introduce sd_device_get_driver_subsystem()
...
To create the sd_device object of a driver, the function
sd_device_new_from_subsystem_sysname() requires "drivers" for subsystem
and e.g. "pci:iwlwifi" for sysname. Similarly, sd_device_new_from_device_id()
also requires driver subsystem. However, we have never provided a
way to get the driver subsystem ("pci" for the previous example) from
an existing sd_device object.
Let's introduce a way to get driver subsystem.
2024-08-28 05:18:14 +09:00
Yu Watanabe
55e35a4d59
sd-device: refuse earlier when too long ifname is passed to sd_device_new_from_ifname()
...
Otherwise, alloca() called in strjoina() may trigger assertion.
This partially reverts 3652891c39 .
The commit mistakenly dropped the check.
2024-08-28 05:18:14 +09:00
Yu Watanabe
1937f5105d
sd-device: make sd_device_get_devtype() return 0 on success again
...
This partially reverts the commit 730b76bd2c .
Before the commit, the function returned 0 on success, but the commit
made the function always return 1, as if device->devtype is NULL, the
function returns -ENOENT in the above.
Fortunately, udev_device_get_devtype() does not propagate any
non-negative value from sd_device_get_devtype(). Hence, hopefully we can
safely revert the change.
2024-08-28 05:18:14 +09:00
Yu Watanabe
44eee910c0
Merge pull request #34124 from YHNdnzj/socket-accept-name
...
core: honor FileDescriptorName= too for Accept=yes sockets, plus several other cleanups
2024-08-27 12:11:20 +09:00
Yu Watanabe
57bdb24f9d
NEWS: mention "resolvconf -p"
2024-08-27 05:42:34 +09:00
Yu Watanabe
80e038221b
test: add more test cases for resolvconf
2024-08-27 05:37:34 +09:00
Yu Watanabe
374825ec05
resolvconf: disable default route when -p is specified
...
Internally, the switch triggers 'resolvectl default-route INTERFACE no'.
Closes #34112 .
2024-08-27 05:30:06 +09:00
Yu Watanabe
189cb2b15f
resolvconf: clear domains if nothing specified
2024-08-27 05:23:12 +09:00
Yu Watanabe
b3102c05e1
resolvectl: make enum name consistent with the option name
2024-08-27 05:17:52 +09:00
Yu Watanabe
36f6e87dd3
man: reword about default route for DNS traffic
...
DefaultRoute is a D-Bus property, not a valid setting name in .network
files nor resolved.conf.
Whether a link is the default route or not is configured with
DNSDefaultRoute= setting in .network files.
2024-08-26 11:14:26 +01:00
Yu Watanabe
b1fc342cdd
Merge pull request #34120 from weblate/weblate-systemd-main
...
Translations update from Fedora Weblate
2024-08-25 21:28:53 +09:00
Yu Watanabe
605377e7b3
network/routing-policy-rule: use config_parse_routing_policy_rule() more
...
Then, we can drop allocation of RoutingPolicyRule object in each conf
parsers.
No functional change, just refactoring.
2024-08-25 06:25:07 +09:00
Yu Watanabe
7f66a94ecf
network/routing-policy-rule: introduce a generic conf-parser for [RoutingPolicyRule] sectin
...
This introduce config_parse_routing_policy_rule(), which wraps existing
conf parsers. With this, we can drop many custom conf parsers for
[RoutingPolicyRule], and can reuse generic conf parsers in conf-parser.[ch].
2024-08-25 06:19:51 +09:00