]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Try a new tactic to compile with old broken linux kernel headers.
authorRoy Marples <roy@marples.name>
Mon, 23 Feb 2009 13:40:24 +0000 (13:40 +0000)
committerRoy Marples <roy@marples.name>
Mon, 23 Feb 2009 13:40:24 +0000 (13:40 +0000)
if-linux.c

index c46be587035d1a5b85edf14d3ee8f2b0da347235..26f08c07c3f7272bed49593a37df178fe84ccd1e 100644 (file)
@@ -40,7 +40,6 @@
 
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
-#include <linux/wireless.h>
 
 #include <errno.h>
 #include <ctype.h>
 #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