]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agosd-device: move comment about NULL value
Yu Watanabe [Thu, 18 Feb 2021 08:25:51 +0000 (17:25 +0900)] 
sd-device: move comment about NULL value

It is not intuitive, and I do not know why the function behave so.
But let's keep that behavior for compatibility, as such behavior
may be already used explicitly by callers.

3 years agosd-device: rename device_{add,get,remove}_sysattr_value()
Yu Watanabe [Sat, 20 Feb 2021 05:52:47 +0000 (14:52 +0900)] 
sd-device: rename device_{add,get,remove}_sysattr_value()

They just handle cache of sysattr values. Hence, let's use more
explanatory names.

3 years agoRevert "ci: switch back to meson-0.56.2"
Evgeny Vereshchagin [Fri, 19 Feb 2021 02:07:29 +0000 (02:07 +0000)] 
Revert "ci: switch back to meson-0.56.2"

This reverts commit c39e36203ff79a831c93dfb9380c967cd7fdbb99.

Now that meson-0.57.1 (where https://github.com/mesonbuild/meson/issues/8347
is fixed) is out it should be safe to keep rolling forward.

3 years agoman: split out sd_bus_set_fd() man page from sd_bus_get_fd()
Lennart Poettering [Sat, 20 Feb 2021 13:03:34 +0000 (14:03 +0100)] 
man: split out sd_bus_set_fd() man page from sd_bus_get_fd()

sd_bus_get_fd() and related calls are useful for integrating a bus
connection into arbitrary event loops. But sd_bus_set_fd() is quite a
different beast, it's for using D-Bus over pre-initialized sockets or
pairs of fifos or stuff, i.e. very advanced stuff.

Let's split this man page in two, in order not to confuse things
needlessly.

And while we are at it, let's slightly extend the documentation.

3 years agosystemctl: don't search in the full argv[0] for the invocation name
Lennart Poettering [Fri, 19 Feb 2021 19:36:45 +0000 (20:36 +0100)] 
systemctl: don't search in the full argv[0] for the invocation name

argv[0] might be prefixed by a path, and we shouldn't get confused by
that. Hence provide a simple helper call that abstracts the checking
away, which we can use everywhere, and expose the same behaviour, even
if argv[0] is not set.

(While we are at it, port all other multi-call binaries over to the new
helper, too)

Follow-up for: d41a9e4fc1e1bcdefc8d358da2744a97aac5820a

3 years agonetwork: fix typo
Yu Watanabe [Sat, 20 Feb 2021 08:11:39 +0000 (17:11 +0900)] 
network: fix typo

3 years agoMerge pull request #18689 from yuwata/network-address-broadcast-no
Yu Watanabe [Sat, 20 Feb 2021 07:55:28 +0000 (16:55 +0900)] 
Merge pull request #18689 from yuwata/network-address-broadcast-no

network: make Broadcast= accept "no"

3 years agotest-network: add tests for Broadcast= with boolean settings 18689/head
Yu Watanabe [Thu, 18 Feb 2021 21:06:51 +0000 (06:06 +0900)] 
test-network: add tests for Broadcast= with boolean settings

3 years agonetwork: make Broadcast= accept boolean value
Yu Watanabe [Thu, 18 Feb 2021 21:01:34 +0000 (06:01 +0900)] 
network: make Broadcast= accept boolean value

And disable it for wireguard interfaces by default.

Closes #18492.

3 years agoMerge pull request #18699 from yuwata/network-route-add-nexthop-setting
Yu Watanabe [Sat, 20 Feb 2021 05:17:17 +0000 (14:17 +0900)] 
Merge pull request #18699 from yuwata/network-route-add-nexthop-setting

network: add NextHop= setting in [Route] section

3 years agosd-bus: simplify sd_bus_reply()
Lennart Poettering [Thu, 18 Feb 2021 23:20:10 +0000 (00:20 +0100)] 
sd-bus: simplify sd_bus_reply()

there's no point in having two arguments, if one does as well.

3 years agosysctl.d: silence warning if net.core.default_qdisc cannot be set
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 18:02:38 +0000 (19:02 +0100)] 
sysctl.d: silence warning if net.core.default_qdisc cannot be set

Kernels can be compiled without the attribute. It's fine if this is not
set, so silence the warning.

3 years agofileio: extend comment about file sizes in virtual file systems
Lennart Poettering [Fri, 19 Feb 2021 17:29:13 +0000 (18:29 +0100)] 
fileio: extend comment about file sizes in virtual file systems

3 years agoMerge pull request #18703 from poettering/cgroupsv1-bad
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 17:25:17 +0000 (18:25 +0100)] 
Merge pull request #18703 from poettering/cgroupsv1-bad

consider cgroupsv1 usage grounds for "tainting"

3 years agoman: emphasize a bit more that PID files suck 18703/head
Lennart Poettering [Fri, 19 Feb 2021 16:49:44 +0000 (17:49 +0100)] 
man: emphasize a bit more that PID files suck

3 years agomanager: taint systemd if cgroupsv1 is used
Lennart Poettering [Fri, 19 Feb 2021 16:48:50 +0000 (17:48 +0100)] 
manager: taint systemd if cgroupsv1 is used

let's mark cgroupsv1 systems as "tainted" in the taint string logic.
It's time.

3 years agoMerge pull request #18695 from keszybz/xdg-generator-silence-warning
Yu Watanabe [Fri, 19 Feb 2021 16:00:18 +0000 (01:00 +0900)] 
Merge pull request #18695 from keszybz/xdg-generator-silence-warning

xdg-autostart-generator: silence warning

3 years agoMerge pull request #18702 from poettering/news-v248-more
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 15:00:48 +0000 (16:00 +0100)] 
Merge pull request #18702 from poettering/news-v248-more

more v248 NEWS stuff

3 years agoMerge pull request #18694 from keszybz/links-and-syntax-highlighting
Lennart Poettering [Fri, 19 Feb 2021 14:27:41 +0000 (15:27 +0100)] 
Merge pull request #18694 from keszybz/links-and-syntax-highlighting

Links and syntax highlighting

3 years agobasic/alloc-util: also reset the cleaned-up variable in freep()
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 12:07:29 +0000 (13:07 +0100)] 
basic/alloc-util: also reset the cleaned-up variable in freep()

freep() has it's own definition, so I missed it in fd421c4adc7406de02e03e2f7ceede2cc6e1d9d4.

Again, there is a small growth, but the compiler should be able to optimize it away:
-Dbuildtype=debug:

-rwxrwxr-x 1 zbyszek zbyszek 4106816 Feb 19 12:52 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek 7492952 Feb 19 12:52 build/src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 zbyszek zbyszek 4472624 Feb 19 12:53 build/systemd

-rwxrwxr-x 1 zbyszek zbyszek 4107056 Feb 19 13:03 build/libsystemd.so.0.30.0
-rwxrwxr-x 1 zbyszek zbyszek 7493480 Feb 19 13:03 build/src/shared/libsystemd-shared-247.so
-rwxrwxr-x 1 zbyszek zbyszek 4472760 Feb 19 13:03 build/systemd

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31055.

3 years agohwdb: whitespace fixes 18702/head
Lennart Poettering [Fri, 19 Feb 2021 14:19:56 +0000 (15:19 +0100)] 
hwdb: whitespace fixes

3 years agoupdate NEWS
Lennart Poettering [Fri, 19 Feb 2021 14:19:45 +0000 (15:19 +0100)] 
update NEWS

3 years agotest-network: add tests for NextHop= setting in [Route] 18699/head
Yu Watanabe [Wed, 3 Feb 2021 08:19:04 +0000 (17:19 +0900)] 
test-network: add tests for NextHop= setting in [Route]

3 years agonetwork: add nexthop ID in debugging logs
Yu Watanabe [Thu, 4 Feb 2021 15:51:39 +0000 (00:51 +0900)] 
network: add nexthop ID in debugging logs

3 years agonetwork: add NextHop= setting in [Route] section
Yu Watanabe [Tue, 9 Feb 2021 09:52:57 +0000 (18:52 +0900)] 
network: add NextHop= setting in [Route] section

3 years agonetwork: also manage nexthops by ID
Yu Watanabe [Fri, 5 Feb 2021 03:01:07 +0000 (12:01 +0900)] 
network: also manage nexthops by ID

It will be used in later commits.

3 years agoMerge pull request #18646 from yuwata/network-ip-masquerade-follow-ups
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 11:43:37 +0000 (12:43 +0100)] 
Merge pull request #18646 from yuwata/network-ip-masquerade-follow-ups

network: several follow-ups for recent IPMasquerade= change

3 years agoFix grammar and a small typo on a comment
Sven Mueller [Fri, 19 Feb 2021 11:28:00 +0000 (12:28 +0100)] 
Fix grammar and a small typo on a comment

potentically -> potentially
(And a small grammar fix)

3 years agoxdg-autostart-generator: ignore DBusActivatable=true 18695/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 08:50:09 +0000 (09:50 +0100)] 
xdg-autostart-generator: ignore DBusActivatable=true

