summaryrefslogtreecommitdiffstats
path: root/if-linux.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-02-23 13:40:24 +0000
committerRoy Marples <roy@marples.name>2009-02-23 13:40:24 +0000
commitd1dde3c8b44469a6d4370a41d30ea1de014d678f (patch)
treebe44b97df39a0b5d65b85606b859e5b0b65a7246 /if-linux.c
parentcf6757c4d5365c4271b5332ee496e3d0a29719cb (diff)
downloaddhcpcd-d1dde3c8b44469a6d4370a41d30ea1de014d678f.tar.xz
Try a new tactic to compile with old broken linux kernel headers.
Diffstat (limited to 'if-linux.c')
-rw-r--r--if-linux.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/if-linux.c b/if-linux.c
index c46be587..26f08c07 100644
--- a/if-linux.c
+++ b/if-linux.c
@@ -40,7 +40,6 @@
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
-#include <linux/wireless.h>
#include <errno.h>
#include <ctype.h>
@@ -52,8 +51,13 @@
#include <unistd.h>
/* Support older kernels */
-#ifndef IFLA_WIRELESS
-# define IFLA_WIRELSSS (IFLFA_MASTER + 1)
+#ifdef IFLA_WIRELESS
+# ifndef __user
+# define __user
+# endif
+# include <wireless.h>
+#else
+# define IFLA_WIRELESS (IFLA_MASTER + 1)
#endif
#include "config.h"
@@ -74,6 +78,7 @@ static struct sockaddr_nl sock_nl;
int
getifssid(const char *ifname, char *ssid)
{
+#ifdef SIOCGIWESSID
int s, retval;
struct iwreq iwr;
@@ -90,6 +95,11 @@ getifssid(const char *ifname, char *ssid)
retval = -1;
close(s);
return retval;
+#else
+ /* Stop gcc warning about unused paramters */
+ ifname = ssid;
+ return -1;
+#endif
}
static int