From: Yu Watanabe Date: Wed, 9 Jun 2021 14:41:00 +0000 (+0900) Subject: sd-dhcp: do not use detect_container() to guess udev is running or not X-Git-Tag: v249-rc1~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0299deab53d2a087727a5d04c1500c322c48b63e;p=thirdparty%2Fsystemd.git sd-dhcp: do not use detect_container() to guess udev is running or not --- diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c index c3b47ba3c90..bffd9968249 100644 --- a/src/libsystemd-network/dhcp-identifier.c +++ b/src/libsystemd-network/dhcp-identifier.c @@ -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);