See https://wiki.gnome.org/HowDoI/DBusApplicationLaunching and
https://wiki.gnome.org/Initiatives/GnomeGoals/DBusActivatable for a description
of this key:
> Instead of the typical UNIX-style fork()/exec() approach to process creation,
> launching an application is done by sending a D-Bus message to the well-known
> name of that application, causing a D-Bus activation.
>
> Starting processes with D-Bus activation ensures that each application gets
> started in its own pristine environment, as a direct descendent of the
> session -- not in the environment of whatever its parent happened to be. This
> is important for ensuring the app ends up in the correct cgroup, for example.

So this motivation is not important for us: we launch stuff ourselves better.

This fixes warnings during boot:
systemd-xdg-autostart-generator[2274]: /etc/xdg/autostart/org.freedesktop.problems.applet.desktop:92: Unknown key name 'DBusActivatable' in section 'Desktop Entry', ignoring.

3 years agoxdg-autostart-generator: reindent
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 08:47:32 +0000 (09:47 +0100)] 
xdg-autostart-generator: reindent

3 years agoman: fix links to various pages 18694/head
Zbigniew Jędrzejewski-Szmek [Fri, 19 Feb 2021 08:10:15 +0000 (09:10 +0100)] 
man: fix links to various pages

nss-dns doesn't have any man page that I could find.

3 years agotree-wide: fix links to systemd.io pages
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 23:14:52 +0000 (00:14 +0100)] 
tree-wide: fix links to systemd.io pages

Having the extra slash at the end is not a problem, just inconsistent. But the links with
.html or .md return 404.

3 years agodocs/ENVIRONMENT: syntax highlighting and some rewordings
Zbigniew Jędrzejewski-Szmek [Mon, 15 Feb 2021 11:10:20 +0000 (12:10 +0100)] 
docs/ENVIRONMENT: syntax highlighting and some rewordings

Use backticks for commands and functions and variables, suffix directories with
a slash. Some sentences were reworded.

3 years agonetwork: nexthop: update ID of nexthop created without specifiying ID
Yu Watanabe [Fri, 5 Feb 2021 01:09:12 +0000 (10:09 +0900)] 
network: nexthop: update ID of nexthop created without specifiying ID

Otherwise, nexthop_configure() -> nexthop_add() creates NextHop object
without ID in link->nexthop, and then, manager_rtnl_process_nexthop() ->
nexthop_add_foreign() also creates another NextHop object with ID in
link->nexthop_foreign.

3 years agonetwork: configure nexthop before routes that requires gateway
Yu Watanabe [Thu, 4 Feb 2021 14:13:08 +0000 (23:13 +0900)] 
network: configure nexthop before routes that requires gateway

This is a preparation for later commits. When RTA_NH_ID is set to a
route, then the corresponding nexthop must be exist.

3 years agotree-wide: fix typo
Yu Watanabe [Fri, 19 Feb 2021 04:27:56 +0000 (13:27 +0900)] 
tree-wide: fix typo

3 years agoGH Actions: Fix labeler bot
Jameer Pathan [Fri, 19 Feb 2021 05:28:20 +0000 (10:58 +0530)] 
GH Actions: Fix labeler bot

3 years agonetwork: warn when any positive boolean string is specified for IPMasquerade= 18646/head
Yu Watanabe [Wed, 17 Feb 2021 07:17:37 +0000 (16:17 +0900)] 
network: warn when any positive boolean string is specified for IPMasquerade=

Previously, any positive boolean string for IPMasquerade= enables only IPv4
masquerade. The commit 48ed276647c754bfb3ed5c6c5af9404e073ffe54 adds
IPv6 masquerade support. However, only "yes" is handled as "ipv4", and other
positive boolean strings are handled as "both".

This makes all positive boolean strings considered as "ipv4", warn that they
are deprecated, and suggest to use "ipv4" or "both".

Follow-up for 48ed276647c754bfb3ed5c6c5af9404e073ffe54.

3 years agonetwork: address: reuse Address:ip_masquerade_done for IPv6 case
Yu Watanabe [Wed, 17 Feb 2021 07:06:31 +0000 (16:06 +0900)] 
network: address: reuse Address:ip_masquerade_done for IPv6 case

It is not necessary to use different flag for each address family.

Follow-up for 48ed276647c754bfb3ed5c6c5af9404e073ffe54.

3 years agoMerge pull request #18659 from poettering/permyriadification
Yu Watanabe [Fri, 19 Feb 2021 05:22:10 +0000 (14:22 +0900)] 
Merge pull request #18659 from poettering/permyriadification

use scaling relative to UINT32_MAX instead of percentages/permyriads wherever we can

3 years agoRecommend drop-ins over modifications to the main config file
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 19:57:06 +0000 (20:57 +0100)] 
Recommend drop-ins over modifications to the main config file

As discussed in https://github.com/systemd/systemd/pull/18347.

3 years agotable: drop trailing white spaces of the last cell in row
Yu Watanabe [Mon, 1 Feb 2021 16:47:58 +0000 (01:47 +0900)] 
table: drop trailing white spaces of the last cell in row

Fixes #18415.

3 years agoupdate NEWS
Lennart Poettering [Thu, 18 Feb 2021 23:19:45 +0000 (00:19 +0100)] 
update NEWS

3 years agooomd: increase accuracy of SwapUsedLimit= to permyriads too 18659/head
Lennart Poettering [Wed, 17 Feb 2021 16:56:26 +0000 (17:56 +0100)] 
oomd: increase accuracy of SwapUsedLimit= to permyriads too

oomd.conf has two parameters with fractionals: SwapUsedLimit= and
DefaultMemoryPressureLimit=, but one accepts permyriads, the other only
percentages, for no apparent reason. One carries the "Percent" in the
name, the other doesn't.

Let's clean this up: always accept permyriads, and drop the suffix,
given that it is misleading.

I figure we should internally try to focus on scaling everything
relative to UINT32_MAX, and if that isn't in the cards at least 10000,
but never permille nor percent unless there's a really really good
reason for it (e.g. interface defined by someone else).

3 years agocore: use our usual UINT32_MAX scaling for OOMD limits
Lennart Poettering [Wed, 17 Feb 2021 16:51:27 +0000 (17:51 +0100)] 
core: use our usual UINT32_MAX scaling for OOMD limits

So far OOMD limits used permyriads, as an upgrade from the original
percent.

The rest of our codebase typically scales stuff relative to UINT32_MAX.
Let's clean this up, an make sure this happens here too. This is
particularly relevant, as this is exposed in unit files and API, and
before we mark this stable we should get the APIs right.

3 years agoparse-util: add format string macro for outputting permyriad
Lennart Poettering [Wed, 17 Feb 2021 16:29:43 +0000 (17:29 +0100)] 
parse-util: add format string macro for outputting permyriad

Let's define a set of macros for making output of permyriad values easy.
They are printed in pure ASCII, i.e. without the permille/permyriad
suffix, using just percent and two places after the dot.

3 years agotree-wide: port various pieces of code over to UINT32_SCALE_FROM_PERMYRIAD()
Lennart Poettering [Wed, 17 Feb 2021 16:03:52 +0000 (17:03 +0100)] 
tree-wide: port various pieces of code over to UINT32_SCALE_FROM_PERMYRIAD()

3 years agoutil: add some helpers for converting percent/permille/permyriad to parts of 2^32-1
Lennart Poettering [Wed, 17 Feb 2021 15:53:11 +0000 (16:53 +0100)] 
util: add some helpers for converting percent/permille/permyriad to parts of 2^32-1

At various places we accept values scaled to the range 0…2^32-1 which
are exposed to the user as percentages/permille/permyriad. Let's add
some helper macros (actually: typesafe macro-like functions) that help
with converting our internal encoding to the external encodings.

benefits: some of the previous code rounded up, some down. let's always
round to nearest, to ensure that our conversions are reversible. Also,
check for overflows correctly.

This also adds a test that makes sure that for the full
percent/permille/permyriad ranges we can convert forth and back without
loss of accuracy.

3 years agopercent-util: when parsing permyriads, permit percents too with 1 place after the dot
Lennart Poettering [Wed, 17 Feb 2021 14:33:05 +0000 (15:33 +0100)] 
percent-util: when parsing permyriads, permit percents too with 1 place after the dot

Previously, when parsing myriads, we'd support:

 x%          → percent, no places after the dot
 x.yz%       → percent, two places after the dot
 x‰          → permille, no places after the dot
 x.y‰        → permille, one place after the dot
 x‱          → permyriad, no places after the dot

What's missing is:

 x.y%        → percent, one place after the dot

Let's add it in.

3 years agoutil: move percent/permille/permyriad parser into percent-util.[ch]
Lennart Poettering [Wed, 17 Feb 2021 14:23:15 +0000 (15:23 +0100)] 
util: move percent/permille/permyriad parser into percent-util.[ch]

A good chunk of parse-util.[ch] has been about parsing parts per
hundred/thousand/ten-thousand. Let's split that out into its own file.

No code changes, just some shuffling around.

3 years agomain: let's use physical_memory_scale() where appropriate
Lennart Poettering [Wed, 17 Feb 2021 13:40:13 +0000 (14:40 +0100)] 
main: let's use physical_memory_scale() where appropriate

This way we can take benefit of the fact that physical_memory_scale()
aligns on page sizes.

