From 619cc13570307f91229869cc0eafaf179d5b3339 Mon Sep 17 00:00:00 2001 From: calanor Date: Tue, 28 Dec 2021 17:59:20 +0100 Subject: [PATCH] Fixes bad retrun value in get_interface_index --- daemon/interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/interface.cpp b/daemon/interface.cpp index fa23019..2211621 100644 --- a/daemon/interface.cpp +++ b/daemon/interface.cpp @@ -102,7 +102,7 @@ int get_interface_index(const std::string& interface_name) { struct ifreq ifr; ifr.ifr_addr.sa_family = AF_INET; strncpy(ifr.ifr_name, interface_name.c_str(), IFNAMSIZ - 1); - if (ioctl(fd, SIOCGIFADDR, &ifr) < 0) { + if (ioctl(fd, SIOCGIFINDEX, &ifr) < 0) { close(fd); BOOST_LOG_TRIVIAL(warning) << "Cannot retrieve index for interface " << interface_name;