Yu Watanabe
6796c5a9c4
test-dhcp-server: add tests for static lease
2022-02-01 11:56:22 +09:00
Yu Watanabe
7b5445e74e
test-dhcp-server: add tests for setting static DHCP lease
2022-02-01 11:56:22 +09:00
Yu Watanabe
99e65b7df3
test-dhcp-server: add usual headers
2022-02-01 11:56:22 +09:00
Yu Watanabe
4f3cb2465a
test-dhcp-server: run a test earlier which does not require privilege
2022-02-01 11:56:22 +09:00
Yu Watanabe
4e2319afe4
test-dhcp-server: move sd-event allocation
2022-02-01 11:56:22 +09:00
Yu Watanabe
7e0a8bf1ce
test-dhcp-server: use log_tests_skipped_errno()
2022-02-01 11:56:22 +09:00
Yu Watanabe
8b572f7ab2
sd-dhcp-server: split out logic to ACK request
2022-02-01 11:56:22 +09:00
Yu Watanabe
bd1a3eb65b
sd-dhcp-server: do not assign address reserved for static leases to non-matching clients
...
This fix the root cause of the issue #22253 .
2022-02-01 11:56:22 +09:00
Yu Watanabe
7e98fe05a0
sd-dhcp-server: explicitly refuse when conflicting address is requested
2022-02-01 11:56:22 +09:00
Yu Watanabe
e2ba408084
sd-dhcp-server: do not assign an address from pool when a static lease for the client ID exists
2022-02-01 11:56:22 +09:00
Yu Watanabe
5cc8be890d
sd-dhcp-server: rename get_pool_offset() -> address_is_in_pool()
...
As, the value of pool_offset is not used.
2022-02-01 11:56:22 +09:00
Yu Watanabe
eb5bff9c9d
sd-dhcp-server: rename server_send_nak() -> server_send_nak_or_ignore()
...
And logs error in the function.
2022-02-01 11:56:01 +09:00
Yu Watanabe
8a7d048d1d
sd-dhcp-server: set DHCPLease::server before hashmap_put()
...
Otherwise, if the second push is failed, then the first hashmap contains
dirty entry.
Also, this makes hashmap_remove_value() used when removing leases to
make not wrong lease is removed from the hashmap.
Note, this just hide the root cause of the issue #22253 , which will be
fixed in later commit.
Fixes #22253 .
2022-02-01 11:45:51 +09:00
Yu Watanabe
37e219800f
sd-dhcp-server: fix indentation
2022-02-01 11:45:51 +09:00
Yu Watanabe
48be485b71
sd-dhcp-server: rename argument and add one missing assertion
2022-02-01 11:45:51 +09:00
Yu Watanabe
6277e48fa9
sd-dhcp-server: do not use implicit cast to boolean from integer
2022-02-01 11:45:51 +09:00
Yu Watanabe
a2a801926d
sd-dhcp-server: refuse zero length client ID
2022-02-01 11:45:51 +09:00
Yu Watanabe
0a195d4186
sd-dhcp-server: do not log "STOPPED" when already stopped
2022-02-01 11:45:51 +09:00
Yu Watanabe
fb96111946
network: also use link_reconfigure_impl() to initially assign .network file
2022-02-01 11:38:01 +09:00
Yu Watanabe
bb193d2df2
network: drop tiny wrapper used only one place anymore
2022-02-01 11:37:45 +09:00
Yu Watanabe
3cf58ef316
network: do not free bound_by carrier map on reconfigure
...
Otherwise, if a link enters unmanaged state, then its carrier state does
not propagated to other interfaces.
2022-02-01 11:37:01 +09:00
Yu Watanabe
b69bfa4305
network: do not remove localhost address
...
Managing loopback interfaces by networkd is not recommended, but supporeted.
Even such spurious situation, do not drop the localhost addresses.
2022-02-01 11:30:37 +09:00
Yu Watanabe
259c65f36c
network: move ndisc_flush() to link_stop_engines()
...
As it is not related to any static configs.
2022-02-01 11:30:37 +09:00
Yu Watanabe
a0e99a377a
network: remove only managed configs on reconfigure or carrier lost
...
Otherwise, if the carrir of the non-managed interface is lost, the
configs such as addresses or routes on the interface will be removed by
networkd.
2022-02-01 11:30:37 +09:00
Luca Boccassi
9d67fb0e33
Merge pull request #22175 from keszybz/kernel-install-mkosi-initrd
...
kernel-install: add support for KERNEL_INSTALL_INITRD_GENERATOR and KERNEL_INSTALL_STAGING_AREA
2022-01-31 23:09:46 +00:00
Frantisek Sumsal
e3d1ffcc48
network: s/confiured/configured/
...
A quick typo fix I noticed whilst debugging.
2022-01-31 23:07:41 +00:00
Lennart Poettering
69339ae9f7
tree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses
2022-01-31 23:07:19 +00:00
Lennart Poettering
e5b90b30c2
random-seed: add missing %m in error message
2022-01-31 21:07:13 +00:00
Luca Boccassi
187df3dd91
Merge pull request #22316 from yuwata/network-mac-address-length
...
network: several cleanups related to MAC address length
2022-01-31 14:21:28 +00:00
Luca Boccassi
0ec3af43f2
Merge pull request #22300 from yuwata/bus-fix-error-handling
...
tree-wide: fix bus method error handling
2022-01-31 14:03:00 +00:00
Daan De Meyer
17e2e8073f
boot: Don't require a machine ID to be available
...
Regression introduced in https://github.com/systemd/systemd/pull/21807 .
Fixes #22224
2022-01-31 13:58:06 +00:00
Luca Boccassi
06d4d83fa7
Merge pull request #22274 from yuwata/resolve-comment
...
resolve: cleanups for on_stream_io()
2022-01-31 13:56:04 +00:00
Luca Boccassi
9d6d4c305a
core: don't fail on EEXIST when creating mount point
...
systemd[1016]: Failed to mount /tmp/app1 (type n/a) on /run/systemd/unit-extensions/1 (MS_BIND ): No such file or directory
systemd[1016]: Failed to create destination mount point node '/run/systemd/unit-extensions/1': File exists
2022-01-31 13:53:47 +01:00
Frantisek Sumsal
61b9769bda
core: check argc/argv uncoditionally
...
as `assert()` might be dropped with `-DNDEBUG`.
Follow-up to cf3095a and 1637e75 .
2022-01-31 20:00:40 +09:00
Yu Watanabe
256ce2e889
Merge pull request #21838 from lnussel/logind-refactor
...
Logind shutdown refactor
2022-01-31 19:45:33 +09:00
James Hilliard
e3759ac43a
meson: use bpftool based strip when available
...
This should be useable in bpftool v5.13 or newer based on:
https://github.com/torvalds/linux/commit/d80b2fcbe0a023619e0fc73112f2a02c2662f6ab
2022-01-31 16:42:07 +09:00
Yu Watanabe
c565b65553
network: currently IPv4ACD requires MAC address whose length is ETH_ALEN
2022-01-31 13:10:28 +09:00
Yu Watanabe
218a850268
network: currently RADV requires MAC address whose length is ETH_ALEN
2022-01-31 13:10:28 +09:00
Yu Watanabe
f4ef1c196c
network: disable NDisc for CAN interfaces
...
We already disabled DHCP clients for CAN interfaces.
2022-01-31 13:10:28 +09:00
Yu Watanabe
ba4c7184b3
network: configure NDisc after MAC address is assigned
2022-01-31 13:10:28 +09:00
Yu Watanabe
f42d41cc5f
network: configure DHCP clients after MAC address is assigned
...
Prompted by #20090 .
2022-01-31 13:10:28 +09:00
Frantisek Sumsal
bbe5371345
basic: update CIFS magic
...
Kernel commit dea2903719283c156b53741126228c4a1b40440f exposed (and
renamed) CIFS_MAGIC_NUMBER as CIFS_SUPER_MAGIC along with
SMB2_SUPER_MAGIC.
This fixes the following build fail on current Fedora Rawhide:
```
../src/basic/meson.build:389:8: ERROR: Problem encountered: found unknown filesystem(s) defined in kernel headers:
Filesystem found in kernel header but not in filesystems-gperf.gperf: CIFS_SUPER_MAGIC
Filesystem found in kernel header but not in filesystems-gperf.gperf: SMB2_SUPER_MAGIC
```
2022-01-31 11:50:15 +09:00
Donald Chan
a718364e9d
basic: mac_[selinux,smack]_apply_fd does not work when applying labels
...
Commit a7fdc6c introduced a regression where file descriptors are opened
using O_PATH option. mac_smack_apply_fd() calls fsetxattr() and would fail
with a -EBADF (Bad file descriptor) error.
Use FORMAT_PROC_FD_PATH(fd) to convert the fd back into a full path and
call setxattr() or setfilecon() instead.
Signed-off-by: Donald Chan <hoiho@amazon.com >
2022-01-31 04:43:56 +09:00
Daan De Meyer
5b2d0f9efd
shared: Handle filesystems that don't support hole punching in COPY_HOLES
2022-01-31 04:43:23 +09:00
Yu Watanabe
34905ff7a9
Merge pull request #22294 from evverx/fuzz-dhcp-client
...
tests: fuzz client_handle_offer
2022-01-31 04:41:07 +09:00
Yu Watanabe
cf3095ac2b
core: check if argc > 0 and argv[0] is set
...
Follow-up for 1637e75707 .
2022-01-30 13:07:51 +00:00
Frantisek Sumsal
1637e75707
shared: be extra paranoid and check if argc > 0
...
and also if argv[0] is non-empty as a precaution for issues similar to
CVE-2021-4034.
2022-01-30 17:53:10 +09:00
Frantisek Sumsal
a79da8b3c7
test: make use of strv_isempty()
2022-01-29 22:36:29 +01:00
Frantisek Sumsal
ea1c9d3f69
fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()
2022-01-29 22:34:02 +01:00
Yu Watanabe
80c8c786a3
login: use bus_error_message() at one more place
2022-01-30 05:43:56 +09:00