1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-12 13:18:14 +03:00
Commit Graph

56419 Commits

Author SHA1 Message Date
Yu Watanabe
8ef959cd09 sd-dhcp6-client: initialize IO event source in sd_dhcp6_client_start() 2022-02-14 14:45:14 +09:00
Yu Watanabe
f814cd80de sd-dhcp6-client: make state transition stricter 2022-02-14 14:45:14 +09:00
Yu Watanabe
c2c878d806 sd-dhcp6-client: prohibit spurious state transition
Previously, `client_set_state(client, DHCP6_STATE_STOPPED)` might make
the client enter the SOLICIT state.
2022-02-14 14:45:14 +09:00
Yu Watanabe
220a88ca75 sd-dhcp6-client: disable T1 timer on T2
Otherwise, the client may be enter RENEW state after REBIND state.
2022-02-14 14:45:14 +09:00
Yu Watanabe
c41bdb17fc sd-dhcp6-client: call client_notify() in client_enter_bound_state() 2022-02-14 14:45:14 +09:00
Yu Watanabe
cdf3d8c584 sd-dhcp6-client: fix lifetime handling
This fixes the following issues:
- if T1 is finite and T2 is infinite, then the timer for T1 was not
  enabled,
- after T1 and T2 are randomized, T1 may be longer than T2.
2022-02-14 14:45:07 +09:00
Yu Watanabe
1d6cb4ce2a sd-dhcp6-client: use event_reset_time_relative() 2022-02-14 14:43:45 +09:00
Yu Watanabe
02354ee738 sd-dhcp6-client: introduce client_enter_bound_state()
To make client_set_state() smaller. This should not change any behavior.
2022-02-14 14:43:45 +09:00
Yu Watanabe
cc5184823f sd-dhcp6-client: fix overflow in calculating timeout value 2022-02-14 14:43:45 +09:00
Yu Watanabe
d0875a07dd sd-dhcp6-client: disable event source when client is stopped or freed 2022-02-14 14:43:45 +09:00
Yu Watanabe
7771233127 sd-dhcp6-client: use in6_addr_to_string() 2022-02-14 14:43:45 +09:00
Yu Watanabe
4db6334c9a sd-dhcp6-client: stop client on error in client state transition 2022-02-14 14:43:45 +09:00
Yu Watanabe
bfa1139af4 sd-dhcp6-client: add missing one more error handling 2022-02-14 14:43:45 +09:00
Yu Watanabe
06d5e856f8 sd-dhcp6-client: rename client_start() -> client_set_state() 2022-02-14 14:43:45 +09:00
Yu Watanabe
07a3b3408b sd-dhcp6-client: introduce client_process_*()
This is mostly for shortening `client_receive_message()`.

This also fixes the following:
- do not trigger SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST notification
  when non-reply message,
- add several missing error handlings caused in client_start().
2022-02-14 14:43:45 +09:00
Yu Watanabe
0123b2dbac sd-dhcp6-client: fix possible unaligned read or write 2022-02-14 14:43:45 +09:00
Yu Watanabe
16347c15d8 sd-dhcp6-client: voidify client_reset() 2022-02-14 14:43:45 +09:00
Yu Watanabe
65ece4c85b sd-dhcp6-client: introduce dhcp6_lease_new_from_message() 2022-02-14 14:43:45 +09:00
Yu Watanabe
c930925841 sd-dhcp6-client: use structured initializer 2022-02-14 14:43:45 +09:00
Yu Watanabe
f4fbea7a0f sd-dhcp6-lease: unify lease lifetime calculation 2022-02-14 14:43:45 +09:00
Yu Watanabe
126277aceb sd-dhcp6-client: always use ENODATA when a lease does not have requested data 2022-02-14 14:43:45 +09:00
Yu Watanabe
29858a0f9e sd-dhcp6-client: unify dhcp6_option_append_{ia,pd}() 2022-02-14 14:43:45 +09:00
Yu Watanabe
877bfc78fd sd-dhcp6-client: store PD prefix hint in ia_pd
And allows to specify multiple hints.
2022-02-14 14:43:45 +09:00
Yu Watanabe
e5b0b87f51 sd-dhcp6-client: introduce dhcp6_ia_free() 2022-02-14 14:43:45 +09:00
Yu Watanabe
4b0f27173c sd-dhcp6-client: unify IA option header
This also fixes possible unaligned read of message.
2022-02-14 14:43:45 +09:00
Yu Watanabe
93bd7c4192 sd-dhcp6-lease: reset client or server ID when length is zero
Addresses https://github.com/systemd/systemd/pull/22406#issuecomment-1029391091.
2022-02-14 14:43:45 +09:00
Yu Watanabe
049fddfa7d sd-dhcp6-lease: convert assert_return() -> assert() in non-public functions 2022-02-14 14:43:45 +09:00
Yu Watanabe
7c999d38fa sd-dhcp6-client: rename ia -> ia_na, pd -> ia_pd in sd_dhcp6_lease
The previous naming is quite misleading.
2022-02-14 14:43:45 +09:00
Yu Watanabe
43b7a412b1 sd-dhcp6-client: fix typo ia_pd -> ia_na
Fortunately, currently both ia_pd and ia_na in sd_dhcp6_client are
equivalent now.
2022-02-14 14:43:45 +09:00
Yu Watanabe
5e4d135c60 sd-dhcp6-client: introduce two helpers to create message 2022-02-14 14:43:45 +09:00
Yu Watanabe
6fcf356b9a sd-dhcp6-client: trigger assertion whn invalid IA type is provided
If the condition hits, then it is an error in coding, instead of a user
misconfiguration or invalid receivd message.
2022-02-14 14:40:57 +09:00
Evgeny Vereshchagin
74b781de25
Merge pull request #22499 from mrc0mmand/ci-tweaks
A couple of Packit/Super-Linter tweaks
2022-02-13 19:13:05 +03:00
Frantisek Sumsal
ebcccfd950 ci: re-enable s390x Packit builds
The s390x Copr builders are finally[0] 'native' instead of QEMU-emulated,
which makes them pretty quick to be used in PRs.

[0] https://lists.fedoraproject.org/archives/list/copr-devel@lists.fedorahosted.org/message/AR3ZDKET3EXZHV3MSU3UHMO7EIKBGAN2/
2022-02-13 15:06:24 +01:00
Frantisek Sumsal
23a830e46e ci: explicitly disable multi-status for Super-Linter
to, hopefully, get rid of the following error:

```
 2022-02-13 13:32:12 [ERROR]   Failed to get [GITHUB_TOKEN]!
 2022-02-13 13:32:12 [ERROR]   []
 2022-02-13 13:32:12 [ERROR]   Please set a [GITHUB_TOKEN] from the main workflow environment to take advantage of multiple status reports!
```
2022-02-13 14:59:08 +01:00
Frantisek Sumsal
f94b33803f ci: use the 'slim' version of Super-Linter
The 'slim' version drops certain storage-heavy linters[0] which we don't
use anyway, so let's make the job a bit faster by downloading and using
a smaller image.

[0] https://github.com/github/super-linter#slim-image
2022-02-13 14:54:51 +01:00
Yu Watanabe
e41dcb8221 NEWS: clarify that ForceDHCPv6PDOtherInformation= is removed
Closes #22493.
2022-02-13 11:50:05 +00:00
Yu Watanabe
81db4f3dd8 network: drop managed configs on reconfigure when KeepConfiguration=yes
Otherwise, the managed configs, that is addresses, routes and so on
configured by the previously assigned .network file will not be dropped
on reconfiguring the interface.
2022-02-13 20:01:42 +09:00
Yu Watanabe
07c160a65c network: drop redundant condition
The function `link_drop_foreign_addresses()` is only called in
`link_drop_foreign_config()`, and the same condition is located in the
caller.
2022-02-13 20:01:29 +09:00
Yu Watanabe
74c60fcbec cgroup-util: refuse the case that both path and suffix are empty strings
Fixes CID#1322378.
2022-02-12 11:01:52 +00:00
Jan Janssen
ac3979abd7 boot: Correctly check the return value of CheckEvent
Fixes: #22428
2022-02-11 17:07:05 +00:00
Luca Boccassi
6fb81984ee
Merge pull request #22485 from poettering/cgroup-id-not-support
cgroup: downgrade warnings of "cgroup ID" can't be read (on old kernels)
2022-02-11 17:06:30 +00:00
Evgeny Vereshchagin
d6b99a4a48 ci: run all fuzz targets on CIFuzz
CIFuzz has been kind of broken for a couple months because
coverage reports downloaded from OSS-Fuzz contain absolute
paths while paths to files changed in PRs are relative and they
don't match. It makes it kind of hard for CIFuzz to figure out
what it should run so it runs either all fuzz targets or just new
fuzz targets. Until that issue is fixed let's just always predictably run
all fuzz targets.
2022-02-11 13:21:24 +00:00
Lennart Poettering
5483fca07a pid1: export cgroup ID among per-unit cgroup information
It's really interesting for debugging purposes and we have it already,
hence expose it as dbus property.
2022-02-11 13:36:39 +01:00
Lennart Poettering
a561253f0b cgroup-util: minor modernizations
Rename return parameters to "ret", use ternary op without second
argument, rebreak comments, use isempty() more.
2022-02-11 13:36:39 +01:00
Lennart Poettering
1b42022388 cgroup: downgrade warning if we can't get ID off cgroup
The cgroupid feature was not available in old cgroupvs2 kernels, hence
try to get it but if we can't because it's not supported, then only
debug log about it and proceed.

(We only needs this for cgroup bpf stuff, but that isn't available on
such old kernels anyway)

Fixes: #22483
2022-02-11 13:36:39 +01:00
Zbigniew Jędrzejewski-Szmek
e01e68e70a basic: do not warn in mkdir_p() when parent directory exists
This effectively disables warnings about type/mode/ownership of existing
directories when recursively creating parent directories. (Or files. If there's
a file in a place we expect a directory, the code will later try to create
a file and fail. This follows the general pattern where we do (void)mkdir()
if the mkdir() is immediately followed by opening of a file.)

I was recently debugging an issue with the fstab-generator [1], and it says:
'Directory "/tmp" already exists, but has mode 0777 that is too permissive (0644 was requested), refusing.'
which is very specific but totally wrong in this context.
This output was added in 37c1d5e97d, and I still
think it is worth to do it, because if you actually *do* want the directory, if
there's something wrong, the precise error message will make it much easier to
diagnose. And we can't easily pass the information what failed up the call chain
because there are multiple things we check (ownership, permission mask, type)…
So passing a param whether to warn or not down into the library code seems like
the best solution, despite not being very elegant.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2051285
2022-02-11 10:05:21 +01:00
Evgeny Vereshchagin
a38f3ceeda resolve: describe mdns event sources
when they go down resolved prints
```
Event source mdns-ipv4 (type io) returned error, disabling
```
instead of
```
Event source n/a (type io) returned error, disabling
```
2022-02-11 07:01:58 +09:00
Frantisek Sumsal
da185cd04d tree-wide: move unsigned to the start of type declaration
Even though ISO C11 doesn't mandate in which order the type specifiers
should appear, having `unsigned` at the beginning of each type
declaration feels more natural and, more importantly, it unbreaks
Coccinelle, which has a hard time parsing `long unsigned` and others:

```
init_defs_builtins: /usr/lib64/coccinelle/standard.h
init_defs: /home/mrc0mmand/repos/systemd/coccinelle/macros.h
HANDLING: src/shared/mount-util.c
: 1: strange type1, maybe because of weird order: long unsigned
```

Most of the codebase already "complies", so let's fix the remaining
"offenders".
2022-02-10 21:00:22 +01:00
Frantisek Sumsal
4ba5594390 test: document how to manually run Ubuntu CI stuff
Every time I need it I have to first relearn autopkgtest and find where
all the necessary stuff lives, so let's document it somewhere close to
systemd for (at least) future me.
2022-02-10 13:53:10 +00:00
Frantisek Sumsal
b034f02c62 test: accept GC'ed units in newer LVM
Since lvm 2.03.15 the transient units are started without `-r`, thus
disappearing once they finish and breaking the test (which expects them
to remain loaded after finishing). Let's accept `LoadState=not-found` as
a valid result as well to fix this.

Follow-up to: d10d562bd4
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855
2022-02-10 13:26:11 +00:00