]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agohomework: avoid runtime formatting of a fixed string 22516/head
Zbigniew Jędrzejewski-Szmek [Tue, 15 Feb 2022 09:50:43 +0000 (10:50 +0100)] 
homework: avoid runtime formatting of a fixed string

Follow-up for fe9bd5ad3670f6a34f9ea9b4e2c16bec6000ce11.
I checked that the formatted string has the same dashes as
before fe9bd5ad3670f6a34f9ea9b4e2c16bec6000ce11.

3 years agoshare/gpt: add stringified defines for GPT partition types
Zbigniew Jędrzejewski-Szmek [Tue, 15 Feb 2022 09:46:35 +0000 (10:46 +0100)] 
share/gpt: add stringified defines for GPT partition types

3 years agoNEWS: minor grammar adjustment
Zbigniew Jędrzejewski-Szmek [Tue, 15 Feb 2022 09:30:35 +0000 (10:30 +0100)] 
NEWS: minor grammar adjustment

Follow-up for e41dcb822167116c8924e56b39640536df894bbd.

3 years agosystemctl: expand error message
Zbigniew Jędrzejewski-Szmek [Sun, 13 Feb 2022 11:11:52 +0000 (12:11 +0100)] 
systemctl: expand error message

3 years agodocs: more internal links
Zbigniew Jędrzejewski-Szmek [Fri, 21 Jan 2022 12:26:56 +0000 (13:26 +0100)] 
docs: more internal links

3 years agotest: set `ReadWritePaths=$BUILD_DIR` when running w/ coverage
Frantisek Sumsal [Mon, 14 Feb 2022 19:19:51 +0000 (20:19 +0100)] 
test: set `ReadWritePaths=$BUILD_DIR` when running w/ coverage

otherwise units using `DynamicUser=yes` won't be able to write the
coverage stats (currently affecting TEST-20-MAINPIDGAMES).

`DynamicUser=yes` implies `ProtectSystem=strict` and
`ProtectHome=read-only` and can't be overridden hence we need to
utilize `ReadWritePaths=` to work around that.

3 years agoMerge pull request #22487 from poettering/bootspec-source-flags
Yu Watanabe [Mon, 14 Feb 2022 19:45:59 +0000 (04:45 +0900)] 
Merge pull request #22487 from poettering/bootspec-source-flags

bootctl: show all discovered entries, but show state + type in details

3 years agoMerge pull request #22508 from poettering/stat-ino-compare
Yu Watanabe [Mon, 14 Feb 2022 19:45:31 +0000 (04:45 +0900)] 
Merge pull request #22508 from poettering/stat-ino-compare

stat-util: add new stat_inode_same() helper

3 years agoMerge pull request #22507 from poettering/id128-compare-tweaks
Yu Watanabe [Mon, 14 Feb 2022 19:40:53 +0000 (04:40 +0900)] 
Merge pull request #22507 from poettering/id128-compare-tweaks

sd-id128: comparison tweaks

3 years agodocs: make clear that if you use threaded cgroups you need to do that two levels...
Lennart Poettering [Mon, 14 Feb 2022 17:05:31 +0000 (18:05 +0100)] 
docs: make clear that if you use threaded cgroups you need to do that two levels down from your delegated cgroup

Prompted by: #22486

3 years agosd-daemon: use path_join() instead of manual path concat 22508/head
Lennart Poettering [Mon, 14 Feb 2022 16:23:35 +0000 (17:23 +0100)] 
sd-daemon: use path_join() instead of manual path concat

3 years agocoredump: fix inode check
Lennart Poettering [Mon, 14 Feb 2022 16:22:27 +0000 (17:22 +0100)] 
coredump: fix inode check

When checking if we look at the root directory we actually need to
compare both st_dev *and* st_ino. The existing check only checked the
latter. Fix that.

3 years agofd-util: use ERRNO_IS_XYZ() macros where appropriate
Lennart Poettering [Mon, 14 Feb 2022 16:22:18 +0000 (17:22 +0100)] 
fd-util: use ERRNO_IS_XYZ() macros where appropriate