3 years agotree-wide: parse permyriads wherever we can
Lennart Poettering [Wed, 17 Feb 2021 13:37:08 +0000 (14:37 +0100)] 
tree-wide: parse permyriads wherever we can

Given that we now have a parser for permyriads, let's use it everywhere
for greater accuracy. This means wherever we previously supported % and
‰, we now also support ‱.

3 years agolimits-util: tweak overflow checks for (physical_memory|system_tasks)_max_scale()
Lennart Poettering [Wed, 17 Feb 2021 13:34:01 +0000 (14:34 +0100)] 
limits-util: tweak overflow checks for (physical_memory|system_tasks)_max_scale()

Also, shortcut two special cases for passing through values as-is, so
that we are not needlessly subjected to overflow issues for them.

3 years agoupdate TODO
Lennart Poettering [Thu, 18 Feb 2021 21:31:11 +0000 (22:31 +0100)] 
update TODO

3 years agonetwork: rename UseFQDN= -> UseHostname=
Yu Watanabe [Wed, 17 Feb 2021 20:30:09 +0000 (05:30 +0900)] 
network: rename UseFQDN= -> UseHostname=

Prompted by
https://github.com/systemd/systemd/pull/18543#issuecomment-780798451.

3 years agoMerge pull request #18685 from poettering/network-type-tweaks
Lennart Poettering [Thu, 18 Feb 2021 20:19:51 +0000 (21:19 +0100)] 
Merge pull request #18685 from poettering/network-type-tweaks

sd-network.h type tweaks

3 years agorandom-util: fix type of random_u64_range()
Lennart Poettering [Thu, 18 Feb 2021 15:18:51 +0000 (16:18 +0100)] 
random-util: fix type of random_u64_range()

As the name of the function suggests this is supposed to return
uint64_t, of course. Fix it. Not sure how this mistake happened in the
first place...

3 years agoMerge pull request #18546 from poettering/sd-device-action
Lennart Poettering [Thu, 18 Feb 2021 19:54:25 +0000 (20:54 +0100)] 
Merge pull request #18546 from poettering/sd-device-action

export sd_device_get_action() API + more

3 years agohttps://github.com/systemd/systemd/issues/15360
chri2 [Thu, 11 Feb 2021 13:48:50 +0000 (14:48 +0100)] 
https://github.com/systemd/systemd/issues/15360

The additional rules fix a firmware bug in the en keyboard of Librem notebooks by Purism.

By doing so the break the keyboard with other layouts which do not have the same bug in their firmware.

3 years agoresolved: improve debug logging on incoming messages a bit
Lennart Poettering [Mon, 16 Nov 2020 20:04:11 +0000 (21:04 +0100)] 
resolved: improve debug logging on incoming messages a bit

3 years agoMerge pull request #18679 from keszybz/rfkill-size-leniency
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 18:53:25 +0000 (19:53 +0100)] 
Merge pull request #18679 from keszybz/rfkill-size-leniency

struct rfkill_event read/write size leniency

3 years agojournald: when we fail to add a new entry to a journal, return the seqno
Lennart Poettering [Wed, 17 Feb 2021 22:11:42 +0000 (23:11 +0100)] 
journald: when we fail to add a new entry to a journal, return the seqno

Fixes: #18005
3 years agoudevadm: after validating action, use our internal string instead of optarg 18546/head
Lennart Poettering [Wed, 10 Feb 2021 21:19:41 +0000 (22:19 +0100)] 
udevadm: after validating action, use our internal string instead of optarg

This doesn't really change anything, but feels nicer, since it abstracts
away what device_action_from_string()/device_action_to_string() do
internally, and always uses a normalized action string (yes, there's no
ambiguity, but it's nice to stay abstract, maybe one day there is
ambiguity around this)

3 years agosd-device: add sd_device_get_action() + sd_device_get_seqnum() + sd_device_new_from_s...
Lennart Poettering [Wed, 10 Feb 2021 21:15:01 +0000 (22:15 +0100)] 
sd-device: add sd_device_get_action() + sd_device_get_seqnum() + sd_device_new_from_stat_rdev()

To make sd-device properly usable for all programs we need to provide an
API for the "action" field of an event, it's one of the most relevant
ones, and it was so far missing.

This also adds sd_device_get_seqnum(), which isn't that interesting,
except for generating pretty debug output, which we use it ourselves
for.

This also makes device_new_from_stat_rdev() public, as it is truly
useful, as we can see in our own uses of it, and I think is fairly
generic to show up in the public APIs.

