]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp: do not use detect_container() to guess udev is running or not
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 9 Jun 2021 14:41:00 +0000 (23:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Jun 2021 18:19:08 +0000 (03:19 +0900)
src/libsystemd-network/dhcp-identifier.c

index c3b47ba3c90530b92d1a2a775e15fa10b3dca186..bffd99682499e92306af3ad1175fbb3c8db43409 100644 (file)
@@ -12,6 +12,7 @@
 #include "network-util.h"
 #include "siphash24.h"
 #include "sparse-endian.h"
+#include "stat-util.h"
 #include "stdio-util.h"
 #include "udev-util.h"
 #include "virt.h"
@@ -169,8 +170,8 @@ int dhcp_identifier_set_iaid(
         uint32_t id32;
         int r;
 
-        if (detect_container() <= 0) {
-                /* not in a container, udev will be around */
+        if (path_is_read_only_fs("/sys") <= 0) {
+                /* udev should be around */
 
                 if (sd_device_new_from_ifindex(&device, ifindex) >= 0) {
                         r = sd_device_get_is_initialized(device);