diff options
Diffstat (limited to 'net/ieee80211/ieee80211_rx.c')
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index 4084909f6f92..6ae036b1920f 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c | |||
@@ -42,7 +42,7 @@ static void ieee80211_monitor_rx(struct ieee80211_device *ieee, | |||
42 | u16 fc = le16_to_cpu(hdr->frame_ctl); | 42 | u16 fc = le16_to_cpu(hdr->frame_ctl); |
43 | 43 | ||
44 | skb->dev = ieee->dev; | 44 | skb->dev = ieee->dev; |
45 | skb->mac.raw = skb->data; | 45 | skb_reset_mac_header(skb); |
46 | skb_pull(skb, ieee80211_get_hdrlen(fc)); | 46 | skb_pull(skb, ieee80211_get_hdrlen(fc)); |
47 | skb->pkt_type = PACKET_OTHERHOST; | 47 | skb->pkt_type = PACKET_OTHERHOST; |
48 | skb->protocol = __constant_htons(ETH_P_80211_RAW); | 48 | skb->protocol = __constant_htons(ETH_P_80211_RAW); |
@@ -606,12 +606,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
606 | if (frag == 0) { | 606 | if (frag == 0) { |
607 | /* copy first fragment (including full headers) into | 607 | /* copy first fragment (including full headers) into |
608 | * beginning of the fragment cache skb */ | 608 | * beginning of the fragment cache skb */ |
609 | memcpy(skb_put(frag_skb, flen), skb->data, flen); | 609 | skb_copy_from_linear_data(skb, skb_put(frag_skb, flen), flen); |
610 | } else { | 610 | } else { |
611 | /* append frame payload to the end of the fragment | 611 | /* append frame payload to the end of the fragment |
612 | * cache skb */ | 612 | * cache skb */ |
613 | memcpy(skb_put(frag_skb, flen), skb->data + hdrlen, | 613 | skb_copy_from_linear_data_offset(skb, hdrlen, |
614 | flen); | 614 | skb_put(frag_skb, flen), flen); |
615 | } | 615 | } |
616 | dev_kfree_skb_any(skb); | 616 | dev_kfree_skb_any(skb); |
617 | skb = NULL; | 617 | skb = NULL; |
@@ -759,8 +759,9 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
759 | IEEE80211_FCTL_TODS) && skb->len >= ETH_HLEN + ETH_ALEN) { | 759 | IEEE80211_FCTL_TODS) && skb->len >= ETH_HLEN + ETH_ALEN) { |
760 | /* Non-standard frame: get addr4 from its bogus location after | 760 | /* Non-standard frame: get addr4 from its bogus location after |
761 | * the payload */ | 761 | * the payload */ |
762 | memcpy(skb->data + ETH_ALEN, | 762 | skb_copy_to_linear_data_offset(skb, ETH_ALEN, |
763 | skb->data + skb->len - ETH_ALEN, ETH_ALEN); | 763 | skb->data + skb->len - ETH_ALEN, |
764 | ETH_ALEN); | ||
764 | skb_trim(skb, skb->len - ETH_ALEN); | 765 | skb_trim(skb, skb->len - ETH_ALEN); |
765 | } | 766 | } |
766 | #endif | 767 | #endif |
@@ -789,10 +790,11 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
789 | 790 | ||
790 | if (skb2 != NULL) { | 791 | if (skb2 != NULL) { |
791 | /* send to wireless media */ | 792 | /* send to wireless media */ |
792 | skb2->protocol = __constant_htons(ETH_P_802_3); | ||
793 | skb2->mac.raw = skb2->nh.raw = skb2->data; | ||
794 | /* skb2->nh.raw = skb2->data + ETH_HLEN; */ | ||
795 | skb2->dev = dev; | 793 | skb2->dev = dev; |
794 | skb2->protocol = __constant_htons(ETH_P_802_3); | ||
795 | skb_reset_mac_header(skb2); | ||
796 | skb_reset_network_header(skb2); | ||
797 | /* skb2->network_header += ETH_HLEN; */ | ||
796 | dev_queue_xmit(skb2); | 798 | dev_queue_xmit(skb2); |
797 | } | 799 | } |
798 | #endif | 800 | #endif |
@@ -800,7 +802,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
800 | if (skb) { | 802 | if (skb) { |
801 | skb->protocol = eth_type_trans(skb, dev); | 803 | skb->protocol = eth_type_trans(skb, dev); |
802 | memset(skb->cb, 0, sizeof(skb->cb)); | 804 | memset(skb->cb, 0, sizeof(skb->cb)); |
803 | skb->dev = dev; | ||
804 | skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ | 805 | skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ |
805 | if (netif_rx(skb) == NET_RX_DROP) { | 806 | if (netif_rx(skb) == NET_RX_DROP) { |
806 | /* netif_rx always succeeds, but it might drop | 807 | /* netif_rx always succeeds, but it might drop |