3 years agoMerge pull request #18664 from poettering/resolved-defrag
Lennart Poettering [Thu, 18 Feb 2021 17:20:36 +0000 (18:20 +0100)] 
Merge pull request #18664 from poettering/resolved-defrag

resolved: many UDP fragmentation tweaks

3 years agosd-device: don't compare pointers with numeric zero
Lennart Poettering [Wed, 10 Feb 2021 21:18:52 +0000 (22:18 +0100)] 
sd-device: don't compare pointers with numeric zero

Our coding style says no to this.

3 years agoMerge pull request #18667 from poettering/resolved-change-notification
Lennart Poettering [Thu, 18 Feb 2021 17:19:09 +0000 (18:19 +0100)] 
Merge pull request #18667 from poettering/resolved-change-notification

resolved: optimize dbus change notification signals a bit

3 years agonetwork: tighten table alignment a bit 18685/head
Lennart Poettering [Thu, 18 Feb 2021 16:56:11 +0000 (17:56 +0100)] 
network: tighten table alignment a bit

3 years agonetwork: suffix types with _t in public headers
Lennart Poettering [Thu, 18 Feb 2021 16:53:56 +0000 (17:53 +0100)] 
network: suffix types with _t in public headers

Apparently, in our current public headers (i.e. those called sd-*.h) we
suffixed typedefs that we use as values with _t, but we didn't do this
for enum typedefs. Fix that while this stuff is not actually public yet.

With this scheme "value typedefs" now end systematically in _t, and
"object typedefs" (i.e. structures that are typically passed around via
pointers and not values) do not.

No code changes, just some renaming.

3 years agoresolved: optimize change notification handling away if bus calls set the same values... 18667/head
Lennart Poettering [Wed, 18 Nov 2020 12:52:59 +0000 (13:52 +0100)] 
resolved: optimize change notification handling away if bus calls set the same values as were already set

Prompted-by: #17577 (but doesn't fix this, since this commit only
handles D-Bus-induced changes, not the ones made via networkd)

3 years agobasic: add set_equal() helper
Lennart Poettering [Wed, 18 Nov 2020 12:48:02 +0000 (13:48 +0100)] 
basic: add set_equal() helper

3 years agoresolved: take fragment size into consideration when determining EDNS0 udp packet... 18664/head
Lennart Poettering [Mon, 16 Nov 2020 20:02:06 +0000 (21:02 +0100)] 
resolved: take fragment size into consideration when determining EDNS0 udp packet size

3 years agoresolved: let's track fragment sizes of servers/retry on fragmenting
Lennart Poettering [Mon, 16 Nov 2020 22:26:37 +0000 (23:26 +0100)] 
resolved: let's track fragment sizes of servers/retry on fragmenting

Fragmenting sucks, let's avoid it. Thus let's start tracking the maximum
fragment size we receive.

Also, let's redo a transaction via TCP if we see fragmenting on UDP, as
effective mitigation against DNS fragment attacks.

3 years agoresolved: tweak how we calculate MTU for sending packets
Lennart Poettering [Mon, 16 Nov 2020 22:27:21 +0000 (23:27 +0100)] 
resolved: tweak how we calculate MTU for sending packets

Let's take all MTU info we possibly have into account, i.e. the one
reported via netlink, as before and the one the socket might now (from
PMTUD and such), clamped by our own ideas.

3 years agoresolved: add udp_header_size() helper
Lennart Poettering [Mon, 16 Nov 2020 20:00:24 +0000 (21:00 +0100)] 
resolved: add udp_header_size() helper

3 years agoresolved: collect incoming fragment size when receiving UDP datagrams
Lennart Poettering [Mon, 16 Nov 2020 13:05:52 +0000 (14:05 +0100)] 
resolved: collect incoming fragment size when receiving UDP datagrams

We can later use this to adapt our announced EDNS buffer size in order
to avoid fragmentation to make the best of large datagrams while still
avoiding he security weaknesses of it.

3 years agoresolved: disable path MTU discovery for UDP traffic
Lennart Poettering [Mon, 16 Nov 2020 13:02:52 +0000 (14:02 +0100)] 
resolved: disable path MTU discovery for UDP traffic

This disables path MTU discovery both for our UDP upstream connections
and our UDP stub, following the suggestions of:

https://blog.apnic.net/2019/07/12/its-time-to-consider-avoiding-ip-fragmentation-in-the-dns/

This more or less follows the model of other DNS servers on this.

3 years agoman: Rename duplicate Credentials section name
Дамјан Георгиевски [Thu, 18 Feb 2021 14:08:48 +0000 (15:08 +0100)] 
man: Rename duplicate Credentials section name

A "Credentials" section name in systemd.exec man page was used
both for User/Group and for actual credentials support in systemd.

