Yu Watanabe
29104ded1c
network: split link_ipv4ll_enabled() into two
...
And move it from networkd-link.[ch] to relevant files.
2022-08-02 03:02:48 +09:00
Yu Watanabe
2d3d0e8f7d
network: drop doubled semicolon
2022-08-02 02:44:37 +09:00
Yu Watanabe
5162b2a1c4
tree-wide: fix typo
2022-08-02 02:43:38 +09:00
Yu Watanabe
3cf9c51e97
test: restart logind before cleaning up sessions
...
Hopefully, fixes #24040 .
2022-07-31 00:15:47 +09:00
Yu Watanabe
54d5c126d3
test: do not restart getty@tty2 automatically
2022-07-31 00:15:47 +09:00
Yu Watanabe
fe9d58b25a
test: terminate session and user on cleanup
2022-07-31 00:15:47 +09:00
Yu Watanabe
a36be3e57f
meson: use 0 for default uids, gids, and time epoch
...
0 UID and GID are special, and should not be acceptable for the settings.
Hence, we can handle 0 as unset.
Strictly speaking, time epoch with 0 is valid, but I guess no one use
0 as a valid value.
2022-07-30 13:58:12 +09:00
Yu Watanabe
574febda6b
core/mount: downgrade log level about several mkdir failures
2022-07-27 01:13:27 +09:00
Yu Watanabe
e5e6b7c225
Revert "core/mount: fail early if directory cannot be created"
...
This reverts commit e4de58c823 .
If mkdir() fails and the path does exist, then the later mount
command fails anyway. Hence, it is not necessary to fail here.
Fixes #24120 .
2022-07-27 01:13:27 +09:00
Yu Watanabe
0a58cd0045
home: drop conflicted headers
...
Fixes #24117 .
2022-07-26 23:41:48 +09:00
Yu Watanabe
52023622d2
homed: fix dbus node enumerator
...
Fixes #24114 .
2022-07-26 23:11:34 +09:00
Yu Watanabe
7c35b78a0b
unit-file: avoid (null) in debugging logs
...
The variable `inst` was set to NULL by TAKE_PTR().
This fixes the following log message:
```
systemd[1]: Unit getty@tty2.service has alias (null).
```
2022-07-24 20:51:27 +09:00
Yu Watanabe
978642b633
Merge pull request #24020 from yuwata/network-rfkill
...
network: fix wlan interface handling when its RF is killed
2022-07-24 13:01:50 +09:00
Yu Watanabe
cd331a6d51
Merge pull request #23828 from yuwata/nfnl-cleanups
...
sd-netlink: several cleanups for netfilter
2022-07-24 13:01:28 +09:00
Yu Watanabe
573bb24df7
sd-netlink: introduce sd_nfnl_{send,call}_batch()
...
This also introduces sd_nfnl_message_new() which can be also used for
non-nftables subsystems.
2022-07-24 00:16:21 +09:00
Yu Watanabe
04d2003718
sd-netlink: do not compare pointer with 0
2022-07-24 00:05:32 +09:00
Yu Watanabe
665bc9e6e2
firewall-util: introduce nfnl_close_expr_container() helper function
...
And merge nfnl_add_expr_lookup_set() and nfnl_add_expr_lookup_map().
2022-07-24 00:05:32 +09:00
Yu Watanabe
df7371708e
sd-netlink: merge sd_nfnl_nft_message_{new,del}_setelems_begin()
...
And this makes the new merged function `sd_nfnl_nft_message_new_setelems()`
not open container, as containers should be opened and closed in the
same function in general. Otherwise, it is hard to understand which
level we are in the nested attribute tree.
2022-07-24 00:05:09 +09:00
Yu Watanabe
9d884ac36d
sd-netlink: drop unused sd_nfnl_nft_message_del_table()
2022-07-23 23:52:42 +09:00
Yu Watanabe
2c08455eed
sd-netlink: introduce sd_netlink_message_append_container_data()
2022-07-23 23:52:42 +09:00
Yu Watanabe
64f090a61a
sd-netlink: several cleanups for netfilter
...
- rename family -> nfproto, and other arguments,
- check specified nfproto,
- change type of several function arguments that specify data length,
- add several assertions,
- drop unnecessary headers.
2022-07-23 23:52:42 +09:00
Yu Watanabe
35cca046cf
firewall-util: drop unnecessary string attribute
...
As `sd_netlink_message_open_container_union()` also appends the string
attribute.
2022-07-23 23:52:42 +09:00
Yu Watanabe
295942cb46
firewall-util-nft: various cleanups
...
- add missing assertions,
- align enum elements,
- use cleanup attribute, and so on.
2022-07-23 23:52:35 +09:00
Yu Watanabe
8547260579
tree-wide: drop unnecessary inclusion of netlink-util.h
2022-07-23 23:31:23 +09:00
Yu Watanabe
13c026ca83
sd-netlink: move rtnl_message_type_is_*() to netlink-message-rtnl.c
2022-07-23 23:31:23 +09:00
Yu Watanabe
a9d2d037ee
network: do not try to bring up wifi interface if rfkill is active
...
This fixes the following error:
---
systemd-networkd[465]: wlan0: Could not bring up interface: Operation not possible due to RF-kill
---
Fixes #23649 .
2022-07-23 20:55:03 +09:00
Yu Watanabe
8642e04b78
network: also assign rfkill device to Wiphy object
...
Preparation for later commits.
2022-07-23 20:55:03 +09:00
Yu Watanabe
c49d536295
network: assign corresponding sd-device object to Wiphy object
...
As an analogy for Link object, let's each Wiphy object has the
corresponding sd-device object. The sd-device object will be used in
later commits.
2022-07-23 20:55:02 +09:00
Yu Watanabe
fc85b32302
network: set wiphy name in wiphy_new()
...
Then, we can assume all Wiphy objects managed by Manager has both valid
index and name.
2022-07-23 20:53:06 +09:00
Yu Watanabe
71cdfe16aa
network: add TODO about interface renaming
2022-07-23 20:04:28 +09:00
Yu Watanabe
75255a8d43
network: unref sd-device object assigned to Link on remove uevent
...
Otherwise, outdated device information may be used in a short timespan.
2022-07-23 20:04:28 +09:00
Yu Watanabe
1fd3ac1eef
network: introduce a tiny wrapper for manager_udev_process_link()
...
Preparation for later commits.
2022-07-23 20:04:22 +09:00
Yu Watanabe
8de56fb3e0
network: rename Link.sd_device -> Link.dev
2022-07-23 20:00:44 +09:00
Yu Watanabe
32ab27afe8
test-network: reload udevd when .link file is copied/removed
2022-07-23 15:05:22 +09:00
Yu Watanabe
009b2c3ac1
udev-builtin: logs when needs reloading
2022-07-23 15:05:22 +09:00
Yu Watanabe
e9d1fae3bb
udev: reload rules and builtins only when mtime of a config changed
...
This makes udevd reload rules only when the timestamp is updated,
even on SIGHUP or `udevadm control --reload`.
So, we can call `udevadm control --reload` without huge performance
penalty when no rules, .link files, and so on are changed.
2022-07-23 15:05:22 +09:00
Yu Watanabe
acfbd71ccc
udev: save stats of all udev rules file
...
The mtime of directory is not updated when an existing rule file is
changed. Hence, paths_check_timestamp() is not reliable.
2022-07-23 15:05:22 +09:00
Yu Watanabe
3f4dfd9d87
conf-parser: add a boolean flag for config_get_stats_by_path() to control if drop-in configs are checked
...
Preparation for later commits.
2022-07-23 15:03:48 +09:00
Yu Watanabe
d7bddfa109
udev: delay to start queued events on udevadm control --start-exec-queue
2022-07-23 14:08:40 +09:00
Yu Watanabe
8e543eb86a
udev: use event_reset_time_relative()
2022-07-23 14:08:40 +09:00
Yu Watanabe
6e40ed5325
udev: downgrade error level and mention that the error is ignored
2022-07-23 14:08:40 +09:00
Yu Watanabe
298316ebdf
udev: fix error check
2022-07-23 14:08:40 +09:00
Yu Watanabe
853188db90
network: use device_unref_and_replace()
2022-07-23 08:17:43 +09:00
Yu Watanabe
d6985e76f2
sd-device: introduce device_unref_and_replace()
2022-07-23 08:16:38 +09:00
Yu Watanabe
5eb83e9000
sd-device: introduce device_clear_sysattr_cache()
2022-07-23 08:11:36 +09:00
Yu Watanabe
2829fca249
sd-device: introduce device_get_sysattr_bool()
2022-07-23 08:11:36 +09:00
Yu Watanabe
b05e52000b
network: do not silently stop to process configuration on activation failure
...
Previously, if activation failed, link did not enter the failed state,
but still Link.activated flag not set. Hence, nothing processed even if
the interface is manually brought up later.
Partially fixes #23649 .
2022-07-23 08:11:36 +09:00
Yu Watanabe
c9fbe0bd10
Merge pull request #24074 from yuwata/network-dhcp6-rapid-commit
...
network: dhcp6: re-introduce RapidCommit= setting
2022-07-23 08:10:01 +09:00
Yu Watanabe
8015e25870
test: wait for user service or slice to be finished
...
Hopefully fixes #24040 .
2022-07-22 19:47:09 +00:00
Yu Watanabe
91a7afdeae
test-network: add tests for RapidCommit=
2022-07-22 21:28:24 +09:00
Yu Watanabe
50ee1fec3a
network: dhcp6: re-introduce RapidCommit= setting
...
Previous implementation of disabling rapid commit was broken, and
dropped by 308d01f3c4 .
Let's re-introduce the option in the correct way, as some servers seem
to return borked message when the solicit message contain the rapid
commit option.
Closes #24065 .
2022-07-22 21:28:20 +09:00
Yu Watanabe
4397967f8c
sd-dhcp6-client: introduce sd_dhcp6_client_set_rapid_commit()
2022-07-22 21:26:44 +09:00
Yu Watanabe
b1eaae53a2
test-network: drop unnecessary call of systemctl
...
As the units are not started at that stage.
2022-07-22 10:36:00 +09:00
Yu Watanabe
249b7eccf7
test-network: drop unnecessary default argument
2022-07-22 10:34:33 +09:00
Yu Watanabe
87b308c825
test-network: do not stop/restart udevd and related socket units
...
That's not necessary. Moreover, if the socket units are stopped in
`setUpModule()`, then there exists a short timespan that we cannot call
`udevadm control`, as the control socket may not be opened yet.
If we run whole tests, then the first test is
NetworkctlTests.test_altname, and it calls `udevadm control` in `setUp()`.
Hence, the test may fail.
Fixes https://github.com/systemd/systemd-centos-ci/pull/512#issuecomment-1191591008 .
2022-07-22 10:31:38 +09:00
Yu Watanabe
60f97fee2d
meson: refuse -ffinite-math-only
...
Closes #23610 .
2022-07-21 09:18:13 +09:00
Yu Watanabe
1561db8ac2
json: use fpclassify() or its helper functions
2022-07-21 09:18:13 +09:00
Yu Watanabe
fbccfa95c4
math-util: introduce iszero_safe() and fp_equal()
2022-07-21 09:18:08 +09:00
Yu Watanabe
39229a2a0e
test: use fabs() as the argument is double
...
This also drop unnecessary cast.
2022-07-21 09:06:53 +09:00
Yu Watanabe
e1b45a756f
tree-wide: fix typo
2022-07-20 13:15:37 +09:00
Yu Watanabe
5509518193
Merge pull request #24047 from dtardon/list-users-linger
...
Add linger status to `loginctl list-users`
2022-07-18 15:05:25 +09:00
Yu Watanabe
59159aee20
Merge pull request #24018 from keszybz/generator-cleanups
...
Make generators easier to test, fix various corner issues
2022-07-16 05:11:49 +09:00
Yu Watanabe
c798e1dfee
Merge pull request #24035 from yuwata/sd-event-cleanup
...
sd-event: tiny cleanups
2022-07-16 05:11:00 +09:00
Yu Watanabe
c8e9d15cbf
sd-event: introduce PROTECT_EVENT() macro
2022-07-16 00:42:39 +09:00
Yu Watanabe
76d04c3a34
sd-event: drop redundant code
...
The function `source_io_unregister()` will be anyway called in
`source_disconnect()`.
2022-07-16 00:38:37 +09:00
Yu Watanabe
08894b568f
Merge pull request #24021 from poettering/man-rlimit-comments
...
man: elaborate on the usefulness (and not-so-usefulness) of various process resource limits
2022-07-15 08:28:53 +09:00
Yu Watanabe
3f5ef8aeac
Merge pull request #24019 from yuwata/network-ipv4ll
...
network: refuse 169.254.0.0/24 and 169.254.255.0/24
2022-07-15 07:59:13 +09:00
Yu Watanabe
dfeb5a076a
Merge pull request #24016 from poettering/sysctl-cred-extra
...
sysctl: also process sysctl requests via the "sysctl.extra" credential
2022-07-15 04:20:35 +09:00
Yu Watanabe
72c747e6d1
test-network: add a test case for IPv4LLStartAddress=
2022-07-15 04:01:56 +09:00
Yu Watanabe
d3efcd2def
network: refuse 169.254.0.0/24 and 169.254.255.0/24 for IPv4LLStartAddress=
...
Follow-up for #23927 .
2022-07-15 03:37:09 +09:00
Yu Watanabe
c1dd250f18
Merge pull request #23927 from AndreKalb/feature/ipv4-link-local-start-address
...
network: Feature IPv4 link-local start address
2022-07-15 03:21:26 +09:00
Yu Watanabe
e3979a6256
Merge pull request #23999 from msekletar/revert-background-session-no-user-instance
...
Revert of recent changes in handling of background sessions
2022-07-15 03:18:08 +09:00
Yu Watanabe
b9e4ec500e
network: refuse to configure address or route with 0 valid lifetime
...
Fixes #23625 .
2022-07-14 21:00:05 +09:00
Yu Watanabe
5235d73960
network: fix infinite lifetime handling
2022-07-14 20:56:41 +09:00
Yu Watanabe
def4741bd7
network: use sd_event_now()
2022-07-14 20:55:24 +09:00
Yu Watanabe
3f0dbb0f0c
sd-bus: do not pass NULL when received message with invalid type
...
Fixes #24003 .
2022-07-14 10:08:27 +02:00
Yu Watanabe
68870a46b3
sd-dhcp6-client: fix off-by-one error in parsing dhcp6 options
...
This fixes error in parsing message when the rapid commit option is
located at the end of the message.
Fixes an issure reported in #24002 .
2022-07-14 10:49:18 +09:00
Yu Watanabe
d81b5a191e
sd-dhcp6-client: allow NULL option value when length is zero
2022-07-14 10:49:14 +09:00
Yu Watanabe
50309ff785
sd-dhcp6-client: add more debugging logs on parsing message
2022-07-14 09:31:04 +09:00
Yu Watanabe
a5a8714187
Merge pull request #23882 from dtardon/logind-set-display-test
...
Add tests for org.freedesktop.login1.Session SetType and SetDisplay
2022-07-14 07:35:23 +09:00
Yu Watanabe
3be64aa462
network: do not set invalid MAC address for non-ethernet interface
2022-07-14 06:52:07 +09:00
Yu Watanabe
56bb67180a
network: NDisc does not require MAC address
...
This effectively revert ba4c7184b3 .
Fixes #23546 .
2022-07-14 06:52:07 +09:00
Yu Watanabe
7e2f684e1f
network: dhcp4: disable DHCPv4 client on interfaces with non-supported types
...
Replaces f42d41cc5f .
2022-07-14 06:52:07 +09:00
Yu Watanabe
8f4f630731
Revert "network: configure DHCP clients after MAC address is assigned"
...
This reverts commit f42d41cc5f .
DHCPv6 client does not require MAC address.
DHCPv4 client will be handled in a different way in a later commit.
Partially fixes #23546 .
2022-07-14 06:51:59 +09:00
Yu Watanabe
f54dce2d4f
test-network: save and restore timezone
...
Several DHCP client tests change the system timezone.
Let's save the current timezone at the beginning, and restore it with
the saved value at the end.
2022-07-13 10:30:48 +02:00
Yu Watanabe
0925c79c9e
Merge pull request #23881 from keszybz/kernel-install-strikes-yet-again
...
kernel-install: fix invocation as installkernel, add tests, tweak documentation
2022-07-13 02:44:50 +02:00
Yu Watanabe
e11d0e3925
test-network: wait for L2TP tunnels being removed
...
Fixes #23985 .
2022-07-13 02:36:14 +02:00
Yu Watanabe
12a233265d
Merge pull request #23980 from yuwata/test-network
...
test-network: tiny output improvements
2022-07-12 01:27:36 +02:00
Yu Watanabe
12799947e2
Merge pull request #23972 from yuwata/sd-device
...
sd-device: do not return -ENOENT by sd_device_get_is_initialized()
2022-07-11 22:44:56 +02:00
Yu Watanabe
64d847b886
Merge pull request #23974 from yuwata/align-tables
...
basic: align tables
2022-07-11 22:43:45 +02:00
Yu Watanabe
e755ad61ba
test-network: support to remove routing policy rules with l3mdev flag
2022-07-11 22:39:26 +02:00
Yu Watanabe
b5dac5b0de
test-network: merge stdout and stderr of invoked command by call()
...
Otherwise, the logs may be messed up.
2022-07-11 22:38:21 +02:00
Yu Watanabe
a962d85797
test-network: various cleanups
...
- introduce several helper functions
- do not list unit files, but remove the runtime unit directory in
tearDown().
- do not list used interfaces, but remove all interfaces previously not
exists in tearDown().
- save routes and routing policy rules before running tests, and flush
unnecessary routes and rules in each tearDown() calls.
- drop many time.sleep() calls.
- call tearDown() after each sub tests.
- shorten code.
- several coding style fixes.
- etc, etc...
Hopefully, this improves performance of the test.
2022-07-11 19:57:24 +02:00
Yu Watanabe
286bf3a940
test-network: extend timeout for DHCP lease to be expired
...
Fixes #23964 .
2022-07-11 16:54:45 +02:00
Yu Watanabe
4eb5f1db44
sd-device: shorten code a bit
2022-07-11 15:27:21 +02:00
Yu Watanabe
ef674d0ea3
unit-def: align string tables
2022-07-11 14:19:59 +02:00
Yu Watanabe
5c86cec1f3
virt: align tables
2022-07-11 14:13:33 +02:00
Yu Watanabe
591c186f2f
sd-device: make sd_device_get_is_initialized() not return -ENOENT
2022-07-11 14:08:52 +02:00
Yu Watanabe
0d609349ba
resolve: introduce FORMAT_DNS_RCODE() macro
...
Fixes #23958 .
2022-07-09 19:51:23 +09:00
Yu Watanabe
37611ccb19
test-network: use wait_operstate() at one more place
2022-07-09 12:20:11 +09:00