Commit fcb308d5 authored by hayeswang's avatar hayeswang Committed by David S. Miller

r8152: add skb_cow_head

Call skb_cow_head() before editing the tx packet header. The header
would be reallocated if it is shared.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dc43ddc
...@@ -1376,6 +1376,11 @@ static int msdn_giant_send_check(struct sk_buff *skb) ...@@ -1376,6 +1376,11 @@ static int msdn_giant_send_check(struct sk_buff *skb)
{ {
const struct ipv6hdr *ipv6h; const struct ipv6hdr *ipv6h;
struct tcphdr *th; struct tcphdr *th;
int ret;
ret = skb_cow_head(skb, 0);
if (ret)
return ret;
ipv6h = ipv6_hdr(skb); ipv6h = ipv6_hdr(skb);
th = tcp_hdr(skb); th = tcp_hdr(skb);
...@@ -1383,7 +1388,7 @@ static int msdn_giant_send_check(struct sk_buff *skb) ...@@ -1383,7 +1388,7 @@ static int msdn_giant_send_check(struct sk_buff *skb)
th->check = 0; th->check = 0;
th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0); th->check = ~tcp_v6_check(0, &ipv6h->saddr, &ipv6h->daddr, 0);
return 0; return ret;
} }
static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
...@@ -1412,8 +1417,11 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc, ...@@ -1412,8 +1417,11 @@ static int r8152_tx_csum(struct r8152 *tp, struct tx_desc *desc,
break; break;
case htons(ETH_P_IPV6): case htons(ETH_P_IPV6):
if (msdn_giant_send_check(skb)) {
ret = TX_CSUM_TSO;
goto unavailable;
}
opts1 |= GTSENDV6; opts1 |= GTSENDV6;
msdn_giant_send_check(skb);
break; break;
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment