From 4518d4f8f52254b62f822235647218288567b5f1 Mon Sep 17 00:00:00 2001 From: Thomas Herzog Date: Fri, 31 Aug 2018 17:17:10 +0200 Subject: [PATCH 1/3] fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H --- Modules/socketmodule.h | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index bce74c3da8fd909..8fbcb362efff25b 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -101,39 +101,39 @@ typedef int socklen_t; #include #endif -#ifdef HAVE_SOCKADDR_ALG -#include -#ifndef AF_ALG -#define AF_ALG 38 -#endif -#ifndef SOL_ALG -#define SOL_ALG 279 -#endif - #ifdef HAVE_LINUX_VM_SOCKETS_H # include #else # undef AF_VSOCK #endif +#ifdef HAVE_SOCKADDR_ALG +# include +# ifndef AF_ALG +# define AF_ALG 38 +# endif +# ifndef SOL_ALG +# define SOL_ALG 279 +# endif + /* Linux 3.19 */ -#ifndef ALG_SET_AEAD_ASSOCLEN -#define ALG_SET_AEAD_ASSOCLEN 4 -#endif -#ifndef ALG_SET_AEAD_AUTHSIZE -#define ALG_SET_AEAD_AUTHSIZE 5 -#endif +# ifndef ALG_SET_AEAD_ASSOCLEN +# define ALG_SET_AEAD_ASSOCLEN 4 +# endif +# ifndef ALG_SET_AEAD_AUTHSIZE +# define ALG_SET_AEAD_AUTHSIZE 5 +# endif /* Linux 4.8 */ -#ifndef ALG_SET_PUBKEY -#define ALG_SET_PUBKEY 6 -#endif +# ifndef ALG_SET_PUBKEY +# define ALG_SET_PUBKEY 6 +# endif -#ifndef ALG_OP_SIGN -#define ALG_OP_SIGN 2 -#endif -#ifndef ALG_OP_VERIFY -#define ALG_OP_VERIFY 3 -#endif +# ifndef ALG_OP_SIGN +# define ALG_OP_SIGN 2 +# endif +# ifndef ALG_OP_VERIFY +# define ALG_OP_VERIFY 3 +# endif #endif /* HAVE_SOCKADDR_ALG */ From 34ca2164809957c730a45f52a7d661f55bef4c8b Mon Sep 17 00:00:00 2001 From: Thomas Herzog Date: Fri, 31 Aug 2018 19:41:33 +0200 Subject: [PATCH 2/3] add news entry --- Misc/NEWS.d/next/Build/2018-08-31-19-41-09.bpo-34555.dfQcnm.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Build/2018-08-31-19-41-09.bpo-34555.dfQcnm.rst diff --git a/Misc/NEWS.d/next/Build/2018-08-31-19-41-09.bpo-34555.dfQcnm.rst b/Misc/NEWS.d/next/Build/2018-08-31-19-41-09.bpo-34555.dfQcnm.rst new file mode 100644 index 000000000000000..7e61c4fb20ab64a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2018-08-31-19-41-09.bpo-34555.dfQcnm.rst @@ -0,0 +1,2 @@ +Fix for case where it was not possible to have both +``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined. From c4a8cfd726b666ffe8ede646f0c263eb2be24bd3 Mon Sep 17 00:00:00 2001 From: Thomas Herzog Date: Sat, 1 Sep 2018 10:49:22 +0200 Subject: [PATCH 3/3] add balancing newline at start of ifdef block --- Modules/socketmodule.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index 8fbcb362efff25b..0b2edc158782bab 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -108,6 +108,7 @@ typedef int socklen_t; #endif #ifdef HAVE_SOCKADDR_ALG + # include # ifndef AF_ALG # define AF_ALG 38