net: ip_queue_rcv_skb() helper
[pandora-kernel.git] / net / ipv4 / tcp_input.c
index c096a42..e82162c 100644 (file)
@@ -62,6 +62,7 @@
  */
 
 #include <linux/mm.h>
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/sysctl.h>
 #include <linux/kernel.h>
@@ -3709,7 +3710,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
        }
 
        if ((flag & FLAG_FORWARD_PROGRESS) || !(flag & FLAG_NOT_DUP))
-               dst_confirm(sk->sk_dst_cache);
+               dst_confirm(__sk_dst_get(sk));
 
        return 1;
 
@@ -4318,7 +4319,7 @@ static void tcp_ofo_queue(struct sock *sk)
                }
 
                if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
-                       SOCK_DEBUG(sk, "ofo packet was already received \n");
+                       SOCK_DEBUG(sk, "ofo packet was already received\n");
                        __skb_unlink(skb, &tp->out_of_order_queue);
                        __kfree_skb(skb);
                        continue;
@@ -4366,6 +4367,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
        if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
                goto drop;
 
+       skb_dst_drop(skb);
        __skb_pull(skb, th->doff * 4);
 
        TCP_ECN_accept_cwr(tp, skb);
@@ -5832,7 +5834,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
                        if (tp->snd_una == tp->write_seq) {
                                tcp_set_state(sk, TCP_FIN_WAIT2);
                                sk->sk_shutdown |= SEND_SHUTDOWN;
-                               dst_confirm(sk->sk_dst_cache);
+                               dst_confirm(__sk_dst_get(sk));
 
                                if (!sock_flag(sk, SOCK_DEAD))
                                        /* Wake up lingering close() */