]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agonetwork: tc: introduce [QuickFairQueueingClass] section
Yu Watanabe [Wed, 3 Jun 2020 06:07:45 +0000 (15:07 +0900)] 
network: tc: introduce [QuickFairQueueingClass] section

3 years agonetwork: tc: introduce Quick Fair Queueing (QFQ)
Susant Sahani [Thu, 19 Mar 2020 21:41:57 +0000 (22:41 +0100)] 
network: tc: introduce Quick Fair Queueing (QFQ)

3 years agosd-netlink: add netlink properties of Quick Fair Queueing (QFQ)
Susant Sahani [Thu, 19 Mar 2020 21:41:10 +0000 (22:41 +0100)] 
sd-netlink: add netlink properties of Quick Fair Queueing (QFQ)

3 years agoMerge pull request #16048 from poettering/conf-parser-mtime
Yu Watanabe [Tue, 2 Jun 2020 23:25:28 +0000 (08:25 +0900)] 
Merge pull request #16048 from poettering/conf-parser-mtime

conf-parser: automatically pick up newest mtime when parsing configuration files

3 years agocore: set source_mtime after load dropins
Zbigniew Jędrzejewski-Szmek [Sun, 31 May 2020 12:35:40 +0000 (14:35 +0200)] 
core: set source_mtime after load dropins

Dropins may specify SourcePath= too, but we would do the stat only
after loading the main fragment, before loading of the drop-ins.

Fixes #13634.

3 years agoconf-parser: return mtime in config_parse() and friends 16048/head
Lennart Poettering [Tue, 2 Jun 2020 12:55:12 +0000 (14:55 +0200)] 
conf-parser: return mtime in config_parse() and friends

This is a follow-up for 9f83091e3cceb646a66fa9df89de6d9a77c21d86.

Instead of reading the mtime off the configuration files after reading,
let's do so before reading, but with the fd we read the data from. This
is not only cleaner (as it allows us to save one stat()), but also has
the benefit that we'll detect changes that happen while we read the
files.

This also reworks unit file drop-ins to use the common code for
determining drop-in mtime, instead of reading system clock for that.

3 years agoconf-parse: fix pretty bad typo
Lennart Poettering [Tue, 2 Jun 2020 14:49:50 +0000 (16:49 +0200)] 
conf-parse: fix pretty bad typo

3 years agofs-util: add stat_warn_permissions() that operates on struct stat instead of fd
Lennart Poettering [Tue, 2 Jun 2020 14:44:34 +0000 (16:44 +0200)] 
fs-util: add stat_warn_permissions() that operates on struct stat instead of fd

3 years agoMerge pull request #15996 from yuwata/network-dhcp6-route-metric-15295
Lennart Poettering [Tue, 2 Jun 2020 17:29:47 +0000 (19:29 +0200)] 
Merge pull request #15996 from yuwata/network-dhcp6-route-metric-15295

network: add RouteMetric= in [DHCPv6] section

3 years agobasic/efivars: try re-reading efivars without delay first
Zbigniew Jędrzejewski-Szmek [Sun, 31 May 2020 10:16:57 +0000 (12:16 +0200)] 
basic/efivars: try re-reading efivars without delay first

Quoting https://github.com/systemd/systemd/issues/14828#issuecomment-635212615:

> [kernel uses] msleep_interruptible() and that means when the process receives
> any kind of signal masked or not this will abort with EINTR.  systemd-logind
> gets signals from the TTY layer all the time though.

> Here's what might be happening: while logind reads the EFI stuff it gets a
> series of signals from the TTY layer, which causes the read() to be aborted
> with EINTR, which means logind will wait 50ms and retry. Which will be
> aborted again, and so on, until quite some time passed. If we'd not wait for
> the 50ms otoh we wouldn't wait so long, as then on each signal we'd
> immediately retry again.

3 years agofd-util: be more careful with fclose() errnos
Lennart Poettering [Tue, 2 Jun 2020 08:39:25 +0000 (10:39 +0200)] 
fd-util: be more careful with fclose() errnos

This might fix #15859, a bug which I find very puzzling.

3 years agoupdate TODO
Lennart Poettering [Tue, 2 Jun 2020 12:56:08 +0000 (14:56 +0200)] 
update TODO

3 years agotest: temporarily block test 48 on Ubuntu's autopkgtest
Luca Boccassi [Mon, 1 Jun 2020 11:24:10 +0000 (12:24 +0100)] 
test: temporarily block test 48 on Ubuntu's autopkgtest

This test runs fine locally (both on Qemu and nspawn) but sporadically fails on
autopkgtest for some reason.
Disable it while the issue is investigated to reduce noise.

3 years agonetwork: drop an unused function 15996/head
Yu Watanabe [Tue, 2 Jun 2020 06:36:12 +0000 (15:36 +0900)] 
network: drop an unused function

3 years agonetwork: move DHCPv6 related conf parsers to networkd-dhcp6.c
Yu Watanabe [Mon, 1 Jun 2020 04:18:22 +0000 (13:18 +0900)] 
network: move DHCPv6 related conf parsers to networkd-dhcp6.c

