Search Linux Wireless

Re: [PATCH Try#12 0/3] Radiotap injection for Monitor Mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 13 June 2007 02:37, andy@xxxxxxxxxxx wrote:
> These patches add the ability to inject packets down a monitor mode
> interface for transmission according to a prepended radiotap header.
>
I've attached a patch to address remaining issues found by git, sparse, and 
checkpatch.pl. With that, ACK.

Thanks,
-Michael Wu
mac80211: radiotap injection code sparse/style fixes

From: Michael Wu <flamingice@xxxxxxxxxxxx>

This fixes the remaining issues in the radiotap code found by git, sparse,
and checkpatch.pl. (and one last space between * and variable name found
by myself.)

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 Documentation/networking/radiotap-headers.txt |    2 +-
 net/mac80211/ieee80211.c                      |   12 +++++++-----
 net/wireless/radiotap.c                       |    6 ++----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/Documentation/networking/radiotap-headers.txt b/Documentation/networking/radiotap-headers.txt
index 5148075..bd846de 100644
--- a/Documentation/networking/radiotap-headers.txt
+++ b/Documentation/networking/radiotap-headers.txt
@@ -95,7 +95,7 @@ int MyFunction(u8 * buf, int buflen)
 
 	while (!ret) {
 
-	 	ret = ieee80211_radiotap_iterator_next(&iterator);
+		ret = ieee80211_radiotap_iterator_next(&iterator);
 
 		if (ret)
 			continue;
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 5f2bf3e..023aa18 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -1164,7 +1164,7 @@ __ieee80211_parse_tx_radiotap(
 	while (!ret) {
 		int i, target_rate;
 
-	 	ret = ieee80211_radiotap_iterator_next(&iterator);
+		ret = ieee80211_radiotap_iterator_next(&iterator);
 
 		if (ret)
 			continue;
@@ -1694,8 +1694,9 @@ static int ieee80211_subif_start_xmit(struct sk_buff *skb,
 	}
 
 	if (unlikely(sdata->type == IEEE80211_IF_TYPE_MNTR)) {
-		struct ieee80211_radiotap_header * prthdr =
+		struct ieee80211_radiotap_header *prthdr =
 			(struct ieee80211_radiotap_header *)skb->data;
+		u16 len;
 
 		/*
 		 * there must be a radiotap header at the
@@ -1723,9 +1724,10 @@ static int ieee80211_subif_start_xmit(struct sk_buff *skb,
 		 * a precooked IEEE80211 header so no need for
 		 * normal processing
 		 */
-		skb_set_mac_header(skb, prthdr->it_len);
-		skb_set_network_header(skb, prthdr->it_len + sizeof(hdr));
-		skb_set_transport_header(skb, prthdr->it_len + sizeof(hdr));
+		len = le16_to_cpu(prthdr->it_len);
+		skb_set_mac_header(skb, len);
+		skb_set_network_header(skb, len + sizeof(hdr));
+		skb_set_transport_header(skb, len + sizeof(hdr));
 
 		/*
 		 * pass the radiotap header up to
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index 1b4a7be..091f234 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -60,12 +60,12 @@ int ieee80211_radiotap_iterator_init(
 	iterator->arg_index = 0;
 	iterator->bitmap_shifter = le32_to_cpu(radiotap_header->it_present);
 	iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
-	iterator->this_arg = 0;
+	iterator->this_arg = NULL;
 
 	/* find payload start allowing for extended bitmap(s) */
 
 	if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
-		while (le32_to_cpu(*(u32 *)iterator->arg) &
+		while (le32_to_cpu(*(__le32 *)iterator->arg) &
 				   (1<<IEEE80211_RADIOTAP_EXT)) {
 			iterator->arg += sizeof(u32);
 
@@ -93,7 +93,6 @@ int ieee80211_radiotap_iterator_init(
 
 	return 0;
 }
-
 EXPORT_SYMBOL(ieee80211_radiotap_iterator_init);
 
 
@@ -239,5 +238,4 @@ int ieee80211_radiotap_iterator_next(
 	/* we don't know how to handle any more args, we're done */
 	return -ENOENT;
 }
-
 EXPORT_SYMBOL(ieee80211_radiotap_iterator_next);

Attachment: pgpiHDQTO0V0B.pgp
Description: PGP signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux