Created
December 28, 2021 16:35
-
-
Save calanor/88f572714b5da25deb87fbda99062a52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/daemon/interface.cpp b/daemon/interface.cpp | |
index fa23019..90dd8e8 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment