]> err.no Git - linux-2.6/blobdiff - net/ipv6/tcp_ipv6.c
inet: prepare net on the stack for NET accounting macros
[linux-2.6] / net / ipv6 / tcp_ipv6.c
index ebed5d3adb82069f080e71692edc039cd93959c6..d58b83ac06fb6abc516b1b27f71a0d1ab703dcbc 100644 (file)
@@ -70,8 +70,6 @@
 
 static void    tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb);
 static void    tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req);
-static void    tcp_v6_send_check(struct sock *sk, int len,
-                                 struct sk_buff *skb);
 
 static int     tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
 
@@ -325,8 +323,9 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        int err;
        struct tcp_sock *tp;
        __u32 seq;
+       struct net *net = dev_net(skb->dev);
 
-       sk = inet6_lookup(dev_net(skb->dev), &tcp_hashinfo, &hdr->daddr,
+       sk = inet6_lookup(net, &tcp_hashinfo, &hdr->daddr,
                        th->dest, &hdr->saddr, th->source, skb->dev->ifindex);
 
        if (sk == NULL) {
@@ -1006,8 +1005,8 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
 
                if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
                        ip6_xmit(ctl_sk, buff, &fl, NULL, 0);
-                       TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
-                       TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
+                       TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
+                       TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
                        return;
                }
        }
@@ -1091,7 +1090,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
        if (!ip6_dst_lookup(ctl_sk, &buff->dst, &fl)) {
                if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
                        ip6_xmit(ctl_sk, buff, &fl, NULL, 0);
-                       TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
+                       TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
                        return;
                }
        }
@@ -1581,7 +1580,7 @@ discard:
        kfree_skb(skb);
        return 0;
 csum_err:
-       TCP_INC_STATS_BH(TCP_MIB_INERRS);
+       TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
        goto discard;
 
 
@@ -1619,6 +1618,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
        struct tcphdr *th;
        struct sock *sk;
        int ret;
+       struct net *net = dev_net(skb->dev);
 
        if (skb->pkt_type != PACKET_HOST)
                goto discard_it;
@@ -1626,7 +1626,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
        /*
         *      Count it even if it's bad.
         */
-       TCP_INC_STATS_BH(TCP_MIB_INSEGS);
+       TCP_INC_STATS_BH(net, TCP_MIB_INSEGS);
 
        if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
                goto discard_it;
@@ -1650,7 +1650,7 @@ static int tcp_v6_rcv(struct sk_buff *skb)
        TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(ipv6_hdr(skb));
        TCP_SKB_CB(skb)->sacked = 0;
 
-       sk = __inet6_lookup(dev_net(skb->dev), &tcp_hashinfo,
+       sk = __inet6_lookup(net, &tcp_hashinfo,
                        &ipv6_hdr(skb)->saddr, th->source,
                        &ipv6_hdr(skb)->daddr, ntohs(th->dest),
                        inet6_iif(skb));
@@ -1698,7 +1698,7 @@ no_tcp_socket:
 
        if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
 bad_packet:
-               TCP_INC_STATS_BH(TCP_MIB_INERRS);
+               TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
        } else {
                tcp_v6_send_reset(NULL, skb);
        }
@@ -1723,7 +1723,7 @@ do_time_wait:
        }
 
        if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
-               TCP_INC_STATS_BH(TCP_MIB_INERRS);
+               TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
                inet_twsk_put(inet_twsk(sk));
                goto discard_it;
        }
@@ -1872,7 +1872,7 @@ static int tcp_v6_init_sock(struct sock *sk)
        return 0;
 }
 
-static int tcp_v6_destroy_sock(struct sock *sk)
+static void tcp_v6_destroy_sock(struct sock *sk)
 {
 #ifdef CONFIG_TCP_MD5SIG
        /* Clean up the MD5 key list */
@@ -1880,7 +1880,7 @@ static int tcp_v6_destroy_sock(struct sock *sk)
                tcp_v6_clear_md5_list(sk);
 #endif
        tcp_v4_destroy_sock(sk);
-       return inet6_destroy_sock(sk);
+       inet6_destroy_sock(sk);
 }
 
 #ifdef CONFIG_PROC_FS
@@ -1948,7 +1948,7 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
 
        seq_printf(seq,
                   "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X "
-                  "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %u %u %u %u %d\n",
+                  "%02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %lu %lu %u %u %d\n",
                   i,
                   src->s6_addr32[0], src->s6_addr32[1],
                   src->s6_addr32[2], src->s6_addr32[3], srcp,
@@ -1964,8 +1964,8 @@ static void get_tcp6_sock(struct seq_file *seq, struct sock *sp, int i)
                   icsk->icsk_probes_out,
                   sock_i_ino(sp),
                   atomic_read(&sp->sk_refcnt), sp,
-                  icsk->icsk_rto,
-                  icsk->icsk_ack.ato,
+                  jiffies_to_clock_t(icsk->icsk_rto),
+                  jiffies_to_clock_t(icsk->icsk_ack.ato),
                   (icsk->icsk_ack.quick << 1 ) | icsk->icsk_ack.pingpong,
                   tp->snd_cwnd, tp->snd_ssthresh>=0xFFFF?-1:tp->snd_ssthresh
                   );