tcp: md5: remove spinlock usage in fast path
[pandora-kernel.git] / net / ipv4 / tcp_minisocks.c
index 0ce3d06..00e1530 100644 (file)
@@ -141,7 +141,7 @@ tcp_timewait_state_process(struct inet_timewait_sock *tw, struct sk_buff *skb,
                           const struct tcphdr *th)
 {
        struct tcp_options_received tmp_opt;
-       u8 *hash_location;
+       const u8 *hash_location;
        struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
        int paws_reject = 0;
 
@@ -345,6 +345,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
                        tw6 = inet6_twsk((struct sock *)tw);
                        ipv6_addr_copy(&tw6->tw_v6_daddr, &np->daddr);
                        ipv6_addr_copy(&tw6->tw_v6_rcv_saddr, &np->rcv_saddr);
+                       tw->tw_tclass = np->tclass;
                        tw->tw_ipv6only = np->ipv6only;
                }
 #endif
@@ -364,7 +365,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
                        if (key != NULL) {
                                memcpy(&tcptw->tw_md5_key, key->key, key->keylen);
                                tcptw->tw_md5_keylen = key->keylen;
-                               if (tcp_alloc_md5sig_pool(sk) == NULL)
+                               if (!tcp_alloc_md5sig_pool())
                                        BUG();
                        }
                } while (0);
@@ -402,11 +403,6 @@ void tcp_time_wait(struct sock *sk, int state, int timeo)
 
 void tcp_twsk_destructor(struct sock *sk)
 {
-#ifdef CONFIG_TCP_MD5SIG
-       struct tcp_timewait_sock *twsk = tcp_twsk(sk);
-       if (twsk->tw_md5_keylen)
-               tcp_free_md5sig_pool();
-#endif
 }
 EXPORT_SYMBOL_GPL(tcp_twsk_destructor);
 
@@ -567,7 +563,7 @@ struct sock *tcp_check_req(struct sock *sk, struct sk_buff *skb,
                           struct request_sock **prev)
 {
        struct tcp_options_received tmp_opt;
-       u8 *hash_location;
+       const u8 *hash_location;
        struct sock *child;
        const struct tcphdr *th = tcp_hdr(skb);
        __be32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK);