summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-04-08 21:23:58 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2003-04-08 21:23:58 -0700
commitfaedca65dfd1abf0097d1dabf45030560828a8ae (patch)
tree7cb4544e35a32f3ab39af24d0dcde9caaf877362 /include/net
parentda220b091670cdc32f59d24575cf23d4dce397bb (diff)
parent75552d6863c17d8d138ae2ff21868f0d5bc96390 (diff)
Merge bk://kernel.bkbits.net/davem/net-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/net')
-rw-r--r--include/net/tcp.h15
-rw-r--r--include/net/xfrm.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index b652650286fe..8844d3f3d8f9 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -31,6 +31,7 @@
#include <linux/percpu.h>
#include <net/checksum.h>
#include <net/sock.h>
+#include <net/snmp.h>
#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE)
#include <linux/ipv6.h>
#endif
@@ -639,6 +640,8 @@ DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics);
#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field)
#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field)
#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field)
+#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val)
+#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val)
extern __inline__ void tcp_put_port(struct sock *sk);
extern void tcp_inherit_port(struct sock *sk, struct sock *child);
@@ -1398,6 +1401,9 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
break;
case TCP_CLOSE:
+ if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
+ TCP_INC_STATS(TcpEstabResets);
+
sk->prot->unhash(sk);
if (sk->prev && !(sk->userlocks&SOCK_BINDPORT_LOCK))
tcp_put_port(sk);
@@ -1878,4 +1884,13 @@ static inline int tcp_use_frto(const struct sock *sk)
tp->snd_una + tp->snd_wnd));
}
+static inline void tcp_mib_init(void)
+{
+ /* See RFC 2012 */
+ TCP_ADD_STATS_USER(TcpRtoAlgorithm, 1);
+ TCP_ADD_STATS_USER(TcpRtoMin, TCP_RTO_MIN*1000/HZ);
+ TCP_ADD_STATS_USER(TcpRtoMax, TCP_RTO_MAX*1000/HZ);
+ TCP_ADD_STATS_USER(TcpMaxConn, -1);
+}
+
#endif /* _TCP_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index fe32e5c32354..b75d2651adf0 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -84,6 +84,7 @@ extern struct semaphore xfrm_cfg_sem;
/* Full description of state of transformer. */
struct xfrm_state
{
+ /* Note: bydst is re-used during gc */
struct list_head bydst;
struct list_head byspi;