diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-03-09 10:37:12 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2019-03-12 03:49:53 +0900 |
commit | a7f95575b1ce3ffa0a352165aaacabae2ec059a6 (patch) | |
tree | 7fa927fae2c3cc71af2c2a3b79a1607656442f62 /src/network/networkd-manager.c | |
parent | a7395c867e8fb1b033a5417735341e7116874b74 (diff) | |
download | systemd-a7f95575b1ce3ffa0a352165aaacabae2ec059a6.tar.gz |
network: use device_get_action()
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r-- | src/network/networkd-manager.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index c87f907957..53d1cfb446 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -12,6 +12,7 @@ #include "bus-util.h" #include "conf-parser.h" #include "def.h" +#include "device-private.h" #include "device-util.h" #include "dns-domain.h" #include "fd-util.h" @@ -182,21 +183,21 @@ int manager_connect_bus(Manager *m) { static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *device, void *userdata) { Manager *m = userdata; - const char *action; + DeviceAction action; Link *link = NULL; int r, ifindex; assert(m); assert(device); - r = sd_device_get_property_value(device, "ACTION", &action); + r = device_get_action(device, &action); if (r < 0) { - log_device_debug_errno(device, r, "Failed to get 'ACTION' property, ignoring device: %m"); + log_device_debug_errno(device, r, "Failed to get udev action, ignoring device: %m"); return 0; } - if (!STR_IN_SET(action, "add", "change", "move")) { - log_device_debug(device, "Ignoring udev %s event for device.", action); + if (!IN_SET(action, DEVICE_ACTION_ADD, DEVICE_ACTION_CHANGE, DEVICE_ACTION_MOVE)) { + log_device_debug(device, "Ignoring udev %s event for device.", device_action_to_string(action)); return 0; } @@ -208,7 +209,8 @@ static int manager_udev_process_link(sd_device_monitor *monitor, sd_device *devi r = device_is_renaming(device); if (r < 0) { - log_device_error_errno(device, r, "Failed to determine the device is renamed or not, ignoring '%s' uevent: %m", action); + log_device_error_errno(device, r, "Failed to determine the device is renamed or not, ignoring '%s' uevent: %m", + device_action_to_string(action)); return 0; } if (r > 0) { |