diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/tx.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index df6aac523532..7a637b80a62e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1737,15 +1737,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1737 | int nh_pos, h_pos; | 1737 | int nh_pos, h_pos; |
1738 | struct sta_info *sta = NULL; | 1738 | struct sta_info *sta = NULL; |
1739 | u32 sta_flags = 0; | 1739 | u32 sta_flags = 0; |
1740 | struct sk_buff *tmp_skb; | ||
1740 | 1741 | ||
1741 | if (unlikely(skb->len < ETH_HLEN)) { | 1742 | if (unlikely(skb->len < ETH_HLEN)) { |
1742 | ret = NETDEV_TX_OK; | 1743 | ret = NETDEV_TX_OK; |
1743 | goto fail; | 1744 | goto fail; |
1744 | } | 1745 | } |
1745 | 1746 | ||
1746 | nh_pos = skb_network_header(skb) - skb->data; | ||
1747 | h_pos = skb_transport_header(skb) - skb->data; | ||
1748 | |||
1749 | /* convert Ethernet header to proper 802.11 header (based on | 1747 | /* convert Ethernet header to proper 802.11 header (based on |
1750 | * operation mode) */ | 1748 | * operation mode) */ |
1751 | ethertype = (skb->data[12] << 8) | skb->data[13]; | 1749 | ethertype = (skb->data[12] << 8) | skb->data[13]; |
@@ -1918,6 +1916,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1918 | goto fail; | 1916 | goto fail; |
1919 | } | 1917 | } |
1920 | 1918 | ||
1919 | /* | ||
1920 | * If the skb is shared we need to obtain our own copy. | ||
1921 | */ | ||
1922 | if (skb_shared(skb)) { | ||
1923 | tmp_skb = skb; | ||
1924 | skb = skb_copy(skb, GFP_ATOMIC); | ||
1925 | kfree_skb(tmp_skb); | ||
1926 | |||
1927 | if (!skb) { | ||
1928 | ret = NETDEV_TX_OK; | ||
1929 | goto fail; | ||
1930 | } | ||
1931 | } | ||
1932 | |||
1921 | hdr.frame_control = fc; | 1933 | hdr.frame_control = fc; |
1922 | hdr.duration_id = 0; | 1934 | hdr.duration_id = 0; |
1923 | hdr.seq_ctrl = 0; | 1935 | hdr.seq_ctrl = 0; |
@@ -1936,6 +1948,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1936 | encaps_len = 0; | 1948 | encaps_len = 0; |
1937 | } | 1949 | } |
1938 | 1950 | ||
1951 | nh_pos = skb_network_header(skb) - skb->data; | ||
1952 | h_pos = skb_transport_header(skb) - skb->data; | ||
1953 | |||
1939 | skb_pull(skb, skip_header_bytes); | 1954 | skb_pull(skb, skip_header_bytes); |
1940 | nh_pos -= skip_header_bytes; | 1955 | nh_pos -= skip_header_bytes; |
1941 | h_pos -= skip_header_bytes; | 1956 | h_pos -= skip_header_bytes; |