3 years agotree-wide: port various places over to new stat_inode_same() helper
Lennart Poettering [Mon, 14 Feb 2022 16:21:41 +0000 (17:21 +0100)] 
tree-wide: port various places over to new stat_inode_same() helper

3 years agostat-util: add helper stat_inode_same() for comparing stat's st_dev/st_ino in one
Lennart Poettering [Mon, 14 Feb 2022 16:18:32 +0000 (17:18 +0100)] 
stat-util: add helper stat_inode_same() for comparing stat's st_dev/st_ino in one

We do this all over the place, hence let's add a simple helper that does
this and particularly carefully and thoroughly.

3 years agoMerge pull request #22506 from poettering/devnum-zero-btrfs-block-dev
Luca Boccassi [Mon, 14 Feb 2022 16:17:04 +0000 (16:17 +0000)] 
Merge pull request #22506 from poettering/devnum-zero-btrfs-block-dev

gpt-auto: some (primarily cosmetic) fixes to backing block device detection in gpt-auto-generator/sd-device

3 years agoMerge pull request #22445 from lnussel/logind
Luca Boccassi [Mon, 14 Feb 2022 16:16:39 +0000 (16:16 +0000)] 
Merge pull request #22445 from lnussel/logind

logind: post review fixes

3 years agobootspec: avoid zero size VLA 22487/head
Lennart Poettering [Fri, 11 Feb 2022 21:36:00 +0000 (22:36 +0100)] 
bootspec: avoid zero size VLA

apparently some checkers don't like that. Let's be entirely safe here,
and use malloc() based allocation, given that the entries are user
controlled.

3 years agoboot: suppress XBOOTLDR if same device as ESP when enumerating entries
Lennart Poettering [Fri, 11 Feb 2022 21:23:37 +0000 (22:23 +0100)] 
boot: suppress XBOOTLDR if same device as ESP when enumerating entries

On my local system I linked up the ESP and XBOOTLDR partitions, and
ended up with duplicate entries being listed. Try hard to detect that
and only enumerate entries in the ESP if it turns out that both dirs
have the same dev_t.

This should detect both bind mounted and symlinked cases and should make
our list output less confusing.

3 years agobootspec: make sure all return values are initialized on return of find_esp_and_warn()
Lennart Poettering [Fri, 11 Feb 2022 21:19:35 +0000 (22:19 +0100)] 
bootspec: make sure all return values are initialized on return of find_esp_and_warn()

THis makes sure that find_esp_and_warn() + find_xbootldr_and_warn()
follow our usual coding style that on success all return values are
initialized. We got that right in most successful codepaths out of these
functions, but missed the one where the paths are manually overwritten
via env vars.

3 years agobootctl: show more information about boot entry state in list
Lennart Poettering [Fri, 11 Feb 2022 20:15:22 +0000 (21:15 +0100)] 
bootctl: show more information about boot entry state in list

Let's improve display of boot entries and show what type they have (i.e.
boot loader spec type 1, or type 2, or auto-discovered or reported by
boot loader), and in particular mark entries the boot loader discovered
but we can't find (i.e. that likely vanished, or possibly couldn't be
found due to a misconfiguration) and that the boot loader didn't find
but we see (which are new, or possibly also the result of
misconfiguraiton).

This is supposed to be a replacement for #22161, but instead of hiding
vanished entries, highlights them, which I think is more appropriate for
a low-level tool such bootctl.

Replaces: #22161 #22398

3 years agobootspec: also collect/mark the "selected" boot entry (i.e. the one currently booted)
Lennart Poettering [Fri, 11 Feb 2022 13:41:00 +0000 (14:41 +0100)] 
bootspec: also collect/mark the "selected" boot entry (i.e. the one currently booted)

it's helpful and easy, so let's do it

3 years agobootspec: also parse new 'beep' loader.conf variable
Lennart Poettering [Fri, 11 Feb 2022 13:18:18 +0000 (14:18 +0100)] 
bootspec: also parse new 'beep' loader.conf variable

