... | ... |
@@ -47,7 +47,7 @@ |
47 | 47 |
#include <ifaddrs.h> |
48 | 48 |
#endif |
49 | 49 |
|
50 |
-#if defined(SIOCGIFHWADDR) |
|
50 |
+#if defined(SIOCGIFHWADDR) && !defined(__GNU__) |
|
51 | 51 |
#if defined(_AIX) |
52 | 52 |
#include <sys/ndd_var.h> |
53 | 53 |
#include <sys/kinfo.h> |
... | ... |
@@ -116,7 +116,7 @@ struct device *get_devices(void) |
116 | 116 |
uint8_t *mac; |
117 | 117 |
int sock; |
118 | 118 |
|
119 |
-#if defined(SIOCGIFHWADDR) |
|
119 |
+#if defined(SIOCGIFHWADDR) && !defined(__GNU__) |
|
120 | 120 |
struct ifreq ifr; |
121 | 121 |
#else |
122 | 122 |
struct sockaddr_dl *sdl; |
... | ... |
@@ -155,7 +155,7 @@ struct device *get_devices(void) |
155 | 155 |
* Instead, Linux uses its own ioctl. This code only runs if we're not Linux, |
156 | 156 |
* Windows, or FreeBSD. |
157 | 157 |
*/ |
158 |
-#if !defined(SIOCGIFHWADDR) |
|
158 |
+#if !defined(SIOCGIFHWADDR) || defined(__GNU__) |
|
159 | 159 |
for (i=0; i < ndevices; i++) { |
160 | 160 |
if (!(strcmp(devices[i].name, addr->ifa_name))) { |
161 | 161 |
sdl = (struct sockaddr_dl *)(addr->ifa_addr); |
... | ... |
@@ -180,7 +180,7 @@ struct device *get_devices(void) |
180 | 180 |
} |
181 | 181 |
|
182 | 182 |
/* This is the Linux version of getting the MAC addresses */ |
183 |
-#if defined(SIOCGIFHWADDR) |
|
183 |
+#if defined(SIOCGIFHWADDR) && !defined(__GNU__) |
|
184 | 184 |
for (i=0; i < ndevices; i++) { |
185 | 185 |
if (!(devices[i].name)) |
186 | 186 |
continue; |