Yu Watanabe
adef6d089b
Merge pull request #21122 from yuwata/network-optimize-reload
...
network: slightly optimize "networkctl reload"
2021-10-26 15:55:01 +09:00
Yu Watanabe
5b47f35d0e
test-network: reconfigure interface instead of restarting networkd
2021-10-26 08:20:29 +09:00
Yu Watanabe
b4564f4e8f
network: delay dropping addresses or so on reloading .network files
...
When a .network file is updated but its change is not so big, it is not
necessary to first drop all configs and then reassign later again.
This slightly optimize such situation. First foreignize all configs, and
then drop later when it is not requested by the updated .network file.
2021-10-26 08:20:22 +09:00
Lennart Poettering
1845ba368e
homework: replace homegrown "dir-is-empty" check with dir_is_empty_at()
2021-10-26 08:13:15 +09:00
Yu Watanabe
b1ccd7d737
Merge pull request #21097 from poettering/dir-is-empty-fix
...
dir_is_empty_at() tweaks
2021-10-26 08:12:50 +09:00
Yu Watanabe
8a088877ab
test: enable debug logging of systemd-udevd
...
Otherwise, it is hard to debug when the test fails.
2021-10-26 08:12:10 +09:00
Yu Watanabe
0f96a82311
network: dhcp6pd: do not assign downstream prefix when RADV is requested but not configured yet
2021-10-26 08:11:44 +09:00
Yu Watanabe
928112a487
network: ndisc: fix behavior when DHCPv6Client=always
...
The man page says that when 'always' is set, the DHCPv6 client always
starts in managed mode, and that means we need to ignore the RA flags.
2021-10-26 08:11:19 +09:00
Yu Watanabe
e817f5b0f9
Merge pull request #21119 from yuwata/network-dhcp6-pd-cleanups
...
network: dhcp6pd: several cleanups
2021-10-26 08:10:56 +09:00
Yu Watanabe
a84171ce6f
libsystemd-network: do not warn when log_dhcp_client() or friends with NULL
2021-10-26 08:09:40 +09:00
Lennart Poettering
0dbce03c37
tree-wide: explicitly unpoison getdents64() memory
...
Apparently memory sanitizer doesn't grok getdents64() properly. Let's
address that by explicitly marken memory initialized by getdents64() as
unpoisoned.
2021-10-25 21:51:37 +02:00
Lennart Poettering
bfc569b060
test: add test for dir_is_empty_at()
2021-10-25 21:51:37 +02:00
Lennart Poettering
d96f21eec2
stat-util: make sure dir_is_empty_at() does something useful in all cases
2021-10-25 21:51:37 +02:00
Lennart Poettering
a068aceafb
stat-util: optimize dir_is_empty_at() a bit, by using getdents64()
...
That way we have a single syscall only for it, instead of the multiple
readdir() and friends do. And we can operate entirely on the stack, no
malloc() implicit.
2021-10-25 21:51:37 +02:00
Lennart Poettering
a4e70ef7ba
dirent-util: add FOREACH macro for iterating through getdents64() buffers
...
We already have a similar loop twice, let's make it easier to read via
an iteration macro.
(The new macro is a bit more careful even, as it verifies the full
dirent fits into the remaining buffer when returning it)
2021-10-25 21:51:37 +02:00
Lennart Poettering
ca664db258
dirent-util: move getdents64() related definitions to common header
...
We want to reuse getdents64() wherever necessary, let's hence move
definitions useful for that into public code.
2021-10-25 21:50:20 +02:00
Lennart Poettering
b9d0652263
stat-util: specify O_DIRECTORY when reopening dir in dir_is_empty_at()
...
That way we can fail earlier if the specified fd is not actually a
directory.
(Also, it's not exactly according to standards to open things without
either O_RDONLY/O_RDWR...)
2021-10-25 21:39:05 +02:00
Yu Watanabe
6681eb021a
udev: do not try to rename interface if it is already up
...
See dev_change_name() in kernel's net/core/dev.c.
Fixes #21105 .
2021-10-25 20:18:53 +01:00
Yu Watanabe
756f1f5fd0
network: rename function
2021-10-26 02:27:26 +09:00
Yu Watanabe
df8bf72631
network: dhcp6: rename variables
2021-10-26 00:35:22 +09:00
Yu Watanabe
78e50edfd4
network: dhcp6pd: move logic of acquiring subnet prefix into dhcp6_pd_assign_prefix()
...
Preparation for later commits.
2021-10-26 00:35:22 +09:00
Yu Watanabe
56bbe0ef02
network: dhcp6pd: introduce a simplified and unified method to calculate subnet prefix
2021-10-26 00:35:22 +09:00
Yu Watanabe
f595b2e9b4
Merge pull request #21116 from poettering/test-cleaner
...
make tests a bit cleaner in regards to oomd handling
2021-10-25 23:16:14 +09:00
Yu Watanabe
1dfdf96716
Merge pull request #21117 from mrc0mmand/last-coverage-related-tweaks
...
Last batch of coverage-related tweaks
2021-10-25 23:15:47 +09:00
Yu Watanabe
f8aa82e43f
Merge pull request #21077 from poettering/mount-setattr
...
optimize remounting with mount_setattr() syscall
2021-10-25 23:15:10 +09:00