3 years agobootspec: parse/show devicetree-overlay field too
Lennart Poettering [Fri, 11 Feb 2022 13:12:09 +0000 (14:12 +0100)] 
bootspec: parse/show devicetree-overlay field too

It has been defined in the boot loader spec, and is the only field we
currently don't parse, hence fix that.

3 years agoupdate TODO
Lennart Poettering [Fri, 11 Feb 2022 13:05:15 +0000 (14:05 +0100)] 
update TODO

3 years agobootspec: port one more use of basename() to path_extract_filename()
Lennart Poettering [Fri, 11 Feb 2022 13:05:01 +0000 (14:05 +0100)] 
bootspec: port one more use of basename() to path_extract_filename()

3 years agoRevert "bootctl: Ignore boot entries (continue #22041)"
Lennart Poettering [Thu, 3 Feb 2022 15:27:33 +0000 (16:27 +0100)] 
Revert "bootctl: Ignore boot entries (continue #22041)"

3 years agoveritysetup: whitespace fix 22507/head
Lennart Poettering [Mon, 14 Feb 2022 13:59:03 +0000 (14:59 +0100)] 
veritysetup: whitespace fix

3 years agohomed: use SD_ID128_TO_UUID_STRING() at one more place
Lennart Poettering [Mon, 14 Feb 2022 13:56:52 +0000 (14:56 +0100)] 
homed: use SD_ID128_TO_UUID_STRING() at one more place

3 years agotree-wide: use id128_equal_string() at various places
Lennart Poettering [Mon, 14 Feb 2022 13:56:37 +0000 (14:56 +0100)] 
tree-wide: use id128_equal_string() at various places

3 years agoid128-util: add new helper id128_equal_string()
Lennart Poettering [Mon, 14 Feb 2022 13:54:24 +0000 (14:54 +0100)] 
id128-util: add new helper id128_equal_string()

Quite often we compare uuids/id128 formatted as strings with specific
values. So far we usually used streq() for that. let's add a new
explicit helper for this in id128_equal_string() that compares a string
with an sd_id128_t and is more robust than a simple string comparison.
Moreover, we can mroe easily reuse the various defines we have for
specific UUIDs, for example those from gpt.h.

3 years agosd128: export sd_id128_to_uuid_string()
Lennart Poettering [Mon, 14 Feb 2022 13:52:02 +0000 (14:52 +0100)] 
sd128: export sd_id128_to_uuid_string()

We expose various other forms of UUID helpers already, i.e.
SD_ID128_UUID_FORMAT_STR and SD_ID128_MAKE_UUID_STR(), and we parse
UUIDs, hence add a high-level helper for formatting UUIDs too.

This doesn't add any new code, it just moves some helpers
id128-util.[ch] → sd-id128.[ch], to make them public.

3 years agoMerge pull request #22505 from mrc0mmand/more-coverage-tweaks
Frantisek Sumsal [Mon, 14 Feb 2022 13:51:08 +0000 (13:51 +0000)] 
Merge pull request #22505 from mrc0mmand/more-coverage-tweaks

A couple of coverage-related tweaks

3 years agotest: check if running in container earlier
Yu Watanabe [Wed, 19 Jan 2022 21:31:39 +0000 (06:31 +0900)] 
test: check if running in container earlier

3 years agoMerge pull request #22496 from yuwata/network-cleanups-keep-configuration
Luca Boccassi [Mon, 14 Feb 2022 13:17:23 +0000 (13:17 +0000)] 
Merge pull request #22496 from yuwata/network-cleanups-keep-configuration

network: cleanups for KeepConfiguration= setting

3 years agogpt-auto: properly handle case where we can't determine devno of /usr/ fs 22506/head
Lennart Poettering [Mon, 14 Feb 2022 12:35:27 +0000 (13:35 +0100)] 
gpt-auto: properly handle case where we can't determine devno of /usr/ fs

