Skip to content

Commit

Permalink
sd-dhcp: do not use detect_container() to guess udev is running or not
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwata committed Jun 11, 2021
1 parent 27fce94 commit 0299dea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsystemd-network/dhcp-identifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0299dea

Please sign in to comment.