Commit 98dc7039 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6] Fix skb allocation size for RST and ACK.

Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
parent 89277f98
...@@ -1003,11 +1003,12 @@ static void tcp_v6_send_reset(struct sk_buff *skb) ...@@ -1003,11 +1003,12 @@ static void tcp_v6_send_reset(struct sk_buff *skb)
* and then put it into the queue to be sent. * and then put it into the queue to be sent.
*/ */
buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr), GFP_ATOMIC); buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + sizeof(struct tcphdr),
GFP_ATOMIC);
if (buff == NULL) if (buff == NULL)
return; return;
skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr)); skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + sizeof(struct tcphdr));
t1 = (struct tcphdr *) skb_push(buff,sizeof(struct tcphdr)); t1 = (struct tcphdr *) skb_push(buff,sizeof(struct tcphdr));
...@@ -1065,14 +1066,15 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 ...@@ -1065,14 +1066,15 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
struct flowi fl; struct flowi fl;
int tot_len = sizeof(struct tcphdr); int tot_len = sizeof(struct tcphdr);
buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr), GFP_ATOMIC); if (ts)
tot_len += 3*4;
buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,
GFP_ATOMIC);
if (buff == NULL) if (buff == NULL)
return; return;
skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr)); skb_reserve(buff, MAX_HEADER + sizeof(struct ipv6hdr) + tot_len);
if (ts)
tot_len += 3*4;
t1 = (struct tcphdr *) skb_push(buff,tot_len); t1 = (struct tcphdr *) skb_push(buff,tot_len);
......
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