get_block_device_harder() returns == 0 if the fs is valid, but it is not
backed by a single devno. (As opposed to returning > 0 if the devno is
valid). Let's catch this case and log a clear message, and don't bother
open the device in that case.

This is mostly cosmetical, as either way, systemd-gpt-auto-generator
doesn't work in scenarios like that.

Prompted-by: #22504
3 years agosd-device: refuse opening device mit major/minor of zero early
Lennart Poettering [Mon, 14 Feb 2022 12:33:43 +0000 (13:33 +0100)] 
sd-device: refuse opening device mit major/minor of zero early

device nodes with 0 dev_t are not real (and for that reason such inodes
are used as whiteouts in overlayfs, for example), hence refuse them
early. It seems wrong going to sysfs for something we know can't exist
anyway.

3 years agotest: check for (possibly) missing test coverage 22505/head
Frantisek Sumsal [Mon, 14 Feb 2022 11:20:02 +0000 (12:20 +0100)] 
test: check for (possibly) missing test coverage

If the test logs contain lines like:

```
...systemd-resolved[735885]: profiling:/systemd-meson-build/src/shared/libsystemd-shared-250.a.p/base-filesystem.c.gcda:Cannot open
```

it means we're possibly missing some coverage since gcov can't write the stats,
usually due to the sandbox being too restrictive (e.g. ProtectSystem=yes,
ProtectHome=yes) or the $BUILD_DIR being inaccessible to non-root users.

3 years agotest: set ACLs for the build dir when built with coverage
Frantisek Sumsal [Mon, 14 Feb 2022 10:58:54 +0000 (11:58 +0100)] 
test: set ACLs for the build dir when built with coverage

Otherwise unprivileged processes (like systemd-resolved) can't write
coverage data.

3 years agodo not call __register_atfork directly
Matija Skala [Sat, 12 Feb 2022 05:05:54 +0000 (06:05 +0100)] 
do not call __register_atfork directly

this way it is cleaner and more portable and systemd links against libpthread anyway

3 years agosystemctl: fix halt -f 22445/head
Ludwig Nussel [Wed, 9 Feb 2022 09:39:16 +0000 (10:39 +0100)] 
systemctl: fix halt -f

Commit adefc8789b always asks logind for shutdown first. So I broke halt
-f which is supposed to issue a direct syscall in that case.

3 years agologind: more verbose struct initialization
Ludwig Nussel [Mon, 7 Feb 2022 17:03:22 +0000 (18:03 +0100)] 
logind: more verbose struct initialization

3 years agologind: increase max wall message length to 4096
Ludwig Nussel [Mon, 7 Feb 2022 10:50:12 +0000 (11:50 +0100)] 
logind: increase max wall message length to 4096

3 years agologind: style fixes
Ludwig Nussel [Mon, 7 Feb 2022 09:56:19 +0000 (10:56 +0100)] 
logind: style fixes

3 years agologind: add handle enum to struct
Ludwig Nussel [Thu, 3 Feb 2022 16:08:28 +0000 (17:08 +0100)] 
logind: add handle enum to struct

Avoid pointer arithmetic at the expense of repeating the enum value
in the struct.

3 years agoMerge pull request #22499 from mrc0mmand/ci-tweaks
Evgeny Vereshchagin [Sun, 13 Feb 2022 16:13:05 +0000 (19:13 +0300)] 
Merge pull request #22499 from mrc0mmand/ci-tweaks

A couple of Packit/Super-Linter tweaks

3 years agoci: re-enable s390x Packit builds 22499/head
Frantisek Sumsal [Sun, 13 Feb 2022 14:00:22 +0000 (15:00 +0100)] 
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/