3 years agonetwork: set both dhcp_route_metric and dhcp6_route_metric by DHCP.RouteMetric= for...
Yu Watanabe [Mon, 1 Jun 2020 04:08:43 +0000 (13:08 +0900)] 
network: set both dhcp_route_metric and dhcp6_route_metric by DHCP.RouteMetric= for backward compatibility

But [DHCPv4] or [DHCPv6] section take precedence.
This also update so for UseDNS= and UseNTP=.

3 years agonetwork: add DHCPv6.RouteMetric=
Yu Watanabe [Mon, 1 Jun 2020 04:02:16 +0000 (13:02 +0900)] 
network: add DHCPv6.RouteMetric=

Hopefully fixes #15295.

3 years agonetwork: use uint32_t instead of unsigned for route priority
Yu Watanabe [Mon, 1 Jun 2020 04:01:09 +0000 (13:01 +0900)] 
network: use uint32_t instead of unsigned for route priority

3 years agoMerge pull request #16030 from yuwata/network-read-mtime-of-dropin-configs-15521
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jun 2020 13:14:13 +0000 (15:14 +0200)] 
Merge pull request #16030 from yuwata/network-read-mtime-of-dropin-configs-15521

network: also read mtime of drop-in configs

3 years agoMerge pull request #15991 from keszybz/uids-gids-only-decimal
Yu Watanabe [Mon, 1 Jun 2020 08:04:57 +0000 (17:04 +0900)] 
Merge pull request #15991 from keszybz/uids-gids-only-decimal

Only use base 10 for numeric uids/gids

3 years agonetwork: also read mtime of drop-in configs 16030/head
Yu Watanabe [Mon, 1 Jun 2020 05:53:06 +0000 (14:53 +0900)] 
network: also read mtime of drop-in configs

Fixes #15521.

3 years agonetwork: do not propagte error on stat()
Yu Watanabe [Mon, 1 Jun 2020 07:19:50 +0000 (16:19 +0900)] 
network: do not propagte error on stat()

3 years agoudev: single binary replacing udevd and udevadm
Norbert Lange [Tue, 26 May 2020 08:26:12 +0000 (10:26 +0200)] 
udev: single binary replacing udevd and udevadm

Since the separate binaries contain mostly the same code,
this almost halves the size of the installation.

before:
398K /bin/udevadm
391K /lib/systemd/systemd-udevd

after:
431K /bin/udevadm
0    /lib/systemd/systemd-udevd -> ../../bin/udevadm

Fixes: #14200
3 years agonetwork: fix double free in macsec_receive_channel_free()
Yu Watanabe [Fri, 29 May 2020 07:56:09 +0000 (16:56 +0900)] 
network: fix double free in macsec_receive_channel_free()

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

3 years agoMerge pull request #16029 from yuwata/network-wireguard-without-peers-15786
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jun 2020 07:34:04 +0000 (09:34 +0200)] 
Merge pull request #16029 from yuwata/network-wireguard-without-peers-15786

network: configure wireguard without no peers

3 years agoMerge pull request #15990 from jwrdegoede/hwdb-accel-quirks
Zbigniew Jędrzejewski-Szmek [Mon, 1 Jun 2020 06:44:07 +0000 (08:44 +0200)] 
Merge pull request #15990 from jwrdegoede/hwdb-accel-quirks

Hwdb accel quirks

3 years agotest-network: add test for wireguard without peers 16029/head
Yu Watanabe [Mon, 1 Jun 2020 05:23:03 +0000 (14:23 +0900)] 
test-network: add test for wireguard without peers

3 years agonetwork: wireguard: set ListenPort= when no peers are configured
Yu Watanabe [Mon, 1 Jun 2020 05:22:06 +0000 (14:22 +0900)] 
network: wireguard: set ListenPort= when no peers are configured

Closes #15786.

3 years agoMerge pull request #15982 from keszybz/shell-completion-and-help
Yu Watanabe [Mon, 1 Jun 2020 04:50:50 +0000 (13:50 +0900)] 
Merge pull request #15982 from keszybz/shell-completion-and-help

Shell completion and udevd help update

3 years agoMerge pull request #15884 from ssahani/dhcpv6-vendor
Yu Watanabe [Mon, 1 Jun 2020 03:25:54 +0000 (12:25 +0900)] 
Merge pull request #15884 from ssahani/dhcpv6-vendor

DHCPv6: Introduce vendor specific

3 years agoMerge pull request #15993 from mrc0mmand/news-update
Daan De Meyer [Sun, 31 May 2020 19:56:40 +0000 (21:56 +0200)] 
Merge pull request #15993 from mrc0mmand/news-update

NEWS: fix several typos

3 years agotests: add a testcase triggering https://github.com/systemd/systemd/issues/15968
Evgeny Vereshchagin [Sun, 31 May 2020 11:21:16 +0000 (13:21 +0200)] 
tests: add a testcase triggering https://github.com/systemd/systemd/issues/15968

It's just a follow-up to https://github.com/systemd/systemd/pull/15976

3 years agoNEWS: fix several typos 15993/head
Frantisek Sumsal [Sun, 31 May 2020 19:21:44 +0000 (21:21 +0200)] 
NEWS: fix several typos

3 years agobasic/user-util: always use base 10 for user/group numbers 15991/head
Zbigniew Jędrzejewski-Szmek [Sun, 31 May 2020 16:21:09 +0000 (18:21 +0200)] 
basic/user-util: always use base 10 for user/group numbers

We would parse numbers with base prefixes as user identifiers. For example,
"0x2b3bfa0" would be interpreted as UID==45334432 and "01750" would be
interpreted as UID==1000. This parsing was used also in cases where either a
user/group name or number may be specified. This means that names like
0x2b3bfa0 would be ambiguous: they are a valid user name according to our
documented relaxed rules, but they would also be parsed as numeric uids.

This behaviour is definitely not expected by users, since tools generally only
accept decimal numbers (e.g. id, getent passwd), while other tools only accept
user names and thus will interpret such strings as user names without even
attempting to convert them to numbers (su, ssh). So let's follow suit and only
accept numbers in decimal notation. Effectively this means that we will reject
such strings as a username/uid/groupname/gid where strict mode is used, and try
to look up a user/group with such a name in relaxed mode.

Since the function changed is fairly low-level and fairly widely used, this
affects multiple tools: loginctl show-user/enable-linger/disable-linger foo',
the third argument in sysusers.d, fourth and fifth arguments in tmpfiles.d,
etc.

Fixes #15985.

3 years agologinctl: define loop iterators in the loop header
Zbigniew Jędrzejewski-Szmek [Sun, 31 May 2020 15:54:57 +0000 (17:54 +0200)] 
loginctl: define loop iterators in the loop header

3 years agohwdb: Add accel orientation quirk for Trekstor Surftab Twin 10.1 ST10432-8 15990/head
Hans de Goede [Sun, 31 May 2020 14:21:36 +0000 (16:21 +0200)] 
hwdb: Add accel orientation quirk for Trekstor Surftab Twin 10.1 ST10432-8

The Trekstor Surftab Twin 10.1 ST10432-8 accelerometer has its x-axis
inverted, add a quirk for this.

3 years agohwdb: Add accel orientation quirk for Toshiba Encore WT10A tablet
Hans de Goede [Sun, 31 May 2020 08:25:50 +0000 (10:25 +0200)] 
hwdb: Add accel orientation quirk for Toshiba Encore WT10A tablet

Add a quirk to correct the accelerometer orientation on
Toshiba Encore WT10A tablets.

3 years agoudevd: update snippet string 15982/head
Zbigniew Jędrzejewski-Szmek [Sat, 30 May 2020 15:15:20 +0000 (17:15 +0200)] 
udevd: update snippet string

Repeating the unit name in the description is not useful, and "manages devices"
is too cryptic.

3 years agocore: reload cache if it's dirty when starting a UNIT_NOT_FOUND unit
Luca Boccassi [Thu, 7 May 2020 22:26:53 +0000 (23:26 +0100)] 
core: reload cache if it's dirty when starting a UNIT_NOT_FOUND unit

The time-based cache allows starting a new unit without an expensive
daemon-reload, unless there was already a reference to it because of
a dependency or ordering from another unit.
If the cache is out of date, check again if we can load the
fragment.

3 years agoshell-completions: update bootctl
Zbigniew Jędrzejewski-Szmek [Sat, 30 May 2020 14:04:00 +0000 (16:04 +0200)] 
shell-completions: update bootctl

Entries in the completion lists are reordered to follow --help output:
this makes it much easier to see what is missing.

3 years agoMerge pull request #15935 from poettering/cache-more-efi-vars
Zbigniew Jędrzejewski-Szmek [Sat, 30 May 2020 13:44:26 +0000 (15:44 +0200)] 
Merge pull request #15935 from poettering/cache-more-efi-vars

logind + efi-loader: cache more efi vars

3 years agopo: update Brazilian Portuguese translation
Rafael Fontenelle [Sat, 30 May 2020 12:30:39 +0000 (09:30 -0300)] 
po: update Brazilian Portuguese translation

3 years agoMerge pull request #15915 from poettering/journal-external-link
Zbigniew Jędrzejewski-Szmek [Sat, 30 May 2020 13:04:40 +0000 (15:04 +0200)] 
Merge pull request #15915 from poettering/journal-external-link

journal: show external links in log output

3 years agoupdate NEWS
Daan De Meyer [Sat, 30 May 2020 10:52:25 +0000 (12:52 +0200)] 
update NEWS

3 years agosd-dhcp: clean-up of DHCP lease server code
Lennart Poettering [Fri, 29 May 2020 09:26:24 +0000 (11:26 +0200)] 
sd-dhcp: clean-up of DHCP lease server code

