diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-09 23:33:50 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-06-12 03:19:08 +0900 |
commit | 0ac655a63b55ab6381dd536d821b3505507cf6d7 (patch) | |
tree | ae279ab385ca597d1d459ea9227a1f33921a5cc3 /src/libsystemd-network/dhcp-identifier.c | |
parent | bd44a727f736d21dd47b5dfbdbe79d21acbdc2a4 (diff) | |
download | systemd-0ac655a63b55ab6381dd536d821b3505507cf6d7.tar.gz |
tree-wide: use sd_device_new_from_ifindex/ifname()
Diffstat (limited to 'src/libsystemd-network/dhcp-identifier.c')
-rw-r--r-- | src/libsystemd-network/dhcp-identifier.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c index 953fef19fa..c3b47ba3c9 100644 --- a/src/libsystemd-network/dhcp-identifier.c +++ b/src/libsystemd-network/dhcp-identifier.c @@ -167,14 +167,12 @@ int dhcp_identifier_set_iaid( const char *name = NULL; uint64_t id; uint32_t id32; + int r; if (detect_container() <= 0) { /* not in a container, udev will be around */ - char ifindex_str[1 + DECIMAL_STR_MAX(int)]; - int r; - xsprintf(ifindex_str, "n%d", ifindex); - if (sd_device_new_from_device_id(&device, ifindex_str) >= 0) { + if (sd_device_new_from_ifindex(&device, ifindex) >= 0) { r = sd_device_get_is_initialized(device); if (r < 0) return r; |