[PATCH] Minor fixes for wlansniff

Pavel Roskin proski at gnu.org
Tue Jun 7 14:20:08 EDT 2005


Hello!

The sniffer from the sniff directory should probably be obsoleted by
ethereal, but since it's there, let's keep it in a good shape.

The attached patch fixes compiler warnings about undeclared struct
sk_buff and missing declaration for htons().  Also, the help text is
enhanced to show that -b0 is the default and that dash is needed before
"-auth".

Signed-off-by: Pavel Roskin <proski at gnu.org>

--- sniff/management.c
+++ sniff/management.c
@@ -3,6 +3,7 @@
 #include <ctype.h>
 #include <linux/if_ether.h>
 
+struct sk_buff;
 #include "ieee80211.h"
 
 const char *mac2str(unsigned char *addr); /* wlansniff.c */
--- sniff/wlansniff.c
+++ sniff/wlansniff.c
@@ -15,11 +15,13 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 #include <asm/types.h>
 #include <linux/if_packet.h>
 #include <linux/if_ether.h>   /* The L2 protocols */
 #include <linux/if_arp.h>
 
+struct sk_buff;
 #include "ieee80211.h"
 
 /* management.c */
@@ -494,9 +496,9 @@ void sniffer(const char *iface)
 
 void usage(void)
 {
-	printf("wlansniff [-h] [-b#] [auth] <wlan#>\n");
+	printf("wlansniff [-h] [-b#] [-auth] <wlan#>\n");
 	printf("   -h = help\n");
-	printf("   -b0 = do not show beacons\n");
+	printf("   -b0 = do not show beacons (default)\n");
 	printf("   -b1 = show only one line of data for each beacon\n");
 	printf("   -b2 = show full beacon data\n");
 	printf("   -auth = show only authentication frames\n");


-- 
Regards,
Pavel Roskin




More information about the HostAP mailing list