This is an attempt to clean-up the DHCP lease server type code a bit. We
now strictly use the same enum everywhere, and store server info in an
array. Moreover, we use the same nomenclature everywhere.

This only makes the changes in the sd-dhcp code. The networkd code is
untouched so far (but should be fixed up like this too. But it's more
complicated since this would then touch actual settings in .network
files).

Note that this also changes some field names in serialized lease files.
But given that these field names have not been part of a released
version of systemd yet, such a change should be ok.

This is pure renaming/refactoring, shouldn't actually change any
behaviour.

3 years agofix_test_function_timeout
Jay Burger [Thu, 21 May 2020 23:08:48 +0000 (18:08 -0500)] 
fix_test_function_timeout

3 years agohwdb: Add accel orientation quirk for Chuwi Hi10 X
Christian Oder [Fri, 29 May 2020 19:43:49 +0000 (21:43 +0200)] 
hwdb: Add accel orientation quirk for Chuwi Hi10 X

Add a quirk to fix the accelerometer orientation on the Chuwi Hi10 X
so that the display is not rotated 90 degree counter clockwise anymore.

3 years agonetwork: L2TP fix crash
Susant Sahani [Sat, 30 May 2020 04:35:28 +0000 (06:35 +0200)] 
network: L2TP fix crash

```
=220358== Invalid read of size 8
==220358==    at 0x452F05: l2tp_session_free (l2tp-tunnel.c:46)
==220358==    by 0x456926: l2tp_tunnel_done (l2tp-tunnel.c:725)
==220358==    by 0x43CF4D: netdev_free (netdev.c:205)
==220358==    by 0x43D045: netdev_unref (netdev.c:210)
==220358==    by 0x4198B7: manager_free (networkd-manager.c:1877)
==220358==    by 0x40D0B3: manager_freep (networkd-manager.h:105)
==220358==    by 0x40DE1C: run (networkd.c:21)
==220358==    by 0x40DE75: main (networkd.c:130)
==220358==  Address 0x5c035d0 is 0 bytes inside a block of size 40 free'd
==220358==    at 0x483A9F5: free (vg_replace_malloc.c:538)
==220358==    by 0x452F87: l2tp_session_free (l2tp-tunnel.c:57)
==220358==    by 0x456857: netdev_l2tp_tunnel_verify (l2tp-tunnel.c:710)
==220358==    by 0x440947: netdev_load_one (netdev.c:738)
==220358==    by 0x441222: netdev_load (netdev.c:851)
==220358==    by 0x419C50: manager_load_config (networkd-manager.c:1934)
==220358==    by 0x40D7BE: run (networkd.c:87)
==220358==    by 0x40DE75: main (networkd.c:130)
==220358==  Block was alloc'd at
==220358==    at 0x4839809: malloc (vg_replace_malloc.c:307)
==220358==    by 0x452A76: malloc_multiply (alloc-util.h:96)
==220358==    by 0x4531E6: l2tp_session_new_static (l2tp-tunnel.c:82)
==220358==    by 0x455C01: config_parse_l2tp_session_id (l2tp-tunnel.c:535)
==220358==    by 0x48E6D72: next_assignment (conf-parser.c:133)
==220358==    by 0x48E77A3: parse_line (conf-parser.c:271)
==220358==    by 0x48E7E4F: config_parse (conf-parser.c:396)
==220358==    by 0x48E80E5: config_parse_many_files (conf-parser.c:453)
==220358==    by 0x48E8490: config_parse_many (conf-parser.c:512)
==220358==    by 0x44089C: netdev_load_one (netdev.c:729)
==220358==    by 0x441222: netdev_load (netdev.c:851)
==220358==    by 0x419C50: manager_load_config (networkd-manager.c:1934)

```

3 years agoMerge pull request #15958 from layderv/master
Daan De Meyer [Sat, 30 May 2020 09:04:14 +0000 (11:04 +0200)] 
Merge pull request #15958 from layderv/master

#15773 add --reboot-arg to systemctl reboot

3 years agoMerge pull request #15975 from mgub/patch-1
Daan De Meyer [Sat, 30 May 2020 09:00:13 +0000 (11:00 +0200)] 
Merge pull request #15975 from mgub/patch-1

Fix typo.

3 years agoFix typo. 15975/head
Michael Gubbels [Fri, 29 May 2020 23:40:39 +0000 (16:40 -0700)] 
Fix typo.

3 years ago#15773 add --reboot-argument to systemctl reboot 15958/head
laydervus [Fri, 29 May 2020 17:15:34 +0000 (13:15 -0400)] 
#15773 add --reboot-argument to systemctl reboot

3 years agostat-util: trivial empty_or_null() tweaks
Lennart Poettering [Fri, 29 May 2020 15:46:40 +0000 (17:46 +0200)] 
stat-util: trivial empty_or_null() tweaks

To small tweaks: /dev/null is definitely a char device. And if we have
the path, to a string base comparison first.

3 years agoCheck ambient set against bounding set prior to applying ambient set
sterlinghughes [Thu, 28 May 2020 20:54:27 +0000 (13:54 -0700)] 
Check ambient set against bounding set prior to applying ambient set

Fixes #15020

3 years agoupdate TODO
Lennart Poettering [Fri, 29 May 2020 16:32:28 +0000 (18:32 +0200)] 
update TODO

3 years agoMerge pull request #15954 from keszybz/unit-file-leak
Lennart Poettering [Fri, 29 May 2020 14:02:53 +0000 (16:02 +0200)] 
Merge pull request #15954 from keszybz/unit-file-leak

Fix leak in unit path cache and another small optimization

3 years agoefi: add more logging for all EFI variable reads 15935/head
Lennart Poettering [Wed, 27 May 2020 15:30:29 +0000 (17:30 +0200)] 
efi: add more logging for all EFI variable reads

3 years agobootctl: add simple, low-level reboot-to-firmware verb for controlling the flag
Lennart Poettering [Wed, 27 May 2020 15:22:29 +0000 (17:22 +0200)] 
bootctl: add simple, low-level reboot-to-firmware verb for controlling the flag

3 years agobootctl: show reboot-to-firmware info, too
Lennart Poettering [Wed, 27 May 2020 14:34:16 +0000 (16:34 +0200)] 
bootctl: show reboot-to-firmware info, too

3 years agoefi: cache OsIndications too
Lennart Poettering [Wed, 27 May 2020 14:24:33 +0000 (16:24 +0200)] 
efi: cache OsIndications too

3 years agoefi: explicitly update mtime of EFI variables when changing them
Lennart Poettering [Wed, 27 May 2020 15:22:46 +0000 (17:22 +0200)] 
efi: explicitly update mtime of EFI variables when changing them

3 years agoefi: as extra paranoia NUL terminate UTF-16 strings with three NUL bytes
Lennart Poettering [Wed, 27 May 2020 14:22:07 +0000 (16:22 +0200)] 
efi: as extra paranoia NUL terminate UTF-16 strings with three NUL bytes

This is a safey net anyway, let's make it fully safe: if the data ends
on an uneven byte, then we need to complete the UTF-16 codepoint first,
before adding the final NUL byte pair. Hence let's suffix with three
NULs, instead of just two.

3 years agoefi: cache OsIndicationsSupported
Lennart Poettering [Tue, 26 May 2020 20:26:28 +0000 (22:26 +0200)] 
efi: cache OsIndicationsSupported

As suggested by:

https://github.com/systemd/systemd/issues/14828#issuecomment-634202054

3 years agoefi: avoid weirdly double }} by indenting differently
Lennart Poettering [Tue, 26 May 2020 20:25:54 +0000 (22:25 +0200)] 
efi: avoid weirdly double }} by indenting differently

3 years agoefi: cache LoaderEntries EFI variable
Lennart Poettering [Tue, 26 May 2020 20:24:02 +0000 (22:24 +0200)] 
efi: cache LoaderEntries EFI variable

Based-on:

https://github.com/systemd/systemd/issues/14828#issuecomment-634202054

3 years agoREADME: add a Fossies codespell badge
Evgeny Vereshchagin [Fri, 29 May 2020 11:35:11 +0000 (13:35 +0200)] 
README: add a Fossies codespell badge

I keep forgetting where the report is. Hopefully the badge will
make it easier to find it. I also fixed several typos codespell
found along the way.

3 years agonetwork: fix memleaks
Yu Watanabe [Fri, 29 May 2020 08:23:00 +0000 (17:23 +0900)] 
network: fix memleaks

Fixes #15951.

3 years agonetwork: clean up doubled white space
Yu Watanabe [Fri, 29 May 2020 08:00:30 +0000 (17:00 +0900)] 
network: clean up doubled white space

3 years agonetwork: dhcp6 - fix memory leak 15884/head
Susant Sahani [Fri, 22 May 2020 06:53:36 +0000 (08:53 +0200)] 
network: dhcp6 - fix memory leak

3 years agonetwork: Inroduce DHCP6- send vendor options
Susant Sahani [Tue, 26 May 2020 08:46:54 +0000 (10:46 +0200)] 
network: Inroduce DHCP6- send vendor options

network: Inroduce DHCP6- send vendor options

```
 0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      OPTION_VENDOR_OPTS       |           option-len          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       enterprise-number                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                       vendor-option-data                      .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
```

```
  0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          sub-opt-code         |         sub-option-len        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                        sub-option-data                        .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 31: Vendor-specific Options Format

      sub-opt-code         The code for the sub-option.  A 2-octet
                           field.

      sub-option-len       An unsigned integer giving the length of the
                           sub-option-data field in this sub-option in
                           octets.  A 2-octet field.

      sub-option-data      The data area for the sub-option.  The
                           length, in octets, is specified by
                           sub-option-len.

```

3 years agosd-dhcp6: Introduce vendor specific information
Susant Sahani [Fri, 22 May 2020 06:39:14 +0000 (08:39 +0200)] 
sd-dhcp6: Introduce vendor specific information

RFC: 8415
21.17.  Vendor-specific Information Option

   This option is used by clients and servers to exchange vendor-
   specific information.

   The format of the Vendor-specific Information option is:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |      OPTION_VENDOR_OPTS       |           option-len          |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |                       enterprise-number                       |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                       vendor-option-data                      .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

           Figure 30: Vendor-specific Information Option Format

      option-code          OPTION_VENDOR_OPTS (17).

      option-len           4 + length of vendor-option-data field.

      enterprise-number    The vendor's registered Enterprise Number as
                           maintained by IANA [IANA-PEN].  A 4-octet
                           field containing an unsigned integer.

      vendor-option-data   Vendor options, interpreted by
                           vendor-specific code on the clients and
                           servers.  A variable-length field (4 octets
                           less than the value in the option-len field).

 The definition of the information carried in this option is vendor
   specific.  The vendor is indicated in the enterprise-number field.
   Use of vendor-specific information allows enhanced operation,
   utilizing additional features in a vendor's DHCP implementation.  A
   DHCP client that does not receive requested vendor-specific
   information will still configure the node's IPv6 stack to be
   functional.

   The vendor-option-data field MUST be encoded as a sequence of
   code/length/value fields of format identical to the DHCP options (see
   Section 21.1).  The sub-option codes are defined by the vendor
   identified in the enterprise-number field and are not managed by
   IANA.  Each of the sub-options is formatted as follows:

       0                   1                   2                   3
       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |          sub-opt-code         |         sub-option-len        |
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      .                                                               .
      .                        sub-option-data                        .
      .                                                               .
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Figure 31: Vendor-specific Options Format

      sub-opt-code         The code for the sub-option.  A 2-octet
                           field.

      sub-option-len       An unsigned integer giving the length of the
                           sub-option-data field in this sub-option in
                           octets.  A 2-octet field.

      sub-option-data      The data area for the sub-option.  The
                           length, in octets, is specified by
                           sub-option-len.

   Multiple instances of the Vendor-specific Information option may
   appear in a DHCP message.  Each instance of the option is interpreted
   according to the option codes defined by the vendor identified by the
   Enterprise Number in that option.  Servers and clients MUST NOT send
   more than one instance of the Vendor-specific Information option with
   the same Enterprise Number.  Each instance of the Vendor-specific
   Information option MAY contain multiple sub-options.

A client that is interested in receiving a Vendor-specific
   Information option:

   -  MUST specify the Vendor-specific Information option in an Option
      Request option.

   -  MAY specify an associated Vendor Class option (see Section 21.16).

   -  MAY specify the Vendor-specific Information option with
      appropriate data.

   Servers only return the Vendor-specific Information options if
   specified in Option Request options from clients and:

   -  MAY use the Enterprise Numbers in the associated Vendor Class
      options to restrict the set of Enterprise Numbers in the
      Vendor-specific Information options returned.

   -  MAY return all configured Vendor-specific Information options.

   -  MAY use other information in the packet or in its configuration to
      determine which set of Enterprise Numbers in the Vendor-specific
      Information options to return.

3 years agoupdate NEWS
Lennart Poettering [Fri, 29 May 2020 08:47:06 +0000 (10:47 +0200)] 
update NEWS

3 years agoman: briefly document the DOCUMENTATION= structure log field 15915/head
Lennart Poettering [Mon, 25 May 2020 17:39:50 +0000 (19:39 +0200)] 
man: briefly document the DOCUMENTATION= structure log field

3 years agologs: strndupa() cannot fail
Lennart Poettering [Mon, 25 May 2020 17:34:51 +0000 (19:34 +0200)] 
logs: strndupa() cannot fail

3 years agojournal: show documentation hyperlink if known in log output
Lennart Poettering [Mon, 25 May 2020 17:34:40 +0000 (19:34 +0200)] 
journal: show documentation hyperlink if known in log output

3 years agopretty-print: export urlify_enabled()
Lennart Poettering [Mon, 25 May 2020 17:33:53 +0000 (19:33 +0200)] 
pretty-print: export urlify_enabled()

3 years agolocale-util: add glyph for external links
Lennart Poettering [Mon, 25 May 2020 17:32:55 +0000 (19:32 +0200)] 
locale-util: add glyph for external links

3 years agocatalog: normalize how we link to documentation
Lennart Poettering [Mon, 25 May 2020 17:32:33 +0000 (19:32 +0200)] 
catalog: normalize how we link to documentation

3 years agonetwork: DHCPv6 Assign delegated prefix to LAN interface
Susant Sahani [Sat, 4 Apr 2020 18:07:18 +0000 (20:07 +0200)] 
network: DHCPv6 Assign delegated prefix to LAN interface

In DHCPv6-PD environment, where WAN interface requests IPv6 via DHCPv6,
receives the address as well as delegated prefixes, with LAN interfaces
serving those delegated prefixes in their router advertisement messages.
The LAN interfaces on the router themselves do not have
the IPv6 addresses assigned by networkd from the prefix it
serves on that interface. Now this patch enables it.

3 years agosd-network: Rectify Advertise Message Processing by a Client
Susant Sahani [Thu, 16 Apr 2020 15:00:29 +0000 (17:00 +0200)] 
sd-network: Rectify Advertise Message Processing by a Client

We need to fix RCC 2215 behaviour with rfc7550 errata
and https://tools.ietf.org/html/rfc8415.

[RFC3315] specifies that a client must ignore an Advertise message if
   a server will not assign any addresses to a client, and [RFC3633]
   specifies that a client must ignore an Advertise message if a server
   returns the NoPrefixAvail status to a requesting router.  Thus, a
   client requesting both IA_NA and IA_PD, with a server that only
   offers either addresses or delegated prefixes, is not supported by
   the current protocol specifications.

   Solution: a client SHOULD accept Advertise messages, even when not
   all IA option types are being offered.  And, in this case, the client
   SHOULD include the not offered IA option types in its Request.  A
   client SHOULD only ignore an Advertise message when none of the
   requested IA options include offered addresses or delegated prefixes.
   Note that ignored messages MUST still be processed for SOL_MAX_RT and
   INF_MAX_RT options as specified in [RFC7083].

   Replace Section 17.1.3 of RFC 3315: (existing errata)

     The client MUST ignore any Advertise message that includes a Status
     Code option containing the value NoAddrsAvail, with the exception
     that the client MAY display the associated status message(s) to the
     user.

   With the following text (which addresses the existing erratum
   [Err2471] and includes the changes made by [RFC7083]):

     The client MUST ignore any Advertise message that contains no
     addresses (IAADDR options encapsulated in IA_NA or IA_TA options)
     and no delegated prefixes (IAPREFIX options encapsulated in IA_PD
     options; see RFC 3633) with the exception that the client:

       - MUST process an included SOL_MAX_RT option (RFC 7083) and
       - MUST process an included INF_MAX_RT option (RFC 7083).

     A client can display any associated status message(s) to the user
     or activity log.

     The client ignoring this Advertise message MUST NOT restart the
     Solicit retransmission timer.

3 years agoMerge pull request #15911 from poettering/unit-name-tighten
Yu Watanabe [Fri, 29 May 2020 06:55:38 +0000 (15:55 +0900)] 
Merge pull request #15911 from poettering/unit-name-tighten

pid1: improve logging when we encounter a path that is too long to be converted into a mount unit name

3 years agosd-device: check netlink netns matches host netns before using monitor
Lennart Poettering [Tue, 26 May 2020 21:27:20 +0000 (23:27 +0200)] 
sd-device: check netlink netns matches host netns before using monitor

Tracking down #15931 confused the hell out of me, since running homed in
gdb from the command line worked fine, but doing so as a service failed.
Let's make this more debuggable and check if we live in the host netns
when allocating a new udev monitor.

This is just debug stuff, so that if things don't work, a quick debug
run will reveal what is going on.

That said, while we are at it, also fix unexpected closing of passed in
fd when failing.

3 years agoMerge pull request #15944 from poettering/sd-path-fixups
Yu Watanabe [Fri, 29 May 2020 06:23:37 +0000 (15:23 +0900)] 
Merge pull request #15944 from poettering/sd-path-fixups

sd-path: some fixups

3 years agoMerge pull request #15942 from poettering/pass-pktinfo
Yu Watanabe [Fri, 29 May 2020 06:23:15 +0000 (15:23 +0900)] 
Merge pull request #15942 from poettering/pass-pktinfo

disable PassCredentials= on networkd netlink socket, enable NETLINK_PKTINFO instead

3 years agoMerge pull request #15956 from poettering/news-v246
Yu Watanabe [Fri, 29 May 2020 06:10:47 +0000 (15:10 +0900)] 
Merge pull request #15956 from poettering/news-v246

start of a NEWS file for v246 and minor assorted fixes

3 years agoMerge pull request #15930 from poettering/udev-no-lock-warn
Yu Watanabe [Fri, 29 May 2020 01:39:14 +0000 (10:39 +0900)] 
Merge pull request #15930 from poettering/udev-no-lock-warn

udev: when the BSD lock on a block device is taken, don't complain

3 years agoMerge pull request #15619 from ddstreet/ignore_carrier_loss_default
Yu Watanabe [Fri, 29 May 2020 01:04:00 +0000 (10:04 +0900)] 
Merge pull request #15619 from ddstreet/ignore_carrier_loss_default

Set IgnoreCarrierLoss= default to value of ConfigureWithoutCarrier=

3 years agoupdate TODO 15944/head
Lennart Poettering [Thu, 28 May 2020 07:38:00 +0000 (09:38 +0200)] 
update TODO

3 years agosd-path: drop "-dir" and "-path" suffixes from path enums
Lennart Poettering [Thu, 28 May 2020 07:28:28 +0000 (09:28 +0200)] 
sd-path: drop "-dir" and "-path" suffixes from path enums

