Linux kernel-2.6.4 patch report

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, all

As we know, in Linux kernel 2.6.4, the file /proc/net/tcp contains a lot of
data information about the tcp connection of the network, but it doesnât
contain the information about the size of receive window and send window.

I think the information is useful. For example, I can modify the command
netstat and make it display these information, and in fact, after modifying
the kernel I modified this command immediately and it can display these
information rightly. I will send the netstat patch to Bernd Eckenfels (The
man page and the command included in the net-tools package is totally
rewritten by him), I think if you adopt my idea, he will also adopt my idea
about netstat.

I modified the file /net/ipv4/tcp_ipv4.c, so that it can provide the
information about the size of receive window and send window for the
/proc/net/tcp. After my work, one line in the /proc/net/tcp may look like
this:
 0: 00000000:0400 00000000:0000 0A 00000000:00000000 00:00000000 00000000
29        0 1899 1 c11e4084 3000 0 0 2 -1:87380 16384
the last two fields are the size of receive window and send window in bytes.

The attachment is my patch. Usage: patch âp0 < tcp_ip.patch.

diff -Nur linux-2.6.4/net/ipv4/tcp_ipv4.c linux-2.6.4/net/ipv4/tcp_ipv4.c
--- linux-2.6.4/net/ipv4/tcp_ipv4.c 2004-03-10 21:55:25.000000000 -0500
+++ linux-2.6.4/net/ipv4/tcp_ipv4.c 2004-04-07 21:12:12.000000000 -0400
@@ -2527,7 +2527,7 @@
  }

  sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
-   "%08X %5d %8d %lu %d %p %u %u %u %u %d",
+   "%08X %5d %8d %lu %d %p %u %u %u %u %d:%d %d",
   i, src, srcp, dest, destp, sp->sk_state,
   tp->write_seq - tp->snd_una, tp->rcv_nxt - tp->copied_seq,
   timer_active,
@@ -2539,7 +2539,8 @@
   atomic_read(&sp->sk_refcnt), sp,
   tp->rto, tp->ack.ato, (tp->ack.quick << 1) | tp->ack.pingpong,
   tp->snd_cwnd,
-  tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh);
+  tp->snd_ssthresh >= 0xFFFF ? -1 : tp->snd_ssthresh,
+  sp->sk_rcvbuf,sp->sk_sndbuf);
 }

 static void get_timewait4_sock(struct tcp_tw_bucket *tw, char *tmpbuf, int
i)

Would you mind considering my suggestion?

Regards
Yu Zhiguo
--------------------------------------------------
Dept. of Technology and Development,
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
No.16-5, Guangzhou Rd., Nanjing, P.R. China
PHONEï+86+25-6630523-653
FUJITSU INTERNALï79955653
FAXï+86+25-3317685
Mailïyuzg@nanjing-fnst.com
--------------------------------------------------

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux