summaryrefslogtreecommitdiffstats
path: root/net/ipv4/proc.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /net/ipv4/proc.c
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'net/ipv4/proc.c')
-rw-r--r--net/ipv4/proc.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 0ea231adf..fc6176c0f 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -25,6 +25,7 @@
* Alan Cox : Allow inode to be NULL (kernel socket)
* Andi Kleen : Add support for open_requests and
* split functions for more readibility.
+ * Andi Kleen : Add support for /proc/net/netstat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -98,12 +99,19 @@ static inline void get__sock(struct sock *sp, char *tmpbuf, int i, int format)
destp = ntohs(destp);
srcp = ntohs(srcp);
if((format == 0) && (sp->state == TCP_TIME_WAIT)) {
+ extern int tcp_tw_death_row_slot;
struct tcp_tw_bucket *tw = (struct tcp_tw_bucket *)sp;
+ int slot_dist;
tw_bucket = 1;
timer_active1 = timer_active2 = 0;
timer_active = 3;
- timer_expires = tw->timer.expires;
+ slot_dist = tw->death_slot;
+ if(slot_dist > tcp_tw_death_row_slot)
+ slot_dist = (TCP_TWKILL_SLOTS - slot_dist) + tcp_tw_death_row_slot;
+ else
+ slot_dist = tcp_tw_death_row_slot - slot_dist;
+ timer_expires = jiffies + (slot_dist * TCP_TWKILL_PERIOD);
} else {
timer_active1 = del_timer(&tp->retransmit_timer);
timer_active2 = del_timer(&sp->timer);
@@ -337,3 +345,33 @@ int snmp_get_info(char *buffer, char **start, off_t offset, int length, int dumm
len = length;
return len;
}
+
+/*
+ * Output /proc/net/netstat
+ */
+
+int netstat_get_info(char *buffer, char **start, off_t offset, int length, int dummy)
+{
+ extern struct linux_mib net_statistics;
+ int len;
+
+ len = sprintf(buffer,
+ "TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed"
+ "EmbryonicRsts\n"
+ "TcpExt: %lu %lu %lu %lu\n",
+ net_statistics.SyncookiesSent,
+ net_statistics.SyncookiesRecv,
+ net_statistics.SyncookiesFailed,
+ net_statistics.EmbryonicRsts);
+
+ if (offset >= len)
+ {
+ *start = buffer;
+ return 0;
+ }
+ *start = buffer + offset;
+ len -= offset;
+ if (len > length)
+ len = length;
+ return len;
+}