Commit Graph

46181 Commits

Author SHA1 Message Date
Yu Watanabe 2ac7eec3b5 network: fix use of uninitialized value
Follow-up for 6e537f62d7.
2020-07-30 07:38:18 +02:00
Michael Marley b209cff2ad network: Fix "Unknown section 'DHCPv6PrefixDelegation'." message
Follow-up for 99e015e28c
2020-07-30 10:34:47 +09:00
Yu Watanabe c05b8edde0 NEWS: mention about [DHCPv6PrefixDelegation] section
Follow-up for 99e015e28c.
2020-07-30 04:39:53 +09:00
Lennart Poettering dd57cf6444 meson: run 'ninja man/update-man-rules' again 2020-07-30 04:39:33 +09:00
Luca Boccassi 18d7370587 service: add new RootImageOptions feature
Allows to specify mount options for RootImage.
In case of multi-partition images, the partition number can be prefixed
followed by colon. Eg:

RootImageOptions=1:ro,dev 2:nosuid nodev

In absence of a partition number, 0 is assumed.
2020-07-29 17:17:32 +01:00
Luca Boccassi 5511d8c1b9 basic/list: add LIST_JOIN helper
Joins together two lists, tail to head.

a -> b
c -> d

a -> b -> c -> d
2020-07-29 17:12:45 +01:00
Lennart Poettering 6b222c4b02 man: fix link markup 2020-07-30 00:51:41 +09:00
Lennart Poettering b89f5f7b03 units: downgrade Requires= to Wants=
Combining Requires= with Before= doesn't really make sense, since this
means we are requiring something that runs after us, which logically
cannot be fulfilled.

