Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265430
b: refs/heads/master
c: f75f5c6
h: refs/heads/master
v: v3
  • Loading branch information
Helmut Schaa authored and John W. Linville committed Aug 9, 2011
1 parent fb818ff commit 32eb824
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12c5ffb5c4601a11b08533609d4bf119e2f22cf5
refs/heads/master: f75f5c6f61b4d34bf92625fcd1131dd58921e1b5
20 changes: 20 additions & 0 deletions trunk/net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,9 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
struct ieee80211_radiotap_header *prthdr =
(struct ieee80211_radiotap_header *)skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr;
u16 len_rthdr;
u8 *payload;

/*
* Frame injection is not allowed if beaconing is not allowed
Expand Down Expand Up @@ -1659,6 +1661,24 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb,
skb_set_network_header(skb, len_rthdr);
skb_set_transport_header(skb, len_rthdr);

/*
* Initialize skb->protocol if the injected frame is a data frame
* carrying a rfc1042 header
*/
if (skb->len > len_rthdr + 2) {
hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr);
if (ieee80211_is_data(hdr->frame_control) &&
skb->len >= len_rthdr +
ieee80211_hdrlen(hdr->frame_control) +
sizeof(rfc1042_header) + 2) {
payload = (u8 *)hdr +
ieee80211_hdrlen(hdr->frame_control);
if (compare_ether_addr(payload, rfc1042_header) == 0)
skb->protocol = cpu_to_be16((payload[6] << 8) |
payload[7]);
}
}

memset(info, 0, sizeof(*info));

info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
Expand Down

0 comments on commit 32eb824

Please sign in to comment.