• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

systemd / systemd / 14766779411

30 Apr 2025 04:55PM UTC coverage: 72.225% (-0.06%) from 72.282%
14766779411

push

github

web-flow
wait-online: handle varlink connection errors while waiting for DNS (#37283)

Currently, if systemd-networkd-wait-online is started with --dns, and
systemd-resolved is not running, it will exit with an error right away.
Similarly, if systemd-resolved is restarted while waiting for DNS
configuration, systemd-networkd-wait-online will not attempt to
re-connect, and will potentially never see subsequent DNS
configurations.

Improve this by adding socket units for the systemd-resolved varlink
servers, and re-establish the connection in systemd-networkd-wait-online
when we receive `SD_VARLINK_ERROR_DISCONNECTED`.

8 of 16 new or added lines in 2 files covered. (50.0%)

5825 existing lines in 217 files now uncovered.

297168 of 411450 relevant lines covered (72.22%)

695892.62 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

46.43
/src/integritysetup/integrity-util.c
1
/* SPDX-License-Identifier: LGPL-2.1-or-later */
2
#include "extract-word.h"
3
#include "fileio.h"
4
#include "integrity-util.h"
5
#include "log.h"
6
#include "path-util.h"
7
#include "percent-util.h"
8

9
static int supported_integrity_algorithm(char *user_supplied) {
10✔
10
        if (!STR_IN_SET(user_supplied, "crc32", "crc32c", "xxhash64", "sha1", "sha256", "hmac-sha256"))
10✔
UNCOV
11
                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unsupported integrity algorithm (%s)", user_supplied);
×
12
        return 0;
10✔
13
}
14

15
int parse_integrity_options(
10✔
16
                const char *options,
17
                uint32_t *ret_activate_flags,
18
                int *ret_percent,
19
                usec_t *ret_commit_time,
20
                char **ret_data_device,
21
                char **ret_integrity_alg) {
22
        int r;
25✔
23

24
        for (;;) {
40✔
25
                _cleanup_free_ char *word = NULL;
15✔
26
                char *val;
25✔
27

28
                r = extract_first_word(&options, &word, ",", EXTRACT_DONT_COALESCE_SEPARATORS | EXTRACT_UNESCAPE_SEPARATORS);
25✔
29
                if (r < 0)
25✔
UNCOV
30
                        return log_error_errno(r, "Failed to parse options: %m");
×
31
                if (r == 0)
25✔
32
                        break;
33
                else if (streq(word, "allow-discards")) {
15✔
UNCOV
34
                        if (ret_activate_flags)
×
35
                                *ret_activate_flags |= CRYPT_ACTIVATE_ALLOW_DISCARDS;
×
36
                } else if ((val = startswith(word, "mode="))) {
15✔
UNCOV
37
                        if (streq(val, "journal")) {
×
38
                                if (ret_activate_flags)
×
39
                                        *ret_activate_flags &= ~(CRYPT_ACTIVATE_NO_JOURNAL | CRYPT_ACTIVATE_NO_JOURNAL_BITMAP);
×
40
                        } else if (streq(val, "bitmap")) {
×
41
                                if (ret_activate_flags) {
×
42
                                        *ret_activate_flags &= ~CRYPT_ACTIVATE_NO_JOURNAL;
×
43
                                        *ret_activate_flags |= CRYPT_ACTIVATE_NO_JOURNAL_BITMAP;
×
44
                                }
UNCOV
45
                        } else if (streq(val, "direct")) {
×
46
                                if (ret_activate_flags) {
×
47
                                        *ret_activate_flags |= CRYPT_ACTIVATE_NO_JOURNAL;
×
48
                                        *ret_activate_flags &= ~CRYPT_ACTIVATE_NO_JOURNAL_BITMAP;
×
49
                                }
50
                        } else
UNCOV
51
                                log_warning("Encountered unknown mode option '%s', ignoring.", val);
×
52
                } else if ((val = startswith(word, "journal-watermark="))) {
15✔
UNCOV
53
                        r = parse_percent(val);
×
54
                        if (r < 0)
×
55
                                return log_error_errno(r, "Failed to parse journal-watermark value or value out of range (%s)", val);
×
56
                        if (ret_percent)
×
57
                                *ret_percent = r;
×
58
                } else if ((val = startswith(word, "journal-commit-time="))) {
15✔
UNCOV
59
                        usec_t tmp_commit_time;
×
60
                        r = parse_sec(val, &tmp_commit_time);
×
61
                        if (r < 0)
×
62
                                return log_error_errno(r, "Failed to parse journal-commit-time value (%s)", val);
×
63
                        if (ret_commit_time)
×
64
                                *ret_commit_time = tmp_commit_time;
×
65
                } else if ((val = startswith(word, "data-device="))) {
15✔
66
                        if (ret_data_device) {
5✔
67
                                r = free_and_strdup(ret_data_device, val);
5✔
68
                                if (r < 0)
5✔
UNCOV
69
                                        return log_oom();
×
70
                        }
71
                } else if ((val = startswith(word, "integrity-algorithm="))) {
10✔
72
                        r = supported_integrity_algorithm(val);
10✔
73
                        if (r < 0)
10✔
74
                                return r;
75
                        if (ret_integrity_alg) {
10✔
76
                                r = free_and_strdup(ret_integrity_alg, val);
10✔
77
                                if (r < 0)
10✔
UNCOV
78
                                        return log_oom();
×
79
                        }
80
                } else
UNCOV
81
                        log_warning("Encountered unknown option '%s', ignoring.", word);
×
82
        }
83

84
        return r;
10✔
85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc