Skip to content

Commit 2d7102e

Browse files
mcdukebenjaminp
authored andcommitted
closes bpo-34555: Fix incorrectly nested test for HAVE_LINUX_VM_SOCKETS_H (GH-9016)
1 parent 5265b3a commit 2d7102e

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix for case where it was not possible to have both
2+
``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined.

Modules/socketmodule.h

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -101,39 +101,40 @@ typedef int socklen_t;
101101
#include <sys/kern_control.h>
102102
#endif
103103

104-
#ifdef HAVE_SOCKADDR_ALG
105-
#include <linux/if_alg.h>
106-
#ifndef AF_ALG
107-
#define AF_ALG 38
108-
#endif
109-
#ifndef SOL_ALG
110-
#define SOL_ALG 279
111-
#endif
112-
113104
#ifdef HAVE_LINUX_VM_SOCKETS_H
114105
# include <linux/vm_sockets.h>
115106
#else
116107
# undef AF_VSOCK
117108
#endif
118109

110+
#ifdef HAVE_SOCKADDR_ALG
111+
112+
# include <linux/if_alg.h>
113+
# ifndef AF_ALG
114+
# define AF_ALG 38
115+
# endif
116+
# ifndef SOL_ALG
117+
# define SOL_ALG 279
118+
# endif
119+
119120
/* Linux 3.19 */
120-
#ifndef ALG_SET_AEAD_ASSOCLEN
121-
#define ALG_SET_AEAD_ASSOCLEN 4
122-
#endif
123-
#ifndef ALG_SET_AEAD_AUTHSIZE
124-
#define ALG_SET_AEAD_AUTHSIZE 5
125-
#endif
121+
# ifndef ALG_SET_AEAD_ASSOCLEN
122+
# define ALG_SET_AEAD_ASSOCLEN 4
123+
# endif
124+
# ifndef ALG_SET_AEAD_AUTHSIZE
125+
# define ALG_SET_AEAD_AUTHSIZE 5
126+
# endif
126127
/* Linux 4.8 */
127-
#ifndef ALG_SET_PUBKEY
128-
#define ALG_SET_PUBKEY 6
129-
#endif
128+
# ifndef ALG_SET_PUBKEY
129+
# define ALG_SET_PUBKEY 6
130+
# endif
130131

131-
#ifndef ALG_OP_SIGN
132-
#define ALG_OP_SIGN 2
133-
#endif
134-
#ifndef ALG_OP_VERIFY
135-
#define ALG_OP_VERIFY 3
136-
#endif
132+
# ifndef ALG_OP_SIGN
133+
# define ALG_OP_SIGN 2
134+
# endif
135+
# ifndef ALG_OP_VERIFY
136+
# define ALG_OP_VERIFY 3
137+
# endif
137138

138139
#endif /* HAVE_SOCKADDR_ALG */
139140

0 commit comments

Comments
 (0)