packages/net/kismet/patches/100-200701r1b_iwfreq_24_kernel.diff
nbd ba0c627a3a add kismet bugfix for linux 2.4 (from dragorn)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@6113 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-01-17 16:20:39 +00:00

154 lines
4.1 KiB
Diff

diff -ur kismet-2007-01-R1b/config.h.in temp/config.h.in
--- kismet-2007-01-R1b/config.h.in 2006-10-13 16:50:32.000000000 -0400
+++ temp/config.h.in 2007-01-17 10:02:43.000000000 -0500
@@ -60,6 +60,9 @@
/* Libz compression lib */
#undef HAVE_LIBZ
+/* Linux wireless iwfreq.flag */
+#undef HAVE_LINUX_IWFREQFLAG
+
/* Linux netlink socket capture present */
#undef HAVE_LINUX_NETLINK
diff -ur kismet-2007-01-R1b/configure temp/configure
--- kismet-2007-01-R1b/configure 2006-12-27 09:32:52.000000000 -0500
+++ temp/configure 2007-01-17 10:02:43.000000000 -0500
@@ -7795,6 +7795,92 @@
fi
+ iwfreqflag=no
+ { echo "$as_me:$LINENO: checking can we use iw_freq.flags" >&5
+echo $ECHO_N "checking can we use iw_freq.flags... $ECHO_C" >&6; }
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <asm/types.h>
+ #include <linux/if.h>
+ #include <linux/wireless.h>
+
+int
+main ()
+{
+
+ struct iwreq wrq;
+ wrq.u.freq.flags = IW_FREQ_FIXED;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ iwfreqflag=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ iwfreqflag=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ if test "$iwfreqflag" = "no"; then
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ else
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LINUX_IWFREQFLAG 1
+_ACEOF
+
+ fi
+
fi
fi
diff -ur kismet-2007-01-R1b/configure.in temp/configure.in
--- kismet-2007-01-R1b/configure.in 2006-12-27 09:32:52.000000000 -0500
+++ temp/configure.in 2007-01-17 10:02:43.000000000 -0500
@@ -438,6 +438,27 @@
AC_DEFINE(HAVE_LINUX_WIRELESS22, 1, [Linux wireless extentions v22 or better present])
fi
+ iwfreqflag=no
+ AC_MSG_CHECKING(can we use iw_freq.flags)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <netinet/in.h>
+ #include <asm/types.h>
+ #include <linux/if.h>
+ #include <linux/wireless.h>
+ ]], [[
+ struct iwreq wrq;
+ wrq.u.freq.flags = IW_FREQ_FIXED;
+ ]])],[iwfreqflag=yes],[iwfreqflag=no])
+
+ if test "$iwfreqflag" = "no"; then
+ AC_MSG_RESULT(no)
+ else
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LINUX_IWFREQFLAG, 1, [Linux wireless iwfreq.flag])
+ fi
+
fi
fi
diff -ur kismet-2007-01-R1b/iwcontrol.cc temp/iwcontrol.cc
--- kismet-2007-01-R1b/iwcontrol.cc 2006-11-17 11:13:23.000000000 -0500
+++ temp/iwcontrol.cc 2007-01-17 10:02:43.000000000 -0500
@@ -519,7 +519,9 @@
memset(&wrq, 0, sizeof(struct iwreq));
strncpy(wrq.ifr_name, in_dev, IFNAMSIZ);
+#ifdef HAVE_LINUX_IWFREQFLAG
wrq.u.freq.flags = IW_FREQ_FIXED;
+#endif
IwFloat2Freq(in_ch, &wrq.u.freq);
// Try twice with a tiny delay, some cards (madwifi) need a second chance...