3 years agoci: explicitly disable multi-status for Super-Linter
Frantisek Sumsal [Sun, 13 Feb 2022 13:59:08 +0000 (14:59 +0100)] 
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!
```

3 years agoci: use the 'slim' version of Super-Linter
Frantisek Sumsal [Sun, 13 Feb 2022 13:54:51 +0000 (14:54 +0100)] 
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

3 years agoNEWS: clarify that ForceDHCPv6PDOtherInformation= is removed
Yu Watanabe [Sun, 13 Feb 2022 07:27:50 +0000 (16:27 +0900)] 
NEWS: clarify that ForceDHCPv6PDOtherInformation= is removed

Closes #22493.

3 years agonetwork: drop managed configs on reconfigure when KeepConfiguration=yes 22496/head
Yu Watanabe [Sun, 13 Feb 2022 10:57:09 +0000 (19:57 +0900)] 
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.

3 years agonetwork: drop redundant condition
Yu Watanabe [Sun, 13 Feb 2022 10:54:09 +0000 (19:54 +0900)] 
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.

3 years agocgroup-util: refuse the case that both path and suffix are empty strings
Yu Watanabe [Sat, 12 Feb 2022 06:32:48 +0000 (15:32 +0900)] 
cgroup-util: refuse the case that both path and suffix are empty strings

Fixes CID#1322378.

3 years agoboot: Correctly check the return value of CheckEvent
Jan Janssen [Fri, 11 Feb 2022 12:17:23 +0000 (13:17 +0100)] 
boot: Correctly check the return value of CheckEvent

Fixes: #22428
3 years agoMerge pull request #22485 from poettering/cgroup-id-not-support
Luca Boccassi [Fri, 11 Feb 2022 17:06:30 +0000 (17:06 +0000)] 
Merge pull request #22485 from poettering/cgroup-id-not-support

cgroup: downgrade warnings of "cgroup ID" can't be read (on old kernels)

3 years agoci: run all fuzz targets on CIFuzz
Evgeny Vereshchagin [Fri, 11 Feb 2022 02:01:33 +0000 (02:01 +0000)] 
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.

3 years agopid1: export cgroup ID among per-unit cgroup information 22485/head
Lennart Poettering [Fri, 11 Feb 2022 12:24:35 +0000 (13:24 +0100)] 
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.

3 years agocgroup-util: minor modernizations
Lennart Poettering [Fri, 11 Feb 2022 12:23:32 +0000 (13:23 +0100)] 
cgroup-util: minor modernizations

Rename return parameters to "ret", use ternary op without second
argument, rebreak comments, use isempty() more.

3 years agocgroup: downgrade warning if we can't get ID off cgroup
Lennart Poettering [Fri, 11 Feb 2022 12:18:58 +0000 (13:18 +0100)] 
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
3 years agobasic: do not warn in mkdir_p() when parent directory exists
Zbigniew Jędrzejewski-Szmek [Thu, 10 Feb 2022 07:30:08 +0000 (08:30 +0100)] 
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 37c1d5e97dbc869edd8fc178427714e2d9428d2b, 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

3 years agoresolve: describe mdns event sources
Evgeny Vereshchagin [Thu, 10 Feb 2022 19:12:28 +0000 (19:12 +0000)] 
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
```

3 years agotree-wide: move `unsigned` to the start of type declaration
Frantisek Sumsal [Thu, 10 Feb 2022 16:19:27 +0000 (17:19 +0100)] 
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".

3 years agotest: document how to manually run Ubuntu CI stuff
Frantisek Sumsal [Thu, 10 Feb 2022 10:59:27 +0000 (11:59 +0100)] 
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.

3 years agotest: accept GC'ed units in newer LVM
Frantisek Sumsal [Thu, 10 Feb 2022 11:29:53 +0000 (12:29 +0100)] 
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: d10d562bd4b9f93130fb2b23f2b0d0d4126ea7d4
See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855

3 years agoMerge pull request #22471 from yuwata/network-bridge-vlan-protocol
Yu Watanabe [Thu, 10 Feb 2022 11:40:04 +0000 (20:40 +0900)] 
Merge pull request #22471 from yuwata/network-bridge-vlan-protocol

network: bridge: fix vlan protocol

