aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-07-16 23:22:25 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-16 23:22:25 -0400
commit63231bddf6514778792d3784f63822473d250fc0 (patch)
treed380f9ca00fa0ca2cd74142c5b51b97717ef1e9a /net/ipv4
parent81cc8a75d944fa39fc333c2c329c8e8b3c62cada (diff)
mib: add net to TCP_INC_STATS_BH
Same as before - the sock is always there to get the net from, but there are also some places with the net already saved on the stack. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp.c2
-rw-r--r--net/ipv4/tcp_input.c6
-rw-r--r--net/ipv4/tcp_ipv4.c14
-rw-r--r--net/ipv4/tcp_minisocks.c4
4 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index aa79198fb02e..f742f84026b5 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2663,7 +2663,7 @@ EXPORT_SYMBOL(__tcp_put_md5sig_pool);
2663void tcp_done(struct sock *sk) 2663void tcp_done(struct sock *sk)
2664{ 2664{
2665 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV) 2665 if(sk->sk_state == TCP_SYN_SENT || sk->sk_state == TCP_SYN_RECV)
2666 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 2666 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
2667 2667
2668 tcp_set_state(sk, TCP_CLOSE); 2668 tcp_set_state(sk, TCP_CLOSE);
2669 tcp_clear_xmit_timers(sk); 2669 tcp_clear_xmit_timers(sk);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d6ea970a1513..01e8004911b4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4795,7 +4795,7 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
4795 tcp_data_snd_check(sk); 4795 tcp_data_snd_check(sk);
4796 return 0; 4796 return 0;
4797 } else { /* Header too small */ 4797 } else { /* Header too small */
4798 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4798 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4799 goto discard; 4799 goto discard;
4800 } 4800 }
4801 } else { 4801 } else {
@@ -4934,7 +4934,7 @@ slow_path:
4934 tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); 4934 tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
4935 4935
4936 if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) { 4936 if (th->syn && !before(TCP_SKB_CB(skb)->seq, tp->rcv_nxt)) {
4937 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4937 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4938 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN); 4938 NET_INC_STATS_BH(LINUX_MIB_TCPABORTONSYN);
4939 tcp_reset(sk); 4939 tcp_reset(sk);
4940 return 1; 4940 return 1;
@@ -4957,7 +4957,7 @@ step5:
4957 return 0; 4957 return 0;
4958 4958
4959csum_error: 4959csum_error:
4960 TCP_INC_STATS_BH(TCP_MIB_INERRS); 4960 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
4961 4961
4962discard: 4962discard:
4963 __kfree_skb(skb); 4963 __kfree_skb(skb);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index db3bf9be076f..e876312b950a 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -599,8 +599,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
599 ip_send_reply(net->ipv4.tcp_sock, skb, 599 ip_send_reply(net->ipv4.tcp_sock, skb,
600 &arg, arg.iov[0].iov_len); 600 &arg, arg.iov[0].iov_len);
601 601
602 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 602 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
603 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); 603 TCP_INC_STATS_BH(net, TCP_MIB_OUTRSTS);
604} 604}
605 605
606/* The code following below sending ACKs in SYN-RECV and TIME-WAIT states 606/* The code following below sending ACKs in SYN-RECV and TIME-WAIT states
@@ -674,7 +674,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
674 ip_send_reply(net->ipv4.tcp_sock, skb, 674 ip_send_reply(net->ipv4.tcp_sock, skb,
675 &arg, arg.iov[0].iov_len); 675 &arg, arg.iov[0].iov_len);
676 676
677 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 677 TCP_INC_STATS_BH(net, TCP_MIB_OUTSEGS);
678} 678}
679 679
680static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) 680static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
@@ -1494,7 +1494,7 @@ discard:
1494 return 0; 1494 return 0;
1495 1495
1496csum_err: 1496csum_err:
1497 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1497 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_INERRS);
1498 goto discard; 1498 goto discard;
1499} 1499}
1500 1500
@@ -1514,7 +1514,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
1514 goto discard_it; 1514 goto discard_it;
1515 1515
1516 /* Count it even if it's bad */ 1516 /* Count it even if it's bad */
1517 TCP_INC_STATS_BH(TCP_MIB_INSEGS); 1517 TCP_INC_STATS_BH(net, TCP_MIB_INSEGS);
1518 1518
1519 if (!pskb_may_pull(skb, sizeof(struct tcphdr))) 1519 if (!pskb_may_pull(skb, sizeof(struct tcphdr)))
1520 goto discard_it; 1520 goto discard_it;
@@ -1590,7 +1590,7 @@ no_tcp_socket:
1590 1590
1591 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { 1591 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
1592bad_packet: 1592bad_packet:
1593 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1593 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1594 } else { 1594 } else {
1595 tcp_v4_send_reset(NULL, skb); 1595 tcp_v4_send_reset(NULL, skb);
1596 } 1596 }
@@ -1611,7 +1611,7 @@ do_time_wait:
1611 } 1611 }
1612 1612
1613 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) { 1613 if (skb->len < (th->doff << 2) || tcp_checksum_complete(skb)) {
1614 TCP_INC_STATS_BH(TCP_MIB_INERRS); 1614 TCP_INC_STATS_BH(net, TCP_MIB_INERRS);
1615 inet_twsk_put(inet_twsk(sk)); 1615 inet_twsk_put(inet_twsk(sk));
1616 goto discard_it; 1616 goto discard_it;
1617 } 1617 }
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index ea68a478fad6..8b02b1039968 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -480,7 +480,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
480 newtp->rx_opt.mss_clamp = req->mss; 480 newtp->rx_opt.mss_clamp = req->mss;
481 TCP_ECN_openreq_child(newtp, req); 481 TCP_ECN_openreq_child(newtp, req);
482 482
483 TCP_INC_STATS_BH(TCP_MIB_PASSIVEOPENS); 483 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_PASSIVEOPENS);
484 } 484 }
485 return newsk; 485 return newsk;
486} 486}
@@ -630,7 +630,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
630 * "fourth, check the SYN bit" 630 * "fourth, check the SYN bit"
631 */ 631 */
632 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) { 632 if (flg & (TCP_FLAG_RST|TCP_FLAG_SYN)) {
633 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 633 TCP_INC_STATS_BH(sock_net(sk), TCP_MIB_ATTEMPTFAILS);
634 goto embryonic_reset; 634 goto embryonic_reset;
635 } 635 }
636 636