]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agowatchdog: rename special string "infinity" taken by the watchdog timeout options... 20787/head
Franck Bui [Fri, 1 Oct 2021 08:42:11 +0000 (10:42 +0200)] 
watchdog: rename special string "infinity" taken by the watchdog timeout options to "default"

4 years agowatchdog: handle timeout programming errors more safely
Franck Bui [Mon, 27 Sep 2021 08:51:28 +0000 (10:51 +0200)] 
watchdog: handle timeout programming errors more safely

If an error happened while the timeout value was being programmed, the error
was ignored and the watchdog module used the new timeout value whereas the
watchdog device was left with the previous one.

Now in cases of error, the device is now disabled and closed if it wasn't
opened already otherwise the previous timeout value is kept so the device is
still pinged at correct intervals.

4 years agocore: introduce systemd.watchdog_sec=<sec> option
Franck Bui [Fri, 17 Sep 2021 09:11:14 +0000 (11:11 +0200)] 
core: introduce systemd.watchdog_sec=<sec> option

4 years agowatchdog: update the documentation
Franck Bui [Mon, 27 Sep 2021 08:16:09 +0000 (10:16 +0200)] 
watchdog: update the documentation

While at it, split the watchdog section into a few paragraphs to make it easier
to read as it becomes lengthy.

4 years agowatchdog: passing 0 to watchdog_setup now closes the watchdog
Franck Bui [Fri, 17 Sep 2021 13:16:38 +0000 (15:16 +0200)] 
watchdog: passing 0 to watchdog_setup now closes the watchdog

Passing 0 meant "disable the watchdog although still kept it opened". However
this case didn't seem to be useful especially since PID1 closes the device if
it is passed the nul timeout.

Hence let's change the meaning of watchdog_setup(0) to match PID1's behavior
which allows to simplify the code a bit.

Hence this patch also drops enable_watchdog().

4 years agowatchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout...
Franck Bui [Fri, 17 Sep 2021 08:34:35 +0000 (10:34 +0200)] 
watchdog: pass USEC_INFINITY to watchdog_setup() to reuse the programmed timeout value

This patch changes the meaning of USEC_INFINITY value for the watchdog
module.

Previously passing this value was a NOP. It now has a special meaning: it
requests the watchdog module to read the programmed timeout value and reuse it
for pinging the device.

This is mostly useful when the watchdog is started by the firmware and there's
no way to reconfigure the timeout with a different value
afterwards. "RuntimeWatchdogSec=infinity" in system.conf can now be used rather
than putting an arbitrary value that PID1 will fail to set (even if it still
felt back to the programmed timeout).

Please note that "infinity" is not supposed to restore the default value of the
firmware. If the value is changed after booting then "infinity" would simply
reuse the current programmed value. IOW it's a NOP unless the watchdog was
previously closed and in that case it will be reopened and the last programmed
value reused.

4 years agowatchdog: configuring a timeout value might not be supported by the HW
Franck Bui [Thu, 16 Sep 2021 16:46:04 +0000 (18:46 +0200)] 
watchdog: configuring a timeout value might not be supported by the HW

In that case we should hanlde this case more gracefully by reusing the
programmed value.

Fixes: #20683
4 years agowatchdog: minor optimization in watchdog_setup()
Franck Bui [Fri, 17 Sep 2021 07:21:18 +0000 (09:21 +0200)] 
watchdog: minor optimization in watchdog_setup()

4 years agowatchdog: cleanup: create an helper for each ioctl
Franck Bui [Thu, 16 Sep 2021 14:19:05 +0000 (16:19 +0200)] 
watchdog: cleanup: create an helper for each ioctl

No functional changes.

4 years agomount-util: fix fd_is_mount_point() when both the parent and directory are network fs
Franck Bui [Thu, 30 Sep 2021 12:05:36 +0000 (14:05 +0200)] 
mount-util: fix fd_is_mount_point() when both the parent and directory are network fs

The second call to name_to_handle_at_loop() didn't check for the specific
errors that can happen when the parent dir is mounted by nfs and instead of
falling back like it's done for the child dir, fd_is_mount_point() failed in
this case.

4 years agoMerge pull request #20894 from andir/editorconfig
Zbigniew JÄ™drzejewski-Szmek [Fri, 1 Oct 2021 08:51:48 +0000 (10:51 +0200)] 
Merge pull request #20894 from andir/editorconfig

Set maximum line length in editorconfig for C and XML files

4 years agoreduce the fuzz values in evdev hwdb for Asus UX362FA
Lukas Senionis [Thu, 30 Sep 2021 18:31:26 +0000 (21:31 +0300)] 
reduce the fuzz values in evdev hwdb for Asus UX362FA

4 years agoMerge pull request #20777 from benzea/benzea/fix-seccomp-filter
Yu Watanabe [Fri, 1 Oct 2021 06:12:55 +0000 (15:12 +0900)] 
Merge pull request #20777 from benzea/benzea/fix-seccomp-filter

seccomp: Always install filters for native architecture

4 years agonetworkd-test: fix resolved_domain_restricted_dns
Michael Biebl [Thu, 30 Sep 2021 23:00:28 +0000 (01:00 +0200)] 
networkd-test: fix resolved_domain_restricted_dns

megasearch.net was meant to be a non-existing bogus domain, and had been
for a long time. But it seems some domain grabber recently registered
it, and it's an actual thing now:

  $ host megasearch.net
  megasearch.net has address 207.148.248.143

This causes the test to fail randomly.

Use search.example.com instead which yields

  $ host search.example.com
  Host search.example.com not found: 3(NXDOMAIN)

Fixes: #18357
4 years agoMerge pull request #20884 from mrc0mmand/to-shellcheck-or-not-to-shellcheck
Luca Boccassi [Thu, 30 Sep 2021 19:53:00 +0000 (20:53 +0100)] 
Merge pull request #20884 from mrc0mmand/to-shellcheck-or-not-to-shellcheck

tree-wide: the last batch of shellcheck shenanigans

4 years agotest: use a less restrictive portable profile when running w/ sanitizers 20777/head
Frantisek Sumsal [Thu, 30 Sep 2021 12:14:19 +0000 (14:14 +0200)] 
test: use a less restrictive portable profile when running w/ sanitizers

Since f833df3 we now actually use the seccomp rules defined in portable
profiles. However, the default one is too restrictive for sanitizers, as
it blocks certain syscall required by LSan. Mitigate this by using the
'trusted' profile when running TEST-29-PORTABLE under sanitizers.