Let's hence downgrade Requires= to Wants= so that the ordering is kept
but no failure propagation implied.
2020-07-29 16:32:45 +02:00
Lennart Poettering 78490efca3 units: upgrade initrd check Conditions to Asserts
It's a bug if an initrd unit is run on the host. Hence let's upgrade the
conditions to asserts.
2020-07-29 16:32:03 +02:00
Lennart Poettering 0cfb490fe9
Merge pull request #16585 from yuwata/network-dhcp6-fixes
network: fix several DHCP6 PD issues, and cleanup DHCP4 and NDISC
2020-07-29 15:59:11 +02:00
Lennart Poettering ee56c072b9
Merge pull request #16590 from keszybz/test-fs-util-relax
Small adjustements to let various tests pass in overloaded Fedora infra and related changes
2020-07-29 15:54:51 +02:00
Lennart Poettering f8528230b3
Merge pull request #16576 from keszybz/bump-tmp-size
Increase /tmp size to 50% of RAM
2020-07-29 15:53:30 +02:00
Gaurav Singh b1d666ac58 test-cgroup-util: Handle result=NULL as empty string
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-07-29 15:36:38 +02:00
Daan De Meyer f649325ba7 firstboot: Update help string with --root-shell options 2020-07-29 15:35:59 +02:00
Zbigniew Jędrzejewski-Szmek c550cb7f8c test-sleep: add more logging, show secure boot mode
In https://bugzilla.redhat.com/show_bug.cgi?id=1858219 a user
reported that hibernation is not supported. This is probably caused
by secure boot, but our current logging does not make this
obvious.
2020-07-29 11:12:13 +02:00
Zbigniew Jędrzejewski-Szmek 02e1eb6d02 NEWS: mention new tmpfs limits 2020-07-29 11:07:29 +02:00
Zbigniew Jędrzejewski-Szmek 362a55fc14 Bump /tmp size back to 50% of RAM
This should be enough to fix https://bugzilla.redhat.com/show_bug.cgi?id=1856514.
But the limit should be significantly higher than 10% anyway. By setting a
limit on /tmp at 10% we'll break many reasonable use cases, even though the
machine would deal fine with a much larger fraction devoted to /tmp.
(In the first version of this patch I made it 25% with the comment that
"Even 25% might be too low.". The kernel default is 50%, and we have been using
that seemingly without trouble since https://fedoraproject.org/wiki/Features/tmp-on-tmpfs.
So let's just make it 50% again.)

See 7d85383edb.

(Another consideration is that we learned from from the whole initiative with
zram in Fedora that a reasonable size for zram is 0.5-1.5 of RAM, and that pretty
much all systems benefit from having zram or zswap enabled. Thus it is reasonable
to assume that it'll become widely used. Taking the usual compression effectiveness
of 0.2 into account, machines have effective memory available of between
1.0 - 0.2*0.5 + 0.5 = 1.4 (for zram sized to 0.5 of RAM) and
1.0 - 0.2*1.5 + 1.5 = 2.2 (for zram 1.5 sized to 1.5 of RAM) times RAM size.
This means that the 10% was really like 7-4% of effective memory.)

A comment is added to mount-util.h to clarify that tmp.mount is separate.
2020-07-29 11:07:04 +02:00
Yu Watanabe 99e015e28c network: rename settings about DHCPv6 Prefix Delegation
Closes #16602.
2020-07-29 05:50:08 +09:00
Yu Watanabe 61c0ef4ff3 network: make RADVPrefixDelegation enum bitfield
This should not change any behavior.
2020-07-29 05:09:42 +09:00
Yu Watanabe ea121d8f25 network: update address infomation even if link is in failed or linger state
As the link may be reconfigured later. If we do not update the address
information, then its setup state or operstate may not be updated
correctly.
2020-07-29 02:05:05 +09:00
Yu Watanabe e55265184b network: do not assume static addresses are configured
link_request_set_routes() is also called when a dynamic address is
configured. At that time, static addresses may not be configured yet.

Fixes #16546.
2020-07-29 02:05:05 +09:00
Yu Watanabe 15797d6a2b network: check at least one dynamic address is assigned when DHCP is enabled 2020-07-29 02:05:05 +09:00
Yu Watanabe 1633c45731 network: dhcp6: drop addresses and delegated prefixes on client stop
Previously, we did not drop addresses and delegated prefixes when
DHCP6 client is stopped.

Fixes #15455.
Fixes #13564.
2020-07-29 02:05:05 +09:00
Yu Watanabe 1c09d84e42 network: rename ipv4ll_address -> ipv4ll_address_configured 2020-07-29 02:05:05 +09:00
Yu Watanabe b0b9776656 network: ndisc: also remove old DNSSL or RDNSS records after an SLAAC address is ready 2020-07-29 02:05:05 +09:00
Yu Watanabe 69203fba70 network: ndisc: remove old addresses and routes after at least one SLAAC address becomes ready
Otherwise, the old addresses will exist in deperecated state.
2020-07-29 02:05:05 +09:00
Yu Watanabe 6e537f62d7 network: dhcp4: release old lease after the new address become ready
Previously, on DHCPv4 address renewal, the old address may be removed
while the new address is not ready yet.

This also simplifies the logic of removing address and routes.
2020-07-29 02:05:05 +09:00
Yu Watanabe 80b0e86084 network: make address/route_configure optionally return created Address/Route object 2020-07-29 02:05:05 +09:00
Yu Watanabe 8eec0b9da5 network: set key destructor in several hash_ops 2020-07-29 02:05:05 +09:00
Yu Watanabe 5f58af25e6 network: make link_check_ready() return earlier if the link is not in 'configuring' state 2020-07-29 02:05:05 +09:00
Yu Watanabe 3336e946da network: ndisc: do not set configured flags when addresses or routes are not assigned yet
Just for safety.
2020-07-29 02:05:05 +09:00
Yu Watanabe 5d8c3ec1e9 network: make link enter failed state if address_update() failed 2020-07-29 02:05:05 +09:00
Yu Watanabe 97f000744f network: introduce callback called when an address becomes ready 2020-07-29 02:05:00 +09:00
Yu Watanabe c9d223e803 test-network: add tests for prefix routes 2020-07-29 01:50:54 +09:00
Yu Watanabe 3606ca659e network: add debug log for configuring address 2020-07-29 01:50:54 +09:00
Lennart Poettering f6ad6248e8 update TODO 2020-07-28 11:25:08 +02:00
Lennart Poettering 39cf0351c5 tree-wide: make use of new relative time events in sd-event.h 2020-07-28 11:24:55 +02:00
Lennart Poettering 4c5e74f71b man: document new relative time APIs in sd-event 2020-07-28 11:24:37 +02:00
Lennart Poettering d6a83dc48a sd-event: add relative timer calls
We frequently want to set a timer relative to the current time. Let's
add an explicit API for this. This not only saves us a few lines of code
everywhere and simplifies things, but also allows us to do correct
overflow checking.
2020-07-28 11:23:41 +02:00
Zbigniew Jędrzejewski-Szmek c21ed6812e test-ndisc-rs: increase timeouts
Timestamp: Mon 2020-07-27 13:50:50 UTC
Monotonic: 985702942708
Hop limit: 64
Flags: <|MANAGED>
Preference: medium
Lifetime: 180
No MTU set
>> Option 3
Valid Lifetime: 500
Preferred Lifetime: 440
Flags: <ONLINK|AUTO>
Prefix Length: 64
Prefix: 2001:db8:dead:beef::
>> Option 25
DNS: 2001:db8:dead:beef::1
Lifetime: 60
>> Option 31
Domain: lab.intra
Lifetime: 60
>> Option 1
Address: 782bcbb36d53
NDISC: Started IPv6 Router Solicitation client
backoff timeout interval  1 3.600s <= 3.987s <= 4.400s
NDISC: Sent Router Solicitation, next solicitation in 3s
backoff timeout interval  2 7.576s <= 8.114s <= 8.374s
NDISC: Sent Router Solicitation, next solicitation in 8s
Assertion 'false' failed at src/libsystemd-network/test-ndisc-rs.c:172, function test_rs_hangcheck(). Aborting.
2020-07-28 10:49:13 +02:00
Zbigniew Jędrzejewski-Szmek 500727c220 test-path: increase timeout
The tests fail in Fedora's koji with a timeout. Let's just bump
the timeout:
--- stderr ---
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-exists.service: Failed to create cgroup /system.slice/kojid.service/path-exists.service: Permission denied
path-exists.service: Succeeded.
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-exists.service: Failed to create cgroup /system.slice/kojid.service/path-exists.service: Permission denied
path-exists.service: Succeeded.
path-exists.path: Succeeded.
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-existsglob.service: Failed to create cgroup /system.slice/kojid.service/path-existsglob.service: Permission denied
path-existsglob.service: Succeeded.
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-existsglob.service: Failed to create cgroup /system.slice/kojid.service/path-existsglob.service: Permission denied
path-existsglob.service: Succeeded.
path-existsglob.path: Succeeded.
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-changed.service: Failed to create cgroup /system.slice/kojid.service/path-changed.service: Permission denied
path-changed.service: Succeeded.
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-changed.service: Failed to create cgroup /system.slice/kojid.service/path-changed.service: Permission denied
path-changed.service: Succeeded.
path-changed.path: Succeeded.
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-modified.service: Failed to create cgroup /system.slice/kojid.service/path-modified.service: Permission denied
path-modified.service: Succeeded.
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-modified.service: Failed to create cgroup /system.slice/kojid.service/path-modified.service: Permission denied
path-modified.service: Succeeded.
path-modified.path: Succeeded.
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-mycustomunit.service: Failed to create cgroup /system.slice/kojid.service/path-mycustomunit.service: Permission denied
path-mycustomunit.service: Succeeded.
path-unit.path: Succeeded.
Failed to connect to system bus: No such file or directory
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-directorynotempty.service: Failed to create cgroup /system.slice/kojid.service/path-directorynotempty.service: Permission denied
path-directorynotempty.service: Succeeded.
-.slice: Failed to enable/disable controllers on cgroup /system.slice/kojid.service, ignoring: Permission denied
path-directorynotempty.service: Failed to create cgroup /system.slice/kojid.service/path-directorynotempty.service: Permission denied
path-directorynotempty.service: Failed to attach to cgroup /system.slice/kojid.service/path-directorynotempty.service: No such file or directory
path-directorynotempty.service: Failed at step CGROUP spawning /bin/true: No such file or directory
path-directorynotempty.service: Main process exited, code=exited, status=219/CGROUP
path-directorynotempty.service: Failed with result 'exit-code'.
Test timeout when testing path-directorynotempty.path
2020-07-28 10:47:15 +02:00
Zbigniew Jędrzejewski-Szmek 933ab8199d test-fs-util: do not assume /dev is always real
When building in Fedora's koji, test-fs-util would fail:
--- command ---
10:18:29 SYSTEMD_LANGUAGE_FALLBACK_MAP='/builddir/build/BUILD/systemd-246-rc2/src/locale/language-fallback-map' PATH='/builddir/build/BUILD/systemd-246-rc2/x86_64-redhat-linux-gnu:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin' SYSTEMD_KBD_MODEL_MAP='/builddir/build/BUILD/systemd-246-rc2/src/locale/kbd-model-map' /builddir/build/BUILD/systemd-246-rc2/x86_64-redhat-linux-gnu/test-fs-util
--- stderr ---
/* test_chase_symlinks */
/* test_unlink_noerrno */
/* test_readlink_and_make_absolute */
/* test_var_tmp */
/* test_dot_or_dot_dot */
/* test_access_fd */
/* test_touch_file */
/* test_unlinkat_deallocate */
/* test_fsync_directory_of_file */
/* test_rename_noreplace */
/* test_path_is_encrypted */
/home encrypted: yes
/var encrypted: yes
/ encrypted: yes
/proc encrypted: no
/sys encrypted: no
/dev encrypted: yes
Assertion 'expect < 0 || ((r > 0) == (expect > 0))' failed at src/test/test-fs-util.c:863, function test_path_is_encrypted_one(). Aborting.
-------

It seems / is encrypted, but /dev is just a normal directory.
2020-07-28 10:39:41 +02:00
Daan De Meyer 31363bd564 firstboot: Check if the given shell exists 2020-07-28 09:58:24 +02:00
Beniamino Galvani af710b535b dhcp6: remove assertions in dhcp6_option_parse_domainname()
Assertions are for programming errors; here the input comes directly
from the DHCP response packet.
2020-07-28 09:09:28 +02:00
Michael Marley 97efde65d8 network: radv: Send RA on newly-added dynamic prefix
When a prefix is delegated to an interface that is already sending
RAs, send an RA immediately to inform clients of the new prefix.
This allows them to start using it immediately instead of waiting
up to nearly 10 minutes (depending on when the last timed RA was
sent).  This type of situation might occur if, for example, an
outage of the WAN connection caused the addresses and prefixes to
be lost and later regained after service was restored.  The
condition for the number of RAs sent being above 0 simultaneously
ensures that RADV is already running and that this code doesn't
send any RAs before the timed RAs have started when the interface
first comes up.
2020-07-27 05:28:33 +09:00
Christian Göttsche c8f12abc73 Fix clang-11 issues
Tested with clang 11.0.0-++20200715043845+0e377e253c1-1~exp1 on Debian sid

../src/network/test-networkd-conf.c:104:56: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
                                           ~~~~~~~~~~~~^~~
../src/network/test-networkd-conf.c:104:56: note: use array indexing to silence this warning
        test_config_parse_duid_rawdata_one(BYTES_0_128 + 2, 0, &(DUID){0, 128, BYTES_1_128});
                                                       ^
                                           &           [  ]
1 warning generated.

../src/test/test-clock.c:52:17: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
                ftruncate(fileno(f), 0);
                ^~~~~~~~~ ~~~~~~~~~~~~
1 warning generated.

(gdb) run
Starting program: systemd/build/test-alloc-util
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
x1: 0x7fffffffd2d0
x2: 0x7fffffffdac0
y: 0x7fffffffd2cc
z: 0x7fffffffd2c0
cleanup2(0x7fffffffd2cc)
cleanup3(0x7fffffffd2c0)
cleanup1(0x7fffffffdac0)
cleanup1(0x7fffffffd2d0)
*** buffer overflow detected ***: terminated

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
        set = {__val = {0, 18446744073709551615, 0, 0, 0, 0, 140737348658240, 140737348659520, 0, 0, 0, 0, 0, 0, 0, 0}}
        pid = <optimized out>
        tid = <optimized out>
        ret = <optimized out>
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x22ff0, sa_sigaction = 0x22ff0}, sa_mask = {__val = {140737349888603, 4217127, 4217127, 4217127, 4217127, 4217383, 0, 0, 0, 0, 143329, 143344, 140737351162752, 8959, 18446744073709551328, 4289072}},
          sa_flags = -138460788, sa_restorer = 0xffffffffffffffff}
        sigs = {__val = {32, 0 <repeats 15 times>}}
        ap = {{gp_offset = 24, fp_offset = 0, overflow_arg_area = 0x7fffffffd280, reg_save_area = 0x7fffffffd210}}
        fd = <optimized out>
        list = <optimized out>
        nlist = <optimized out>
        cp = <optimized out>
No locals.
No locals.
No locals.
No locals.
No locals.
        l = 0
No locals.
        p1 = 0x405500 "\223Nd\n\351\301mA\214\262A\247\306b\276\317\327\353\346k\035\024\273{\276&!kλ\233\217\t\207\276\327\347\351\355\307R\276\063{\235w=\237E\357\277KL\245\374\245\066M\201+\333\064\272\332g>1<@"
        p2 = <optimized out>
        i = <optimized out>
No locals.
2020-07-26 11:32:06 +02:00
Piotr Drąg 116d6d2965 catalog: update Polish translation 2020-07-26 11:28:29 +02:00
Yu Watanabe f527c6fa08 resolvectl: fix older resolved or networkd support to set DNS servers
Fixes #16573.
2020-07-26 11:05:06 +02:00
Yu Watanabe e128723dae
Merge pull request #16566 from poettering/nspawn-osrelease-fixes
nspawn: os-release reorganization, second try
2020-07-24 13:37:31 +09:00
Yu Watanabe a8bd4bab75
Merge pull request #16567 from keszybz/more-news
NEWS and hwdb update for v246-rc2
2020-07-24 13:35:09 +09:00