devres: implement pcim_iomap_regions()
[powerpc.git] / net / ipv4 / tcp_ipv4.c
index 7684297..f51d640 100644 (file)
@@ -191,7 +191,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
        tmp = ip_route_connect(&rt, nexthop, inet->saddr,
                               RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
                               IPPROTO_TCP,
-                              inet->sport, usin->sin_port, sk);
+                              inet->sport, usin->sin_port, sk, 1);
        if (tmp < 0)
                return tmp;
 
@@ -502,11 +502,11 @@ void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb)
        struct tcphdr *th = skb->h.th;
 
        if (skb->ip_summed == CHECKSUM_PARTIAL) {
-               th->check = ~tcp_v4_check(th, len,
-                                         inet->saddr, inet->daddr, 0);
+               th->check = ~tcp_v4_check(len, inet->saddr,
+                                         inet->daddr, 0);
                skb->csum_offset = offsetof(struct tcphdr, check);
        } else {
-               th->check = tcp_v4_check(th, len, inet->saddr, inet->daddr,
+               th->check = tcp_v4_check(len, inet->saddr, inet->daddr,
                                         csum_partial((char *)th,
                                                      th->doff << 2,
                                                      skb->csum));
@@ -525,7 +525,7 @@ int tcp_v4_gso_send_check(struct sk_buff *skb)
        th = skb->h.th;
 
        th->check = 0;
-       th->check = ~tcp_v4_check(th, skb->len, iph->saddr, iph->daddr, 0);
+       th->check = ~tcp_v4_check(skb->len, iph->saddr, iph->daddr, 0);
        skb->csum_offset = offsetof(struct tcphdr, check);
        skb->ip_summed = CHECKSUM_PARTIAL;
        return 0;
@@ -648,7 +648,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
                                   TCPOLEN_TIMESTAMP);
                rep.opt[1] = htonl(tcp_time_stamp);
                rep.opt[2] = htonl(ts);
-               arg.iov[0].iov_len = TCPOLEN_TSTAMP_ALIGNED;
+               arg.iov[0].iov_len += TCPOLEN_TSTAMP_ALIGNED;
        }
 
        /* Swap the send and the receive. */
@@ -747,7 +747,7 @@ static int tcp_v4_send_synack(struct sock *sk, struct request_sock *req,
        if (skb) {
                struct tcphdr *th = skb->h.th;
 
-               th->check = tcp_v4_check(th, skb->len,
+               th->check = tcp_v4_check(skb->len,
                                         ireq->loc_addr,
                                         ireq->rmt_addr,
                                         csum_partial((char *)th, skb->len,
@@ -928,6 +928,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
                        if (tp->md5sig_info->entries4 == 0) {
                                kfree(tp->md5sig_info->keys4);
                                tp->md5sig_info->keys4 = NULL;
+                               tp->md5sig_info->alloced4 = 0;
                        } else if (tp->md5sig_info->entries4 != i) {
                                /* Need to do some manipulation */
                                memcpy(&tp->md5sig_info->keys4[i],
@@ -1185,7 +1186,7 @@ done_opts:
                return 0;
 
        if (hash_expected && !hash_location) {
-               LIMIT_NETDEBUG(KERN_INFO "MD5 Hash NOT expected but found "
+               LIMIT_NETDEBUG(KERN_INFO "MD5 Hash expected but NOT found "
                               "(" NIPQUAD_FMT ", %d)->(" NIPQUAD_FMT ", %d)\n",
                               NIPQUAD(iph->saddr), ntohs(th->source),
                               NIPQUAD(iph->daddr), ntohs(th->dest));
@@ -1233,11 +1234,11 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = {
        .send_reset     =       tcp_v4_send_reset,
 };
 
-static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
 #ifdef CONFIG_TCP_MD5SIG
+static struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
        .md5_lookup     =       tcp_v4_reqsk_md5_lookup,
-#endif
 };
+#endif
 
 static struct timewait_sock_ops tcp_timewait_sock_ops = {
        .twsk_obj_size  = sizeof(struct tcp_timewait_sock),
@@ -1513,7 +1514,7 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
 static __sum16 tcp_v4_checksum_init(struct sk_buff *skb)
 {
        if (skb->ip_summed == CHECKSUM_COMPLETE) {
-               if (!tcp_v4_check(skb->h.th, skb->len, skb->nh.iph->saddr,
+               if (!tcp_v4_check(skb->len, skb->nh.iph->saddr,
                                  skb->nh.iph->daddr, skb->csum)) {
                        skb->ip_summed = CHECKSUM_UNNECESSARY;
                        return 0;
@@ -1820,14 +1821,14 @@ struct inet_connection_sock_af_ops ipv4_specific = {
 #endif
 };
 
-static struct tcp_sock_af_ops tcp_sock_ipv4_specific = {
 #ifdef CONFIG_TCP_MD5SIG
+static struct tcp_sock_af_ops tcp_sock_ipv4_specific = {
        .md5_lookup             = tcp_v4_md5_lookup,
        .calc_md5_hash          = tcp_v4_calc_md5_hash,
        .md5_add                = tcp_v4_md5_add_func,
        .md5_parse              = tcp_v4_parse_md5_keys,
-#endif
 };
+#endif
 
 /* NOTE: A lot of things set to zero explicitly by call to
  *       sk_alloc() so need not be done here.
@@ -2050,7 +2051,7 @@ static void *established_get_first(struct seq_file *seq)
                }
                st->state = TCP_SEQ_STATE_TIME_WAIT;
                inet_twsk_for_each(tw, node,
-                                  &tcp_hashinfo.ehash[st->bucket + tcp_hashinfo.ehash_size].chain) {
+                                  &tcp_hashinfo.ehash[st->bucket].twchain) {
                        if (tw->tw_family != st->family) {
                                continue;
                        }
@@ -2106,7 +2107,7 @@ get_tw:
        }
 
        st->state = TCP_SEQ_STATE_TIME_WAIT;
-       tw = tw_head(&tcp_hashinfo.ehash[st->bucket + tcp_hashinfo.ehash_size].chain);
+       tw = tw_head(&tcp_hashinfo.ehash[st->bucket].twchain);
        goto get_tw;
 found:
        cur = sk;