diff options
author | Boian Bonev <bbonev@ipacct.com> | 2011-11-07 10:22:19 +0530 |
---|---|---|
committer | Boian Bonev <bbonev@ipacct.com> | 2011-11-07 10:22:19 +0530 |
commit | 00fc2f34ee4fd77310e1ed4d1ddacccdb20c473d (patch) | |
tree | 87f0ff5be2d40ab139cb742c4830db1e47183f1e | |
parent | b7543bdfda84c0287dd0d183fa764c9931a4c211 (diff) | |
download | MAC-Telnet-00fc2f34ee4fd77310e1ed4d1ddacccdb20c473d.tar.gz MAC-Telnet-00fc2f34ee4fd77310e1ed4d1ddacccdb20c473d.zip |
fix error handling because get_device_mac return -1 for error, not 0
-rw-r--r-- | devices.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -128,7 +128,7 @@ int get_macs(int sockfd, char *name, int name_len, unsigned char *mac) { strncpy(name, int_cursor->ifa_name, name_len - 1); name[name_len - 1] = '\0'; int_cursor = int_cursor->ifa_next; - if (get_device_mac(sockfd, name, mac)) { + if (get_device_mac(sockfd, name, mac)!=-1) { return 1; } } |