public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Update netinet/tcp.h from Linux 4.13
@ 2017-09-06 21:01 Joseph Myers
  2017-09-07  9:39 ` Dmitry V. Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2017-09-06 21:01 UTC (permalink / raw)
  To: libc-alpha

This patch updates sysdeps/gnu/netinet/tcp.h to include new
definitions from include/uapi/linux/tcp.h in Linux 4.13.

Tested for x86_64.

2017-09-06  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/gnu/netinet/tcp.h (TCP_ULP): New macro.
	(TCP_MD5SIG_EXT): Likewise.
	(TCP_MD5SIG_FLAG_PREFIX): Likewise.
	(struct tcp_md5sig): Replace __tcpm_pad1 by tcpm_flags and
	tcpm_prefixlen.  Rename __tcpm_pad2 to __tcpm_pad.

diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
index af94b8e..75973f0 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -71,6 +71,8 @@
 				       connection.  */
 #define TCP_REPAIR_WINDOW	 29 /* Get/set window parameters.  */
 #define TCP_FASTOPEN_CONNECT	 30 /* Attempt FastOpen with connect.  */
+#define TCP_ULP			 31 /* Attach a ULP to a TCP connection.  */
+#define TCP_MD5SIG_EXT		 32 /* TCP MD5 Signature with extensions.  */
 
 #ifdef __USE_MISC
 # include <sys/types.h>
@@ -257,12 +259,16 @@ struct tcp_info
 /* For TCP_MD5SIG socket option.  */
 #define TCP_MD5SIG_MAXKEYLEN	80
 
+/* tcp_md5sig extension flags for TCP_MD5SIG_EXT.  */
+#define TCP_MD5SIG_FLAG_PREFIX	1 /* Address prefix length.  */
+
 struct tcp_md5sig
 {
   struct sockaddr_storage tcpm_addr;		/* Address associated.  */
-  uint16_t	__tcpm_pad1;			/* Zero.  */
+  uint8_t	tcpm_flags;			/* Extension flags.  */
+  uint8_t	tcpm_prefixlen;			/* Address prefix.  */
   uint16_t	tcpm_keylen;			/* Key length.  */
-  uint32_t	__tcpm_pad2;			/* Zero.  */
+  uint32_t	__tcpm_pad;			/* Zero.  */
   uint8_t	tcpm_key[TCP_MD5SIG_MAXKEYLEN];	/* Key (binary).  */
 };
 

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Update netinet/tcp.h from Linux 4.13
  2017-09-06 21:01 Update netinet/tcp.h from Linux 4.13 Joseph Myers
@ 2017-09-07  9:39 ` Dmitry V. Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry V. Levin @ 2017-09-07  9:39 UTC (permalink / raw)
  To: libc-alpha

[-- Attachment #1: Type: text/plain, Size: 1821 bytes --]

On Wed, Sep 06, 2017 at 09:01:34PM +0000, Joseph Myers wrote:
> This patch updates sysdeps/gnu/netinet/tcp.h to include new
> definitions from include/uapi/linux/tcp.h in Linux 4.13.
> 
> Tested for x86_64.
> 
> 2017-09-06  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* sysdeps/gnu/netinet/tcp.h (TCP_ULP): New macro.
> 	(TCP_MD5SIG_EXT): Likewise.
> 	(TCP_MD5SIG_FLAG_PREFIX): Likewise.
> 	(struct tcp_md5sig): Replace __tcpm_pad1 by tcpm_flags and
> 	tcpm_prefixlen.  Rename __tcpm_pad2 to __tcpm_pad.
> 
> diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
> index af94b8e..75973f0 100644
> --- a/sysdeps/gnu/netinet/tcp.h
> +++ b/sysdeps/gnu/netinet/tcp.h
> @@ -71,6 +71,8 @@
>  				       connection.  */
>  #define TCP_REPAIR_WINDOW	 29 /* Get/set window parameters.  */
>  #define TCP_FASTOPEN_CONNECT	 30 /* Attempt FastOpen with connect.  */
> +#define TCP_ULP			 31 /* Attach a ULP to a TCP connection.  */
> +#define TCP_MD5SIG_EXT		 32 /* TCP MD5 Signature with extensions.  */
>  
>  #ifdef __USE_MISC
>  # include <sys/types.h>
> @@ -257,12 +259,16 @@ struct tcp_info
>  /* For TCP_MD5SIG socket option.  */
>  #define TCP_MD5SIG_MAXKEYLEN	80
>  
> +/* tcp_md5sig extension flags for TCP_MD5SIG_EXT.  */
> +#define TCP_MD5SIG_FLAG_PREFIX	1 /* Address prefix length.  */
> +
>  struct tcp_md5sig
>  {
>    struct sockaddr_storage tcpm_addr;		/* Address associated.  */
> -  uint16_t	__tcpm_pad1;			/* Zero.  */
> +  uint8_t	tcpm_flags;			/* Extension flags.  */
> +  uint8_t	tcpm_prefixlen;			/* Address prefix.  */
>    uint16_t	tcpm_keylen;			/* Key length.  */
> -  uint32_t	__tcpm_pad2;			/* Zero.  */
> +  uint32_t	__tcpm_pad;			/* Zero.  */
>    uint8_t	tcpm_key[TCP_MD5SIG_MAXKEYLEN];	/* Key (binary).  */
>  };

Looks OK


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-07  9:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 21:01 Update netinet/tcp.h from Linux 4.13 Joseph Myers
2017-09-07  9:39 ` Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).