sysdeps/gnu/netinet/tcp.h: Sync struct tcp_info to Linux 4.6

Message ID 1463520870-24031-1-git-send-email-asbjorn@asbjorn.st
State Rejected
Headers

Commit Message

Asbjørn Sloth Tønnesen May 17, 2016, 9:34 p.m. UTC
  ---

Notes:
    FSF copyright assignment status: not assigned,
    but also not a significant change aka. copy/paste.

 ChangeLog                 |  4 ++++
 sysdeps/gnu/netinet/tcp.h | 12 ++++++++++++
 2 files changed, 16 insertions(+)
  

Comments

Florian Weimer May 18, 2016, 11:38 a.m. UTC | #1
On 05/17/2016 11:34 PM, Asbjørn Sloth Tønnesen wrote:

> --- a/sysdeps/gnu/netinet/tcp.h
> +++ b/sysdeps/gnu/netinet/tcp.h
> @@ -248,6 +248,18 @@ struct tcp_info
>    u_int32_t	tcpi_rcv_space;
>
>    u_int32_t	tcpi_total_retrans;
> +
> +  u_int64_t	tcpi_pacing_rate;
> +  u_int64_t	tcpi_max_pacing_rate;
> +  u_int64_t	tcpi_bytes_acked;    /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
> +  u_int64_t	tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
> +  u_int32_t	tcpi_segs_out;	     /* RFC4898 tcpEStatsPerfSegsOut */
> +  u_int32_t	tcpi_segs_in;        /* RFC4898 tcpEStatsPerfSegsIn */
> +
> +  u_int32_t	tcpi_notsent_bytes;
> +  u_int32_t	tcpi_min_rtt;
> +  u_int32_t	tcpi_data_segs_in;   /* RFC4898 tcpEStatsDataSegsIn */
> +  u_int32_t	tcpi_data_segs_out;  /* RFC4898 tcpEStatsDataSegsOut */
>  };

The last change to this struct was in 2007.  Can we really change the 
ABI like this?  It's not even in the Linux-specific part.

There is no comment at all in the header file that this struct must be 
used exclusively with getsockopt, so libraries might have used the type 
in their header files.

In fact, /usr/include/libnl3/netlink/idiag/msg.h has this:

extern struct tcp_info idiagnl_msg_get_tcpinfo(const struct idiagnl_msg *);

So we really can't make such a change to the struct definition.  We 
probably have to introduce a new type.

Thanks,
Florian
  

Patch

diff --git a/ChangeLog b/ChangeLog
index ce605c1..3d93672 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@ 
+2016-05-17  Asbjørn Sloth Tønnesen  <asbjorn@asbjorn.st>
+
+	* sysdeps/gnu/netinet/tcp.h: Sync struct tcp_info to Linux 4.6
+
 2016-05-17  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #20094]
diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
index 3918bca..358049d 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -248,6 +248,18 @@  struct tcp_info
   u_int32_t	tcpi_rcv_space;
 
   u_int32_t	tcpi_total_retrans;
+
+  u_int64_t	tcpi_pacing_rate;
+  u_int64_t	tcpi_max_pacing_rate;
+  u_int64_t	tcpi_bytes_acked;    /* RFC4898 tcpEStatsAppHCThruOctetsAcked */
+  u_int64_t	tcpi_bytes_received; /* RFC4898 tcpEStatsAppHCThruOctetsReceived */
+  u_int32_t	tcpi_segs_out;	     /* RFC4898 tcpEStatsPerfSegsOut */
+  u_int32_t	tcpi_segs_in;        /* RFC4898 tcpEStatsPerfSegsIn */
+
+  u_int32_t	tcpi_notsent_bytes;
+  u_int32_t	tcpi_min_rtt;
+  u_int32_t	tcpi_data_segs_in;   /* RFC4898 tcpEStatsDataSegsIn */
+  u_int32_t	tcpi_data_segs_out;  /* RFC4898 tcpEStatsDataSegsOut */
 };