diff options
author | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
commit | 57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch) | |
tree | e9c790afb4286f78cb08d9664f58baa7e876fe55 /net/ipv4/tcp_ipv4.c | |
parent | cb18bd40030c879cd93fef02fd579f74dbab473d (diff) | |
parent | 49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff) |
Merge branch 'merge'
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 5a886e6efbbe..f6f39e814291 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -496,6 +496,24 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb) | |||
496 | } | 496 | } |
497 | } | 497 | } |
498 | 498 | ||
499 | int tcp_v4_gso_send_check(struct sk_buff *skb) | ||
500 | { | ||
501 | struct iphdr *iph; | ||
502 | struct tcphdr *th; | ||
503 | |||
504 | if (!pskb_may_pull(skb, sizeof(*th))) | ||
505 | return -EINVAL; | ||
506 | |||
507 | iph = skb->nh.iph; | ||
508 | th = skb->h.th; | ||
509 | |||
510 | th->check = 0; | ||
511 | th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0); | ||
512 | skb->csum = offsetof(struct tcphdr, check); | ||
513 | skb->ip_summed = CHECKSUM_HW; | ||
514 | return 0; | ||
515 | } | ||
516 | |||
499 | /* | 517 | /* |
500 | * This routine will send an RST to the other tcp. | 518 | * This routine will send an RST to the other tcp. |
501 | * | 519 | * |
@@ -1622,10 +1640,9 @@ static int tcp_seq_open(struct inode *inode, struct file *file) | |||
1622 | if (unlikely(afinfo == NULL)) | 1640 | if (unlikely(afinfo == NULL)) |
1623 | return -EINVAL; | 1641 | return -EINVAL; |
1624 | 1642 | ||
1625 | s = kmalloc(sizeof(*s), GFP_KERNEL); | 1643 | s = kzalloc(sizeof(*s), GFP_KERNEL); |
1626 | if (!s) | 1644 | if (!s) |
1627 | return -ENOMEM; | 1645 | return -ENOMEM; |
1628 | memset(s, 0, sizeof(*s)); | ||
1629 | s->family = afinfo->family; | 1646 | s->family = afinfo->family; |
1630 | s->seq_ops.start = tcp_seq_start; | 1647 | s->seq_ops.start = tcp_seq_start; |
1631 | s->seq_ops.next = tcp_seq_next; | 1648 | s->seq_ops.next = tcp_seq_next; |