3 years agoMerge pull request #22452 from yuwata/network-ipv6ll
Yu Watanabe [Thu, 10 Feb 2022 11:38:56 +0000 (20:38 +0900)] 
Merge pull request #22452 from yuwata/network-ipv6ll

network: use sysctl to set IPv6LL address generation mode when the interface is already up

3 years agotest-network: add missing tests for bridge properties 22471/head
Yu Watanabe [Thu, 10 Feb 2022 09:04:34 +0000 (18:04 +0900)] 
test-network: add missing tests for bridge properties

3 years agonetwork: bridge: fix endian of vlan protocol
Yu Watanabe [Thu, 10 Feb 2022 08:47:14 +0000 (17:47 +0900)] 
network: bridge: fix endian of vlan protocol

Fixes #22469.

3 years agotest-network: add testcase for re-generating IPv6LL address 22452/head
Yu Watanabe [Tue, 8 Feb 2022 14:53:43 +0000 (23:53 +0900)] 
test-network: add testcase for re-generating IPv6LL address

3 years agonetwork: attempt to trigger kernel IPv6LL address generation
Joerie de Gram [Tue, 8 Feb 2022 13:56:26 +0000 (22:56 +0900)] 
network: attempt to trigger kernel IPv6LL address generation

Try to ensure kernel IPv6 link local address generation occurs by
setting the per-if addr_gen_mode sysctl when the link is already up,
instead of the netlink interface (IFLA_INET6_ADDR_GEN_MODE).

The netlink setting is sufficient in cases where the interface is not
yet up when networkd configures an interface - bringing the interface
up will trigger in-kernel address generation.

If the interface is already up, yet the interface has no IPv6LL assigned
setting IFLA_INET6_ADDR_GEN_MODE has no effect.

Writing the addr_gen_mode sysctl is a best effort attempt at triggering
address generation regardless of interface state because it also works
in cases where the interface is already up.

Fixes #22424.

3 years agonetwork: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c
Yu Watanabe [Tue, 8 Feb 2022 13:53:33 +0000 (22:53 +0900)] 
network: move link_set_ipv6ll_stable_secret() to networkd-ipv6ll.c

3 years agonetwork: skip to set IPv6LL address generation mode if the requested mode is already set
Yu Watanabe [Tue, 8 Feb 2022 13:27:17 +0000 (22:27 +0900)] 
network: skip to set IPv6LL address generation mode if the requested mode is already set

3 years agonetwork: use log_link_warning_errno() or friends where applicable
Yu Watanabe [Tue, 8 Feb 2022 17:14:12 +0000 (02:14 +0900)] 
network: use log_link_warning_errno() or friends where applicable

3 years agonetwork: monitor current IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:26:23 +0000 (22:26 +0900)] 
network: monitor current IPv6LL address generation mode

3 years agonetwork: introduce two helper functions for setting IPv6LL address generation mode
Yu Watanabe [Tue, 8 Feb 2022 13:16:38 +0000 (22:16 +0900)] 
network: introduce two helper functions for setting IPv6LL address generation mode

