And drop sd_dhcp_client_get_lease_timestamp().
Also, this introduce sd_dhcp_lease_get_lifetime_timestamp() and friends,
which provides timestamp of the lifetime and so on, while
sd_dhcp_lease_get_lifetime() provides timestamp.
Configuration now takes priority over CLI options so we have to
configure the defaults for settings that we want to allow overriding
from the CLI. We also explicitly set some other settings so that they
can't be overridden from the CLI anymore. For example the base and
initrd image should never be made bootable so we set Bootable=no
explicitly for both.
Otherwise we'll get stuck waiting indefinitely if the test socket unit
fails to fail due the trigger limit, i.e.:
[ 111.104906] testsuite-07.sh[743]: + systemctl start issue2467.socket
[ OK ] Listening on issue2467.socket.
[ 111.746465] testsuite-07.sh[743]: + nc -w20 -U /run/test.ctl
Starting systemd-tmpfiles-clean.service...
[ OK ] Finished systemd-tmpfiles-clean.service.
qemu-system-x86_64: terminating on signal 15 from pid 565814 (timeout)
E: Test timed out after 1800s
With the idle timeout we should give up after 20 seconds, allowing the next
statement to properly fail:
[ 34.233084] testsuite-07.sh[450]: + systemctl start issue2467.socket
[ 35.475392] testsuite-07.sh[450]: + nc -i20 -w20 -U /run/test.ctl
[ 56.122941] testsuite-07.sh[458]: Ncat: Idle timeout expired (20000 ms).
[ 56.140871] testsuite-07.sh[450]: + :
[ 56.145460] testsuite-07.sh[450]: + timeout 10 bash -c 'while ! [[ "$(systemctl show issue2467.socket -P ActiveState)" == failed ]]; do sleep .5; done'
[ 66.197623] testsuite-07.sh[446]: + echo 'Subtest /usr/lib/systemd/tests/testdata/units/testsuite-07.issue-2467.sh failed'
In file included from ../src/basic/macro.h:455,
from ../src/basic/alloc-util.h:10,
from ../src/basic/hash-funcs.h:4,
from ../src/basic/hashmap.h:8,
from ../src/shared/dns-domain.h:10,
from ../src/network/networkd-radv.c:9:
../src/network/networkd-radv.c: In function ‘config_parse_router_home_agent_lifetime’:
../src/network/networkd-radv.c:1626:28: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 11 has type ‘long long unsigned int’ [-Werror=format=]
1626 | "Invalid %s= must be in the range 1...%lu seconds, ignoring: %s", lvalue,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/basic/log.h:361:125: note: in definition of macro ‘log_syntax’
361 | ? log_syntax_internal(unit, _level, config_file, config_line, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
| ^~~~~~~~~~~
../src/network/networkd-radv.c:1626:68: note: format string is defined here
1626 | "Invalid %s= must be in the range 1...%lu seconds, ignoring: %s", lvalue,
| ~~^
| |
| long unsigned int
| %llu
cc1: all warnings being treated as errors
Addresses: https://github.com/systemd/systemd/pull/28964#issuecomment-1705550404
Follow-up to 6a6d27bc5b.
- Rename the argument for storing the sender address,
- allow to call it with NULL for ret_xyz,
- reduce needless copy of timestamp when the message does not have
timestamp.