4 years agoeditorconfig: set maximum line length to 109 for man/*.xml files 20894/head
Andreas Rammhold [Thu, 30 Sep 2021 11:44:26 +0000 (13:44 +0200)] 
editorconfig: set maximum line length to 109 for man/*.xml files

4 years agoeditorconfig: enforce maximum line length in .c and .h files
Andreas Rammhold [Thu, 30 Sep 2021 11:40:51 +0000 (13:40 +0200)] 
editorconfig: enforce maximum line length in .c and .h files

4 years agoci: introduce Super-Linter for shell scripts 20884/head
Frantisek Sumsal [Wed, 29 Sep 2021 20:08:51 +0000 (22:08 +0200)] 
ci: introduce Super-Linter for shell scripts

See: https://github.com/marketplace/actions/super-linter

4 years agotools: shellcheck-ify tool scripts
Frantisek Sumsal [Wed, 29 Sep 2021 19:28:55 +0000 (21:28 +0200)] 
tools: shellcheck-ify tool scripts

4 years agotest: shellcheck-ify test scripts
Frantisek Sumsal [Wed, 29 Sep 2021 18:30:08 +0000 (20:30 +0200)] 
test: shellcheck-ify test scripts

4 years agotest: drop an unused file
Frantisek Sumsal [Thu, 30 Sep 2021 10:11:27 +0000 (12:11 +0200)] 
test: drop an unused file

4 years agotest: Add failing/non-failing syscall filter test setting architecture
Benjamin Berg [Fri, 24 Sep 2021 11:35:34 +0000 (13:35 +0200)] 
test: Add failing/non-failing syscall filter test setting architecture

This adds a high level test verifying that syscall filtering in
combination with a simple architecture filter for the "native"
architecture works fine.

4 years agotest: Check that "native" architecture is always filtered
Benjamin Berg [Fri, 17 Sep 2021 12:00:39 +0000 (14:00 +0200)] 
test: Check that "native" architecture is always filtered

4 years agoseccomp: Always install filters for native architecture
Benjamin Berg [Fri, 17 Sep 2021 11:05:32 +0000 (13:05 +0200)] 
seccomp: Always install filters for native architecture

The commit 6597686865ff ("seccomp: don't install filters for archs that
can't use syscalls") introduced a regression where filters may not be
installed for the "native" architecture. This means that setting
SystemCallArchitectures=native for a unit effectively disables the
SystemCallFilter= and SystemCallLog= options.

Conceptually, we have two filter stages:
 1. architecture used for syscall (SystemCallArchitectures=)
 2. syscall + architecture combination (SystemCallFilter=)

The above commit tried to optimize the filter generation by skipping the
second level filtering when it is not required.

However, systemd will never fully block the "native" architecture using
the first level filter. This makes the code a lot simpler, as systemd
can execve() the target binary using its own architecture. And, it
should be perfectly fine as the "native" architecture will always be the
one with the most restrictive seccomp filtering.

Said differently, the bug arises because (on x86_64):
 1. x86_64 is permitted by libseccomp already
 2. native != x86_64
 3. the loop wants to block x86_64 because the permitted set only
    contains "native" (i.e. "native" != "x86_64")
 4. x86_64 is marked as blocked in seccomp_local_archs

Thereby we have an inconsistency, where it is marked as blocked in the
seccomp_local_archs array but it is allowed by libseccomp. i.e. we will
skip generating filter stage 2 without having stage 1 in place.

The fix is simple, we just skip the native architecture when looping
seccomp_local_archs. This way the inconsistency cannot happen.

4 years agodocs: Fixing typo in systemd.device man page and README.
alexlzhu [Wed, 29 Sep 2021 20:41:23 +0000 (13:41 -0700)] 
docs: Fixing typo in systemd.device man page and README.

systemd-udevd.service listens to kernel uevents and is needed for device
units to be available.

systemd-udevd.service is misspelled as systemd-udev.service in a couple places.

Fixing typo.

4 years agoci: shellcheck-ify CI scripts
Frantisek Sumsal [Wed, 29 Sep 2021 17:55:24 +0000 (19:55 +0200)] 
ci: shellcheck-ify CI scripts

4 years agoMerge pull request #20876 from poettering/openssl3-creds
Yu Watanabe [Wed, 29 Sep 2021 19:01:57 +0000 (04:01 +0900)] 
Merge pull request #20876 from poettering/openssl3-creds

creds-util: switch to OpenSSL 3.0 APIs

4 years agoMerge pull request #20883 from bluca/bpf_header_license
Luca Boccassi [Wed, 29 Sep 2021 17:05:28 +0000 (18:05 +0100)] 
Merge pull request #20883 from bluca/bpf_header_license

headers: update bpf_insn.h to dual license

4 years agoMerge pull request #20219 from khfeng/use-intel-hid-rfkill
Lennart Poettering [Wed, 29 Sep 2021 16:53:22 +0000 (18:53 +0200)] 
Merge pull request #20219 from khfeng/use-intel-hid-rfkill

hwdb: Remove intel-hid rfkill mask

4 years agodocs: mention that contributed code must be compatible with GPL-2.0-or-later explicitly 20883/head
Luca Boccassi [Wed, 29 Sep 2021 16:42:51 +0000 (17:42 +0100)] 
docs: mention that contributed code must be compatible with GPL-2.0-or-later explicitly

4 years agoheaders: update bpf_insn.h to dual license
Luca Boccassi [Wed, 29 Sep 2021 16:40:52 +0000 (17:40 +0100)] 
headers: update bpf_insn.h to dual license

This header is copied from the kernel. It was relicensed from GPL-2.0-only
to GPL-2.0-only OR BSD-2-Clause, so update our SPDX tag accordingly.

For more details and ACKS from all copyright holders authorizing the
license change see:

https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git/commit/?id=d75fe9cb1dd062684c9fb8a4581738170365dc06

4 years agocore/mount: add implicit unit dependencies even if when mount unit is generated from...
Yu Watanabe [Sun, 29 Aug 2021 12:20:43 +0000 (21:20 +0900)] 
core/mount: add implicit unit dependencies even if when mount unit is generated from /proc/self/mountinfo

Hopefully fixes #20566.

4 years agoMerge pull request #20824 from yuwata/sd-dhcp6-client-cleanups
Yu Watanabe [Wed, 29 Sep 2021 15:08:16 +0000 (00:08 +0900)] 
Merge pull request #20824 from yuwata/sd-dhcp6-client-cleanups

sd-dhcp6-client: several cleanups for parsing options

4 years agoMerge pull request #20226 from yuwata/network-introduce-source-and-status
Yu Watanabe [Wed, 29 Sep 2021 15:06:17 +0000 (00:06 +0900)] 
Merge pull request #20226 from yuwata/network-introduce-source-and-status

network: introduce NetworkConfigSource and NetworkConfigState

4 years agoMerge pull request #20871 from mrc0mmand/udevadm-property-value
Yu Watanabe [Wed, 29 Sep 2021 15:05:02 +0000 (00:05 +0900)] 
Merge pull request #20871 from mrc0mmand/udevadm-property-value

udev: teach udevadm --property=NAME and --value options

4 years agoMerge pull request #20877 from yuwata/network-test-mode
Yu Watanabe [Wed, 29 Sep 2021 15:04:41 +0000 (00:04 +0900)] 
Merge pull request #20877 from yuwata/network-test-mode

network: do not update state files when running in test mode

4 years agodoc: network: Move "Independent=" flag to the VXLAN section (#20881)
Marcel Menzel [Wed, 29 Sep 2021 14:19:20 +0000 (16:19 +0200)] 
doc: network: Move "Independent=" flag to the VXLAN section (#20881)

4 years agoMerge pull request #20823 from mrc0mmand/test-storage-iscsi
Yu Watanabe [Wed, 29 Sep 2021 14:17:43 +0000 (23:17 +0900)] 
Merge pull request #20823 from mrc0mmand/test-storage-iscsi

test: iSCSI-related udev tests

4 years agohwdb: sensors: Fix some modalias matches no longer working with newer kernels
Hans de Goede [Tue, 31 Aug 2021 13:49:33 +0000 (15:49 +0200)] 
hwdb: sensors: Fix some modalias matches no longer working with newer kernels

Kernels >= 5.8 have added new fields to the dmi/id/modalias file in the
middle of the modalias (instead of adding them at the end).

Specifically new ":br<value>:" and (optional) ":efr<value>:" fields have
been added between the ":bd<value>:" and ":svn<value>:" fields.

Note the 5.13.0 and 5.14.0 kernels also added a new ":sku<value>:" field
between the ":pvr<value>:" and ":rvn<value>:" fields, this has been fixed
in later 5.13.y and 5.14.y releases, by moving the sku field to the end:
https://lore.kernel.org/lkml/20210831130508.14511-1-hdegoede@redhat.com/

Unfortunately the same cannot be done for the new br and efr fields since
those have been added more then a year ago and hwdb even already has some
newer entries relying on the new br field being there (and thus not working
with older kernels).

Fix the issue with the br and efr fields through the following changes:

1. Replace any matches on ":br<value>" from newer entries with an '*'
2. Replace "bd<value>:svn<value>" matches with: "bd<value>:*svn<value>"
   inserting an '*' where newer kernels will have the new br + efr fields

This makes these matches working with old as well as new kernels.

Link: https://github.com/systemd/systemd/issues/20550
Link: https://github.com/systemd/systemd/pull/20562
4 years agoRevert "ci: temporarily set -Wno-deprecated-declarations in Packit" 20876/head
Lennart Poettering [Wed, 29 Sep 2021 12:40:34 +0000 (14:40 +0200)] 
Revert "ci: temporarily set -Wno-deprecated-declarations in Packit"

This reverts commit af861917c5118cb9f1490f407d86f40fd5e01437.

4 years agoopenssl-util: use EVP API to get RSA bits
Lennart Poettering [Wed, 29 Sep 2021 13:03:44 +0000 (15:03 +0200)] 
openssl-util: use EVP API to get RSA bits

4 years agocreds-util: switch to OpenSSL 3.0 APIs
Lennart Poettering [Wed, 29 Sep 2021 07:47:08 +0000 (09:47 +0200)] 
creds-util: switch to OpenSSL 3.0 APIs

Let's switch from the low-level SHA256 APIs to EVP APIs. The former are
deprecated on OpenSSL 3.0, the latter are supported both by old
OpenSSL and by OpenSSL 3.0, hence are the better choice.

Fixes: #20775
4 years agobasic/unit-file: don't filter out names starting with dot
Anita Zhang [Wed, 29 Sep 2021 06:52:39 +0000 (23:52 -0700)] 
basic/unit-file: don't filter out names starting with dot

Fixes #20859
Reverts 3796bdc55d6ba499d1049f749072218879e619a7

4 years agocore: drop "const" from NeedsDaemonReload unit dbus property
Lennart Poettering [Wed, 29 Sep 2021 08:30:17 +0000 (10:30 +0200)] 
core: drop "const" from NeedsDaemonReload unit dbus property

It's not "const", it can change any time if people change the fs, and we
don#t send out notifications for it. Hence don't claim it was const.
(Otherwise clients might cache it, but they should not)

Prompted-by: #20792
4 years agoresolvconf-compat: make "-u" operation a NOP
Lennart Poettering [Wed, 29 Sep 2021 08:48:24 +0000 (10:48 +0200)] 
resolvconf-compat: make "-u" operation a NOP

According to the various man pages of "resolvconf" the -u switch is for:

"-u Just run the update scripts (if updating is enabled)."

"-u Force resolvconf to update all its subscribers. resolvconf does not
    update the subscribers when adding a resolv.conf that matches what
    it already has for that interface."

We have no "subscribers", we ourselves are the only "subscriber" we
support. Hence it's probably better to ignore such a request and make it
a NOP, then to fail.

Fixes: #20748
4 years agoRevert "CI: run unit tests in a network namespace" 20877/head
Yu Watanabe [Wed, 29 Sep 2021 08:37:21 +0000 (17:37 +0900)] 
Revert "CI: run unit tests in a network namespace"

This reverts commit 8b036b223a40fac9e53189db05d3798ec11eb475.

4 years agonetwork: do not configure anything when running in test mode
Yu Watanabe [Wed, 29 Sep 2021 09:19:38 +0000 (18:19 +0900)] 
network: do not configure anything when running in test mode

4 years agonetwork: do not update state files when running in test mode
Yu Watanabe [Wed, 29 Sep 2021 08:32:55 +0000 (17:32 +0900)] 
network: do not update state files when running in test mode

Fixes #20862.

4 years agoMerge pull request #20802 from yuwata/network-receive-nl80211-multicast-messages
Yu Watanabe [Wed, 29 Sep 2021 11:49:38 +0000 (20:49 +0900)] 
Merge pull request #20802 from yuwata/network-receive-nl80211-multicast-messages

network: receive nl80211 multicast messages

4 years agoudev: teach udevadm --property=NAME and --value options 20871/head
Frantisek Sumsal [Tue, 28 Sep 2021 19:18:08 +0000 (21:18 +0200)] 
udev: teach udevadm --property=NAME and --value options

which allows limiting the properties listed by the `--query=property` option
(and optionally listing only the respective values).

4 years agobasic: introduce test_strv_split_and_extend()
Frantisek Sumsal [Wed, 29 Sep 2021 10:46:11 +0000 (12:46 +0200)] 
basic: introduce test_strv_split_and_extend()

4 years agoCI: run GCC unit test job on push to main
Luca Boccassi [Wed, 29 Sep 2021 10:36:22 +0000 (11:36 +0100)] 
CI: run GCC unit test job on push to main

Allows to get coverage data on coveralls.io

4 years agoudev: sort the options alphabetically
Frantisek Sumsal [Tue, 28 Sep 2021 18:08:05 +0000 (20:08 +0200)] 
udev: sort the options alphabetically

4 years agotest: iSCSI-related udev tests 20823/head
Frantisek Sumsal [Wed, 22 Sep 2021 17:26:45 +0000 (19:26 +0200)] 
test: iSCSI-related udev tests

4 years agotest: save journals of only failing test cases in TEST-64
Frantisek Sumsal [Wed, 22 Sep 2021 09:24:48 +0000 (11:24 +0200)] 
test: save journals of only failing test cases in TEST-64

4 years agotest: explicitly report if we fail to install a file into the image
Frantisek Sumsal [Wed, 22 Sep 2021 08:59:52 +0000 (10:59 +0200)] 
test: explicitly report if we fail to install a file into the image

4 years agotest: add an iSCSI helper
Frantisek Sumsal [Tue, 21 Sep 2021 19:32:30 +0000 (21:32 +0200)] 
test: add an iSCSI helper

4 years agotest: sort the features alphabetically
Frantisek Sumsal [Tue, 21 Sep 2021 18:56:24 +0000 (20:56 +0200)] 
test: sort the features alphabetically

4 years agoMerge pull request #20676 from gogsbread/sysctl-minimize-sideeffect
Lennart Poettering [Wed, 29 Sep 2021 07:17:48 +0000 (09:17 +0200)] 
Merge pull request #20676 from gogsbread/sysctl-minimize-sideeffect

sysctl: minimize side effects when running `systemd-sysctl`

4 years agonetwork: receive genl multicast messages about wlan connections 20802/head
Yu Watanabe [Mon, 20 Sep 2021 19:57:43 +0000 (04:57 +0900)] 
network: receive genl multicast messages about wlan connections

4 years agonetwork: move error handling of enumerating configs to caller side
Yu Watanabe [Tue, 21 Sep 2021 23:25:36 +0000 (08:25 +0900)] 
network: move error handling of enumerating configs to caller side

4 years agonetwork: make manager_enumerate_internal() take sd_netlink object
Yu Watanabe [Mon, 20 Sep 2021 19:44:00 +0000 (04:44 +0900)] 
network: make manager_enumerate_internal() take sd_netlink object

Preparation for dumping information through generic netlink.

4 years agonetwork: split manager_new() into two part
Yu Watanabe [Tue, 21 Sep 2021 23:36:11 +0000 (08:36 +0900)] 
network: split manager_new() into two part

Initialize dbus or netlink is not necessary for fuzzers.

4 years agowifi-util: introduce nl80211_cmd_to_string()
Yu Watanabe [Tue, 21 Sep 2021 06:14:59 +0000 (15:14 +0900)] 
wifi-util: introduce nl80211_cmd_to_string()

4 years agonetwork: rename wifi_iftype -> wlan_iftype
Yu Watanabe [Mon, 20 Sep 2021 21:29:29 +0000 (06:29 +0900)] 
network: rename wifi_iftype -> wlan_iftype

4 years agowifi-util: move, rename, and expose wifi_iftype_to_string()
Yu Watanabe [Mon, 20 Sep 2021 21:25:53 +0000 (06:25 +0900)] 
wifi-util: move, rename, and expose wifi_iftype_to_string()

4 years agosd-netlink: add several attributes for nl80211
Yu Watanabe [Mon, 20 Sep 2021 18:18:50 +0000 (03:18 +0900)] 
sd-netlink: add several attributes for nl80211

4 years agosd-netlink, wifi-util: fix attribute type of NL80211_ATTR_SSID
Yu Watanabe [Tue, 21 Sep 2021 17:30:03 +0000 (02:30 +0900)] 
sd-netlink, wifi-util: fix attribute type of NL80211_ATTR_SSID

4 years agowifi-util: add "ret_" prefix for arguments which store results
Yu Watanabe [Tue, 21 Sep 2021 17:49:29 +0000 (02:49 +0900)] 
wifi-util: add "ret_" prefix for arguments which store results

4 years agosd-netlink: introduce sd_netlink_message_read_data_suffix0()
Yu Watanabe [Tue, 21 Sep 2021 17:17:11 +0000 (02:17 +0900)] 
sd-netlink: introduce sd_netlink_message_read_data_suffix0()

4 years agosd-netlink: make sd_genl_message_new() or friends return -EOPNOTSUPP if a module...
Yu Watanabe [Wed, 22 Sep 2021 05:06:31 +0000 (14:06 +0900)] 
sd-netlink: make sd_genl_message_new() or friends return -EOPNOTSUPP if a module is not supported by the kernel

4 years agosd-netlink: also check multicast group to find suitable match callback
Yu Watanabe [Tue, 21 Sep 2021 07:22:29 +0000 (16:22 +0900)] 
sd-netlink: also check multicast group to find suitable match callback

4 years agosd-netlink: allow to set dump flag for genl or netfilter messages
Yu Watanabe [Mon, 20 Sep 2021 20:05:39 +0000 (05:05 +0900)] 
sd-netlink: allow to set dump flag for genl or netfilter messages

4 years agosd-netlink: add type safe macro for sd_genl_add_match()
Yu Watanabe [Mon, 20 Sep 2021 19:42:37 +0000 (04:42 +0900)] 
sd-netlink: add type safe macro for sd_genl_add_match()

4 years agosd-netlink: minor coding style fixes
Yu Watanabe [Tue, 21 Sep 2021 06:27:13 +0000 (15:27 +0900)] 
sd-netlink: minor coding style fixes

4 years agobasic/linux: update nl80211.h
Yu Watanabe [Tue, 21 Sep 2021 06:10:56 +0000 (15:10 +0900)] 
basic/linux: update nl80211.h

4 years agosd-dhcp6-client: rename dhcp6_lease_set_dns() -> dhcp6_lease_add_dns() 20824/head
Yu Watanabe [Fri, 24 Sep 2021 12:03:24 +0000 (21:03 +0900)] 
sd-dhcp6-client: rename dhcp6_lease_set_dns() -> dhcp6_lease_add_dns()

As it is allowed that multiple DNS server options appear in the message.

4 years agosd-dhcp6-client: do not merge NTP and SNTP options
Yu Watanabe [Fri, 24 Sep 2021 06:00:43 +0000 (15:00 +0900)] 
sd-dhcp6-client: do not merge NTP and SNTP options

Previously, SNTP option is ignored when it appears after NTP option(s),
but merged later NTP options when it appears first.
This makes split the NTP and SNTP addresses, and use SNTP addresses only
when no NTP option is provided.

4 years agosd-dhcp6-client: support multiple NTP server options
Yu Watanabe [Fri, 24 Sep 2021 05:09:14 +0000 (14:09 +0900)] 
sd-dhcp6-client: support multiple NTP server options

Also, it is allowed that the suboption appears multiple times, and each
suboption contains one NTP server.

4 years agosd-dhcp6-client: support multiple domains
Yu Watanabe [Fri, 24 Sep 2021 05:16:44 +0000 (14:16 +0900)] 
sd-dhcp6-client: support multiple domains

4 years agosd-dhcp6-client: make dhcp6_lease_free() accepts NULL
Yu Watanabe [Fri, 24 Sep 2021 14:45:13 +0000 (23:45 +0900)] 
sd-dhcp6-client: make dhcp6_lease_free() accepts NULL

4 years agosd-dhcp6-client: drop domains_count and ntp_fqdn_count
Yu Watanabe [Fri, 24 Sep 2021 05:05:29 +0000 (14:05 +0900)] 
sd-dhcp6-client: drop domains_count and ntp_fqdn_count

4 years agosd-dhcp6-client: use dhcp6_option_parse() in client_parse_message()
Yu Watanabe [Fri, 24 Sep 2021 04:35:36 +0000 (13:35 +0900)] 
sd-dhcp6-client: use dhcp6_option_parse() in client_parse_message()

4 years agosd-dhcp6-client: constify several arguments
Yu Watanabe [Fri, 24 Sep 2021 04:34:14 +0000 (13:34 +0900)] 
sd-dhcp6-client: constify several arguments

4 years agosd-dhcp6-client: slightly modernize dhcp6_option_parse_domainname()/domainname_list()
Yu Watanabe [Thu, 23 Sep 2021 18:49:14 +0000 (03:49 +0900)] 
sd-dhcp6-client: slightly modernize dhcp6_option_parse_domainname()/domainname_list()

4 years agosd-dhcp6-client: fix buffer size calculation in dhcp6_option_parse_ip6addrs()
Yu Watanabe [Thu, 23 Sep 2021 16:24:52 +0000 (01:24 +0900)] 
sd-dhcp6-client: fix buffer size calculation in dhcp6_option_parse_ip6addrs()

GREEDY_REALLOC() takes number of elements, not buffer size.

This also rename dhcp6_option_parse_ip6addrs() to
dhcp6_option_parse_addresses().

4 years agosd-dhcp6-client: modernize dhcp6_option_parse_ia()
Yu Watanabe [Thu, 23 Sep 2021 15:50:01 +0000 (00:50 +0900)] 
sd-dhcp6-client: modernize dhcp6_option_parse_ia()

This makes
- the function not update the arguments for storing results on error,
- use dhcp6_option_parse() to parse sub options,
- ignore all errors, except for -ENOMEM, in parsing sub options,
- update log messages.

4 years agosd-dhcp6-client: make dhcp6_option_parse_status() also parse error message
Yu Watanabe [Thu, 23 Sep 2021 07:30:40 +0000 (16:30 +0900)] 
sd-dhcp6-client: make dhcp6_option_parse_status() also parse error message

This also introduce dhcp6_option_parse_ia_options(). Currently, it is
assumed that each IA address or PD prefix may contain a status sub-option.
But it is not prohibited that other sub-options or multiple status
options are contained.

4 years agotest: add tests for reading unaligned data
Yu Watanabe [Mon, 27 Sep 2021 15:48:59 +0000 (00:48 +0900)] 
test: add tests for reading unaligned data

4 years agosd-dhcp6-client: modernize dhcp6_option_parse()
Yu Watanabe [Thu, 23 Sep 2021 05:58:28 +0000 (14:58 +0900)] 
sd-dhcp6-client: modernize dhcp6_option_parse()

- merge dhcp6_option_parse() with option_parse_hdr().
- do not assign/update any values on error.
- use assert() instead of assert_return(), as the assertions cannot
  be triggered by a library user.

4 years agosd-dhcp6-client: constify one argument
Yu Watanabe [Thu, 23 Sep 2021 05:57:29 +0000 (14:57 +0900)] 
sd-dhcp6-client: constify one argument

4 years agosysctl-util: minimize side-effects when running `systemd-sysctl` 20676/head
Antony Deepak Thomas [Wed, 29 Sep 2021 04:07:42 +0000 (13:07 +0900)] 
sysctl-util: minimize side-effects when running `systemd-sysctl`

Currently `systemd-sysctl` binary is used in `systemd-sysctl.service`
which is mostly configured as `oneshot`. There are situations where one
would like to use systemd to maintain Sysctl configurations on a host,
using a configuration managers such as Chef or Puppet, by apply
configurations every X duration.
The problem with using `systemd-sysctl` is that it writes all the Sysctl
settings, even if the values for those settings have not changed. From
experience, we have observed that some Sysctl settings cause actions in
the kernel upon writing(like dropping caches) which in turn cause
undesired side effects.
This patch tries to minimize such side effects by comparing values
before writing.

4 years agofileio: introduce new mode to suppress writing the same value
Antony Deepak Thomas [Wed, 29 Sep 2021 04:06:25 +0000 (13:06 +0900)] 
fileio: introduce new mode to suppress writing the same value

4 years agostring-util: introduce streq_skip_trailing_chars()
Antony Deepak Thomas [Wed, 29 Sep 2021 03:57:30 +0000 (12:57 +0900)] 
string-util: introduce streq_skip_trailing_chars()

4 years agofileio: introduce read_virtual_file_fd()
Antony Deepak Thomas [Wed, 29 Sep 2021 03:47:49 +0000 (12:47 +0900)] 
fileio: introduce read_virtual_file_fd()

4 years agoMerge pull request #20865 from keszybz/meson-net-naming-definitions
Yu Watanabe [Wed, 29 Sep 2021 03:29:14 +0000 (12:29 +0900)] 
Merge pull request #20865 from keszybz/meson-net-naming-definitions

Allow defining new naming scheme entries as configuration time

4 years agocore: fix the return type for xxx_running_timeout() functions
Frantisek Sumsal [Tue, 28 Sep 2021 21:08:32 +0000 (23:08 +0200)] 
core: fix the return type for xxx_running_timeout() functions

otherwise we might return an invalid value, since `usec_t` is 64-bit,
whereas `int` might not be.

Follow-up to: 5918a93
Fixes: #20872
4 years agoMerge pull request #20860 from yuwata/libsystemd-network-get-ifname-negative-errno
Yu Watanabe [Wed, 29 Sep 2021 03:27:01 +0000 (12:27 +0900)] 
Merge pull request #20860 from yuwata/libsystemd-network-get-ifname-negative-errno

libsystemd-network: make sd_dhcp_client_get_ifname() or friends return negative errno

4 years agoMerge pull request #20870 from jwrdegoede/hwdb-2-accel-quirks
Lennart Poettering [Tue, 28 Sep 2021 21:13:54 +0000 (23:13 +0200)] 
Merge pull request #20870 from jwrdegoede/hwdb-2-accel-quirks

Hwdb 2 accel quirks