lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 9 Jul 2008 10:23:43 -0700
From:	"Adam Langley" <agl@...erialviolet.org>
To:	davem@...emloft.net
Cc:	netdev@...r.kernel.org
Subject: [PATCH] TCP: Add seq and ack numbers to TCP_INFO

TCP: Add seq and ack numbers to TCP_INFO

No ABI breakage: Userspace specifies the size of the structure that they're
expecting, and the new fields are at the end, so existing code should function
just fine as we'll truncate the new struct tcp_info to fit.

Signed-off-by: Adam Langley <agl@...erialviolet.org>
---

 include/linux/tcp.h |    5 +++++
 net/ipv4/tcp.c      |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 07e79bd..55094ea 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -157,6 +157,11 @@ struct tcp_info
 	__u32	tcpi_rcv_space;
 
 	__u32	tcpi_total_retrans;
+
+	__u32	tcpi_seq; /* seq number of next byte to be written to socket */
+	__u32	tcpi_ack; /* ack number of next byte to be read from socket */
+	__u32	tcpi_tseq; /* seq number of next byte to be transmitted */
+	__u32	tcpi_tack; /* ack number of next byte to be received */
 };
 
 /* for TCP_MD5SIG socket option */
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 56a133c..c56d5c3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2255,6 +2255,11 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info)
 	info->tcpi_rcv_space = tp->rcvq_space.space;
 
 	info->tcpi_total_retrans = tp->total_retrans;
+
+	info->tcpi_seq = tp->write_seq;
+	info->tcpi_ack = tp->copied_seq;
+	info->tcpi_tseq = tp->pushed_seq;
+	info->tcpi_tack = tp->rcv_nxt;
 }
 
 EXPORT_SYMBOL_GPL(tcp_get_info);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