3 years agoudev/net: support Match.Firmware= in .link files (#22462)
Alvin Šipraga [Thu, 10 Feb 2022 07:19:28 +0000 (08:19 +0100)] 
udev/net: support Match.Firmware= in .link files (#22462)

In cbcdcaaa0ec5 ("Add support for conditions on the machines firmware")
a new Firmware= directive was added for .netdev and .network files.
While it was also documented to work on .link files, in actual fact the
support was missing. Add that one extra line to make it work, and also
update the fuzzer directives.

3 years agoMerge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation
Anita Zhang [Thu, 10 Feb 2022 01:10:06 +0000 (17:10 -0800)] 
Merge pull request #22467 from mrc0mmand/TEST-64-lvm-static-autoactivation

test: lvm 2.03.15 dropped the static autoactivation

3 years agotest: lvm 2.03.15 dropped the static autoactivation 22467/head
Frantisek Sumsal [Wed, 9 Feb 2022 21:35:03 +0000 (22:35 +0100)] 
test: lvm 2.03.15 dropped the static autoactivation

so install the respective generator only if we're running with older
lvm versions.

See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=ee8fb0310c53ed003a43b324c99cdfd891dd1a7c

3 years agoClarify protocol used in systemd-journal-upload (#22465)
Federico Ceratto [Wed, 9 Feb 2022 20:34:29 +0000 (20:34 +0000)] 
Clarify protocol used in systemd-journal-upload (#22465)

* Clarify protocol used in systemd-journal-upload

3 years agoMerge pull request #22458 from poettering/parse-safe-string
Luca Boccassi [Wed, 9 Feb 2022 16:59:14 +0000 (16:59 +0000)] 
Merge pull request #22458 from poettering/parse-safe-string

some safety tweaks to conf-parser.[ch]

3 years agomeson: disable export-dbus-interfaces target when cross-compiling
Luca Boccassi [Tue, 8 Feb 2022 13:19:52 +0000 (13:19 +0000)] 
meson: disable export-dbus-interfaces target when cross-compiling

ERROR:
Cannot use target systemd as a generator because it is built for the
host machine and no exe wrapper is defined or needs_exe_wrapper is
true. You might want to set `native: true` instead to build it for
the build machine.

3 years agoci: remove MULTI_STATUS from superlinter
Evgeny Vereshchagin [Tue, 8 Feb 2022 20:35:17 +0000 (20:35 +0000)] 
ci: remove MULTI_STATUS from superlinter

Judging by
ERROR! Failed to call GitHub Status API!

it doesn't seem to work. Even if it did it would just clutter the status
checks I think so let's just remove MULTI_STATUS along with
GITHUB_TOKEN.

3 years agoMerge pull request #22248 from yuwata/network-tc-use-request-queue
Yu Watanabe [Wed, 9 Feb 2022 09:57:37 +0000 (18:57 +0900)] 
Merge pull request #22248 from yuwata/network-tc-use-request-queue

network: tc: use request queue to configure QDisc or TClass

3 years agoconf-parser: add specific parser for PID values 22458/head
Lennart Poettering [Wed, 9 Feb 2022 09:13:59 +0000 (10:13 +0100)] 
conf-parser: add specific parser for PID values

3 years agotree-wide: use config_parse_safe_string() at various places
Lennart Poettering [Wed, 9 Feb 2022 09:07:17 +0000 (10:07 +0100)] 
tree-wide: use config_parse_safe_string() at various places

3 years agoconf-parser: update config_item_*_lookup() to follow modern coding style
Lennart Poettering [Wed, 9 Feb 2022 08:55:21 +0000 (09:55 +0100)] 
conf-parser: update config_item_*_lookup() to follow modern coding style

Let's rename the return parameters ret_xyz, and always initialize them
if we return >= 0, as per our current coding style.

3 years agoconf-parser: refuse section headers with control characters early, just in case
Lennart Poettering [Wed, 9 Feb 2022 08:47:53 +0000 (09:47 +0100)] 
conf-parser: refuse section headers with control characters early, just in case

3 years agoconf-parser: minor refactorings/modernizations
Lennart Poettering [Wed, 9 Feb 2022 08:47:50 +0000 (09:47 +0100)] 
conf-parser: minor refactorings/modernizations

3 years agoconf-parser: use _cleanup_free_ where appropriate
Lennart Poettering [Wed, 9 Feb 2022 08:47:10 +0000 (09:47 +0100)] 
conf-parser: use _cleanup_free_ where appropriate

3 years agoconf-parse: add generic config_parse_safe_string() helper
Lennart Poettering [Wed, 9 Feb 2022 08:45:12 +0000 (09:45 +0100)] 
conf-parse: add generic config_parse_safe_string() helper

This helper is just like config_parse_string() but does some superficial
checks for control characters and quotes.

In most cases we currently use config_parse_string() we probably want to
use config_parse_safe_string() for safety reasons.

3 years agoAdd support for `isolated` parameter
Santa Wiryaman [Mon, 3 May 2021 22:48:26 +0000 (18:48 -0400)] 
Add support for `isolated` parameter

Add the "Isolated" parameter in the *.network file, e.g.,

[Bridge]
Isolated=true|false

When the Isolated parameter is true, traffic coming out of this port
will only be forward to other ports whose Isolated parameter is false.

When Isolated is not specified, the port uses the kernel default
setting (false).

The "Isolated" parameter was introduced in Linux 4.19.
See man bridge(8) for more details.
But even though the kernel and bridge/iproute2 recognize the "Isolated"
parameter, systemd-networkd did not have a way to set it.

3 years agoci: validate actions and fix actionlint warnings
Evgeny Vereshchagin [Tue, 8 Feb 2022 17:34:10 +0000 (17:34 +0000)] 
ci: validate actions and fix actionlint warnings

some actions like Coverity and CFLite aren't run on every PR so to make
sure they are more or less fine when they are changed it makes sense to
at least check them with superlinter/actionlint: https://github.com/rhysd/actionlint

The following warnings were fixed along the way:
```
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2086:info:6:14: Double quote to prevent globbing and word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2046:warning:6:40: Quote this to prevent word splitting [shellcheck]
   |
55 |       run: |
   |       ^~~~
.github/workflows/mkosi.yml:55:7: shellcheck reported issue in this script: SC2006:style:6:40: Use $(...) notation instead of legacy backticked `...` [shellcheck]
   |
55 |       run: |
   |       ^~~~
```
```
.github/workflows/coverity.yml:31:9: shellcheck reported issue in this script: SC2086:info:1:93: Double quote to prevent globbing and word splitting [shellcheck]
   |
31 |         run: echo "COVERITY_SCAN_NOTIFICATION_EMAIL=$(git log -1 ${{ github.sha }} --pretty=\"%aE\")" >> $GITHUB_ENV
   |         ^~~~
```

3 years agonetwork: tc: use hashmap to store traffic control settings in .network files 22248/head
Yu Watanabe [Wed, 26 Jan 2022 04:06:37 +0000 (13:06 +0900)] 
network: tc: use hashmap to store traffic control settings in .network files

As now each qdisc or tclass is configured when it is ready.

3 years agonetwork: tc: introduce order dependency of traffic control
Yu Watanabe [Wed, 26 Jan 2022 04:01:19 +0000 (13:01 +0900)] 
network: tc: introduce order dependency of traffic control

3 years agonetwork: tc: use request queue to configure traffic control
Yu Watanabe [Tue, 25 Jan 2022 18:49:27 +0000 (03:49 +0900)] 
network: tc: use request queue to configure traffic control

But no dependency resolution is implemented.

3 years agonetwork: tc/teql: set tca_kind in verify()
Yu Watanabe [Wed, 26 Jan 2022 03:18:47 +0000 (12:18 +0900)] 
network: tc/teql: set tca_kind in verify()

Then, qdisc_configure() can be simplified.

3 years agonetwork: tc: monitor qdisc and tclass
Yu Watanabe [Tue, 25 Jan 2022 23:42:22 +0000 (08:42 +0900)] 
network: tc: monitor qdisc and tclass

3 years agosd-netlink: allow to dump qdisc and tclass
Yu Watanabe [Wed, 26 Jan 2022 01:24:50 +0000 (10:24 +0900)] 
sd-netlink: allow to dump qdisc and tclass

3 years agosd-netlink: make traffic control related message can be monitored
Yu Watanabe [Wed, 26 Jan 2022 00:53:40 +0000 (09:53 +0900)] 
sd-netlink: make traffic control related message can be monitored

3 years agosd-netlink: introduce sd_rtnl_message_traffic_control_get_{ifindex,parent,handle}()
Yu Watanabe [Tue, 25 Jan 2022 21:04:16 +0000 (06:04 +0900)] 
sd-netlink: introduce sd_rtnl_message_traffic_control_get_{ifindex,parent,handle}()