Clean up the naming of the sd-path enums. Previously, the more recently
added fields where named in the form SD_PATH_xyz_DIR and
SD_PATH_xyz_PATH, while the older fields where called just SD_PATH_xyz
and SD_PATH_SEARCH_xyz. Let's clean this up, to come to a more unified
way how we name this stuff.

I opted to stick to the old naming, i.e. dropthe suffixes. It's a bit of
a bike-shedding question of course, but I think there's a good reason to
avoid the additional DIR and PATH suffixes: the enum prefix contains
"PATH" anyway (i.e. "SD_PATH_"), so including PATH twice in each name is
redundant. Moreover, the key difference between the enums with the "dir"
and the "path" in the name is that the latter are *seach* paths, and I
think this is better emphasized by sticking to the "SEARCH" in the name.

Moreover dropping the suffixes makes the identifiers a lot shorter, in
particular in the "systemd-path" list output. And that's always good.

This means the naming pkgconfig file and in sd-path slightly deviate
(though the mapping is very simple), but I think that's OK, given that
this is developer facing and not user facing.

3 years agopath: use ROOTPREFIX properly
Lennart Poettering [Thu, 28 May 2020 07:17:48 +0000 (09:17 +0200)] 
path: use ROOTPREFIX properly

ROOTPREFIX doesn't include the trailing /, hence add it in where needed.

Also, given that sysctl.d/, binfmt.d/, sysusers.d/ are generally
accessed before /var/ is up they should use ROOTPREFIX rather than
PREFIX. Fix that.

3 years agoxdg-autostart: fix two coverity found issues 15956/head
Lennart Poettering [Thu, 28 May 2020 21:34:24 +0000 (23:34 +0200)] 
xdg-autostart: fix two coverity found issues

Fixes: CID#1429003
Fixes: CID#1429004
3 years agohomed: enable userdb too if homed is requested
Lennart Poettering [Thu, 28 May 2020 21:26:24 +0000 (23:26 +0200)] 
homed: enable userdb too if homed is requested

Strictly speaking you can run homed without userdb. But it doesn't
really make much sense: they go hand in hand and implement the same
concepts, just for different sets of users. Let's hence disable both
automatically by default if homed is requested.

(We don't do the reverse: opting into userdbd shouldn't mean that you
are OK with homed.)

And of course, users can always deviate from our defaults easily, and
turn off userbd again right-away if they don't like it, and things will
generally work.

3 years agoudev: catch genuine_random_bytes() failures
Lennart Poettering [Thu, 28 May 2020 21:26:16 +0000 (23:26 +0200)] 
udev: catch genuine_random_bytes() failures

Fixes: CID#1428926
3 years agolibsystemd: properly export new sd_notify_barrier() API call
Lennart Poettering [Thu, 28 May 2020 21:25:51 +0000 (23:25 +0200)] 
libsystemd: properly export new sd_notify_barrier() API call

Follow-up for: 4f07ddfa9bc2242eaa6c288a15b8bce4e4383931

3 years agohwdb: whitespace fix
Lennart Poettering [Thu, 28 May 2020 21:25:33 +0000 (23:25 +0200)] 
hwdb: whitespace fix

3 years agostart NEWS file for v246
Lennart Poettering [Tue, 26 May 2020 20:23:14 +0000 (22:23 +0200)] 
start NEWS file for v246

3 years agotree-wide: remove spurious whitespace
Lennart Poettering [Thu, 28 May 2020 07:17:31 +0000 (09:17 +0200)] 
tree-wide: remove spurious whitespace

3 years agomanager: free the jobs hashmap after we have no jobs 15954/head
Zbigniew Jędrzejewski-Szmek [Thu, 28 May 2020 16:39:27 +0000 (18:39 +0200)] 
manager: free the jobs hashmap after we have no jobs

After a larger transaction, e.g. after bootup, we're left with an empty hashmap
with hundreds of buckets. Long-term, it'd be better to size hashmaps down when
they are less than 1/4 full, but even if we implement that, jobs hashmap is
likely to be empty almost always, so it seems useful to deallocate it once the
jobs count reaches 0.

3 years agocore: define UnitDependency iterators in loops
Zbigniew Jędrzejewski-Szmek [Thu, 28 May 2020 13:25:22 +0000 (15:25 +0200)] 
core: define UnitDependency iterators in loops

Reduced scope of variables is always nice.

3 years agoshared/unit-file: make sure the old hashmaps and sets are freed upon replacement
Zbigniew Jędrzejewski-Szmek [Thu, 28 May 2020 12:58:35 +0000 (14:58 +0200)] 
shared/unit-file: make sure the old hashmaps and sets are freed upon replacement

Possibly fixes #15220. (There might be another leak. I'm still investigating.)

The leak would occur when the path cache was rebuilt. So in normal circumstances
it wouldn't be too bad, since usually the path cache is not rebuilt too often. But
the case in #15220, where new unit files are created in a loop and started, the leak
occurs once for each unit file:

$ for i in {1..300}; do cp ~/.config/systemd/user/test0001.service ~/.config/systemd/user/test$(printf %04d $i).service; systemctl --user start test$(printf %04d $i).service;done