Index: airdecap-ng.c
===================================================================
--- airdecap-ng.c	(revision 1517)
+++ airdecap-ng.c	(working copy)
@@ -105,6 +105,12 @@
 uchar buffer[65536];
 uchar buffer2[65536];
 
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define	le16_to_cpu(x) (x)
+#else
+#define	le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8))
+#endif
+
 /* this routine handles to 802.11 to Ethernet translation */
 
 int write_packet( FILE *f_out, struct pcap_pkthdr *pkh, uchar *h80211 )
@@ -491,7 +497,8 @@
 
     if( pfh.linktype != LINKTYPE_IEEE802_11 &&
         pfh.linktype != LINKTYPE_PRISM_HEADER &&
-        pfh.linktype != LINKTYPE_RADIOTAP_HDR )
+        pfh.linktype != LINKTYPE_RADIOTAP_HDR &&
+		pfh.linktype != LINKTYPE_PPI_HDR )
     {
         printf( "\"%s\" isn't a regular 802.11 "
                 "(wireless) capture.\n", argv[optind] );
@@ -658,6 +665,25 @@
             h80211 += n; pkh.caplen -= n;
         }
 
+		if( linktype == LINKTYPE_PPI_HDR )
+		{
+			/* Remove the PPI header */
+
+			n = le16_to_cpu(*(unsigned short *)( h80211 + 2));
+
+			if( n <= 0 || n>= (int) pkh.caplen )
+				continue;
+
+			/* for a while Kismet logged broken PPI headers */
+			if ( n == 24 && le16_to_cpu(*(unsigned short *)(h80211 + 8)) == 2 )
+				n = 32;
+
+			if( n <= 0 || n>= (int) pkh.caplen )
+				continue;
+
+			h80211 += n; pkh.caplen -= n;
+		}
+
         /* remove the FCS if present (madwifi) */
 
         if( check_crc_buf( h80211, pkh.caplen - 4 ) == 1 )
Index: aircrack-ng.c
===================================================================
--- aircrack-ng.c	(revision 1517)
+++ aircrack-ng.c	(working copy)
@@ -178,6 +178,12 @@
 	, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
 };
 
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define	le16_to_cpu(x) (x)
+#else
+#define	le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8))
+#endif
+
 char usage[] =
 "\n"
 "  %s - (C) 2006, 2007, 2008, 2009 Thomas d\'Otreppe\n"
@@ -800,7 +806,8 @@
 
 		if( pfh.linktype != LINKTYPE_IEEE802_11 &&
 			pfh.linktype != LINKTYPE_PRISM_HEADER &&
-			pfh.linktype != LINKTYPE_RADIOTAP_HDR )
+			pfh.linktype != LINKTYPE_RADIOTAP_HDR &&
+			pfh.linktype != LINKTYPE_PPI_HDR)
 		{
 			fprintf( stderr, "This file is not a regular "
 				"802.11 (wireless) capture.\n" );
@@ -948,6 +955,25 @@
 
 				h80211 += n; pkh.caplen -= n;
 			}
+
+			if( pfh.linktype == LINKTYPE_PPI_HDR )
+			{
+				/* Remove the PPI header */
+
+				n = le16_to_cpu(*(unsigned short *)( h80211 + 2));
+
+				if( n <= 0 || n>= (int) pkh.caplen )
+					continue;
+
+				/* for a while Kismet logged broken PPI headers */
+				if ( n == 24 && le16_to_cpu(*(unsigned short *)(h80211 + 8)) == 2 )
+					n = 32;
+
+				if( n <= 0 || n>= (int) pkh.caplen )
+					continue;
+
+				h80211 += n; pkh.caplen -= n;
+			}
 		}
 
 		/* prevent concurrent access on the linked list */
@@ -1702,7 +1728,8 @@
 
 		if( pfh.linktype != LINKTYPE_IEEE802_11 &&
 			pfh.linktype != LINKTYPE_PRISM_HEADER &&
-			pfh.linktype != LINKTYPE_RADIOTAP_HDR )
+			pfh.linktype != LINKTYPE_RADIOTAP_HDR &&
+			pfh.linktype != LINKTYPE_PPI_HDR )
 		{
 			fprintf( stderr, "This file is not a regular "
 				"802.11 (wireless) capture.\n" );
@@ -1831,6 +1858,25 @@
 
 				h80211 += n; pkh.caplen -= n;
 			}
+
+			if( pfh.linktype == LINKTYPE_PPI_HDR )
+			{
+				/* Remove the PPI header */
+
+				n = le16_to_cpu(*(unsigned short *)( h80211 + 2));
+
+				if( n <= 0 || n>= (int) pkh.caplen )
+					continue;
+
+				/* for a whole Kismet logged broken PPI headers */
+				if ( n == 24 && le16_to_cpu(*(unsigned short *)(h80211 + 8)) == 2 )
+					n = 32;
+
+				if( n <= 0 || n>= (int) pkh.caplen )
+					continue;
+
+				h80211 += n; pkh.caplen -= n;
+			}
 		}
 
 		/* prevent concurrent access on the linked list */
Index: pcap.h
===================================================================
--- pcap.h	(revision 1517)
+++ pcap.h	(working copy)
@@ -19,6 +19,7 @@
 #define LINKTYPE_IEEE802_11     105
 #define LINKTYPE_PRISM_HEADER   119
 #define LINKTYPE_RADIOTAP_HDR   127
+#define LINKTYPE_PPI_HDR		192
 
 #define uchar  unsigned char
 #define ushort unsigned short
Index: ivstools.c
===================================================================
--- ivstools.c	(revision 1517)
+++ ivstools.c	(working copy)
@@ -107,6 +107,12 @@
         "\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00";
 
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define	le16_to_cpu(x) (x)
+#else
+#define	le16_to_cpu(x) ((((x)&0xff)<<8)|(((x)&0xff00)>>8))
+#endif
+
 extern char * getVersion(char * progname, int maj, int min, int submin, int svnrev, int beta, int rc);
 
 void usage(int what)
@@ -825,7 +831,8 @@
 
     if( pfh.linktype != LINKTYPE_IEEE802_11 &&
         pfh.linktype != LINKTYPE_PRISM_HEADER &&
-        pfh.linktype != LINKTYPE_RADIOTAP_HDR )
+        pfh.linktype != LINKTYPE_RADIOTAP_HDR &&
+		pfh.linktype != LINKTYPE_PPI_HDR )
     {
         printf( "\"%s\" isn't a regular 802.11 "
                 "(wireless) capture.\n", argv[2] );
@@ -916,6 +923,25 @@
             h80211 += n; pkh.caplen -= n;
         }
 
+		if( pfh.linktype == LINKTYPE_PPI_HDR )
+		{
+			/* Remove the PPI header */
+
+			n = le16_to_cpu(*(unsigned short *)( h80211 + 2));
+
+			if( n <= 0 || n>= (int) pkh.caplen )
+				continue;
+
+			/* for a while Kismet logged broken PPI headers */
+			if ( n == 24 && le16_to_cpu(*(unsigned short *)(h80211 + 8)) == 2 )
+				n = 32;
+
+			if( n <= 0 || n>= (int) pkh.caplen )
+				continue;
+
+			h80211 += n; pkh.caplen -= n;
+		}
+
         ret = dump_add_packet(h80211, pkh.caplen);
 
         if(ret == IVS) ++nbivs;