Rename the first instance to "User/Group Identity"

3 years agonetworkd-test: reenable dnssec while testing
Lennart Poettering [Mon, 16 Nov 2020 20:06:56 +0000 (21:06 +0100)] 
networkd-test: reenable dnssec while testing

We need to list the synthesized domains as NTAs, otherwise the DNSSEC
validation of course cannot succeed.

Fixes: #10487 #5029
3 years agoMerge pull request #18557 from poettering/enum-force-s64
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 13:16:15 +0000 (14:16 +0100)] 
Merge pull request #18557 from poettering/enum-force-s64

force public enums to be 64bit wide

3 years agonetwork: Add "route_localnet" sysctl support
Susant Sahani [Thu, 18 Feb 2021 08:55:13 +0000 (09:55 +0100)] 
network: Add "route_localnet" sysctl support

3 years agoMerge pull request #18665 from poettering/resolved-fastopen
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 11:55:10 +0000 (12:55 +0100)] 
Merge pull request #18665 from poettering/resolved-fastopen

resolved: use TCP FASTOPEN on the local DNS stub

3 years agoMerge pull request #18625 from bluca/sysext_refactor
Luca Boccassi [Thu, 18 Feb 2021 10:43:08 +0000 (10:43 +0000)] 
Merge pull request #18625 from bluca/sysext_refactor

dissect: parse and store extension-release metadata

3 years agorfkill: use short writes and accept long reads 18679/head
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 09:48:08 +0000 (10:48 +0100)] 
rfkill: use short writes and accept long reads

I'm seeing the following with kernel-core-5.10.16-200.fc33.x86_64:

$ sudo SYSTEMD_LOG_LEVEL=debug build/systemd-rfkill
Reading struct rfkill_event: got 8 bytes.
A new rfkill device has been added with index 0 and type bluetooth.
Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
Found container virtualization none.
rfkill0: Operating on rfkill device 'tpacpi_bluetooth_sw'.
Writing struct rfkill_event successful (8 of 9 bytes).
Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:bluetooth.
Reading struct rfkill_event: got 8 bytes.
A new rfkill device has been added with index 1 and type wwan.
rfkill1: Operating on rfkill device 'tpacpi_wwan_sw'.
Writing struct rfkill_event successful (8 of 9 bytes).
Loaded state '0' from /var/lib/systemd/rfkill/platform-thinkpad_acpi:wwan.
Reading struct rfkill_event: got 8 bytes.
A new rfkill device has been added with index 2 and type bluetooth.
rfkill2: Operating on rfkill device 'hci0'.
Writing struct rfkill_event successful (8 of 9 bytes).
Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:7:1.0:bluetooth.
Reading struct rfkill_event: got 8 bytes.
A new rfkill device has been added with index 3 and type wlan.
rfkill3: Operating on rfkill device 'phy0'.
Writing struct rfkill_event successful (8 of 9 bytes).
Loaded state '0' from /var/lib/systemd/rfkill/pci-0000:04:00.0:wlan.
All events read and idle, exiting.

We were expecting a read of exactly RFKILL_EVENT_SIZE_V1==8 bytes. But the
structure has 9 after [1].

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=14486c82612a177cb910980c70ba900827ca0894

For some reason the kernel does not accept the full structure size, but cuts
the write short after 8 bytes:

static ssize_t rfkill_fop_write(struct file *file, const char __user *buf,
size_t count, loff_t *pos)
{
struct rfkill_event ev;

/* we don't need the 'hard' variable but accept it */
if (count < RFKILL_EVENT_SIZE_V1 - 1)
return -EINVAL;

/*
 * Copy as much data as we can accept into our 'ev' buffer,
 * but tell userspace how much we've copied so it can determine
 * our API version even in a write() call, if it cares.
 */
count = min(count, sizeof(ev));
if (copy_from_user(&ev, buf, count))
return -EFAULT;

... so it should accept the full size. I'm not sure what is going on here.

But we don't care about the extra fields, so let's accept a write as long as
it's at least RFKILL_EVENT_SIZE_V1.

Fixes #18677.

3 years agorfkill: improve error logging
Zbigniew Jędrzejewski-Szmek [Thu, 18 Feb 2021 09:40:16 +0000 (10:40 +0100)] 
rfkill: improve error logging

If we get something of unexpected size, log the sizes. Also, don't log twice.

3 years agoRemove outdated disable_ipv6 docs
Richard Laager [Thu, 18 Feb 2021 07:11:53 +0000 (01:11 -0600)] 
Remove outdated disable_ipv6 docs

This was changed in commit 482efedc081b0c4bf2e77a3dee6b979d9c9a5765,
which was released in v243, to only enable and never disable IPv6.

Signed-off-by: Richard Laager <rlaager@wiktel.com>
3 years agoMerge pull request #18596 from keszybz/systemctl-quiet-legend
Lennart Poettering [Wed, 17 Feb 2021 22:40:04 +0000 (23:40 +0100)] 
Merge pull request #18596 from keszybz/systemctl-quiet-legend

systemctl: hide legends with --quiet, allow overriding

3 years agoMerge pull request #18651 from poettering/einval-followup
Lennart Poettering [Wed, 17 Feb 2021 22:15:50 +0000 (23:15 +0100)] 
Merge pull request #18651 from poettering/einval-followup

two follow-up fixes for the enum einvalification

3 years agonetwork: DHCP option- use correct byteorder
Susant Sahani [Wed, 17 Feb 2021 18:09:25 +0000 (19:09 +0100)] 
network: DHCP option- use correct byteorder

3 years agoMerge pull request #18656 from yuwata/network-nexthop-tiny-cleanups
Lennart Poettering [Wed, 17 Feb 2021 22:14:12 +0000 (23:14 +0100)] 
Merge pull request #18656 from yuwata/network-nexthop-tiny-cleanups

network: nexthop: tiny cleanups

3 years agohwdb: fix indentation
Lennart Poettering [Wed, 17 Feb 2021 18:10:17 +0000 (19:10 +0100)] 
hwdb: fix indentation

a bunch of entries use 2ch instead of 1ch indentation. Fix that.

3 years agoMerge pull request #18662 from yuwata/in-addr-is-set
Lennart Poettering [Wed, 17 Feb 2021 22:13:27 +0000 (23:13 +0100)] 
Merge pull request #18662 from yuwata/in-addr-is-set

in-addr-util: introduce in_addr_is_set() or friends

3 years agosysctl: downgrade warning about excluded keys
Zbigniew Jędrzejewski-Szmek [Wed, 17 Feb 2021 18:46:19 +0000 (19:46 +0100)] 
sysctl: downgrade warning about excluded keys

Our own config generates logs like this:
systemd-sysctl[1280]: Not setting net/ipv4/conf/all/rp_filter (explicit setting exists).
systemd-sysctl[1280]: Not setting net/ipv4/conf/default/rp_filter (explicit setting exists).
systemd-sysctl[1280]: Not setting net/ipv4/conf/all/accept_source_route (explicit setting exists).
systemd-sysctl[1280]: Not setting net/ipv4/conf/default/accept_source_route (explicit setting exists).
systemd-sysctl[1280]: Not setting net/ipv4/conf/all/promote_secondaries (explicit setting exists).
systemd-sysctl[1280]: Not setting net/ipv4/conf/default/promote_secondaries (explicit setting exists).

There is no error and nothing really to see.

3 years agoenv-util: refactor parsing helper for SYSTEMD_SYSEXT_HIERARCHIES out of sysext 18625/head
Luca Boccassi [Tue, 19 Jan 2021 17:11:55 +0000 (17:11 +0000)] 
env-util: refactor parsing helper for SYSTEMD_SYSEXT_HIERARCHIES out of sysext

3 years agoos-util: allow missing VERSION_ID on the host
Luca Boccassi [Fri, 12 Feb 2021 15:30:10 +0000 (15:30 +0000)] 
os-util: allow missing VERSION_ID on the host

Rolling releases, like ArchLinux, do not set VERSION_ID in
their os-release files, so allow matching simply on ID if the host
does not provide anything.

3 years agoos-util: split extension_release_validate out of sysext
Luca Boccassi [Wed, 27 Jan 2021 12:54:15 +0000 (12:54 +0000)] 
os-util: split extension_release_validate out of sysext

3 years agomachine: parse and store extension-release
Luca Boccassi [Wed, 27 Jan 2021 12:59:45 +0000 (12:59 +0000)] 
machine: parse and store extension-release

Follow the same pattern as os-release parsing, and store the key-value
pairs in a strv if found

3 years agodissect: parse, store and show extension-release info
Luca Boccassi [Wed, 27 Jan 2021 13:03:37 +0000 (13:03 +0000)] 
dissect: parse, store and show extension-release info

3 years agodissect: store image name, following usual parsing rules
Luca Boccassi [Wed, 27 Jan 2021 12:57:27 +0000 (12:57 +0000)] 
dissect: store image name, following usual parsing rules

The name of '/foo/bar/baz.raw' name is 'baz'

3 years agoenv-util: add strv_env_pairs_get helper
Luca Boccassi [Wed, 27 Jan 2021 12:51:17 +0000 (12:51 +0000)] 
env-util: add strv_env_pairs_get helper