diff options
author | Christian Heimes <christian@python.org> | 2022-03-11 22:25:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 22:25:14 (GMT) |
commit | ecfff63e06e77e22035a7f7caa26986f033f3aea (patch) | |
tree | 956166c47566051afd5f2c18bdc56863bc2f477c /Modules/socketmodule.h | |
parent | 3b128c054885fe881c3b57a5978de3ea89c81a9c (diff) | |
download | cpython-ecfff63e06e77e22035a7f7caa26986f033f3aea.zip cpython-ecfff63e06e77e22035a7f7caa26986f033f3aea.tar.gz cpython-ecfff63e06e77e22035a7f7caa26986f033f3aea.tar.bz2 |
bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829)
Emscripten's socket emulation is limited. AF_UNIX, AF_PACKET, setsockopt(), and most SO_* constants are not supported.
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r-- | Modules/socketmodule.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index db26c04..1b35b11 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -192,6 +192,21 @@ typedef int socklen_t; #endif /* HAVE_SOCKADDR_ALG */ +#ifdef __EMSCRIPTEN__ +// wasm32-emscripten sockets only support subset of IPv4 and IPv6. +// SCTP protocol crashes runtime. +#ifdef IPPROTO_SCTP +# undef IPPROTO_SCTP +#endif +// setsockopt() fails with ENOPROTOOPT, getsockopt only supports SO_ERROR. +// undef SO_REUSEADDR and SO_REUSEPORT so they cannot be used. +#ifdef SO_REUSEADDR +# undef SO_REUSEADDR +#endif +#ifdef SO_REUSEPORT +# undef SO_REUSEPORT +#endif +#endif // __EMSCRIPTEN__ #ifndef Py__SOCKET_H #define Py__SOCKET_H |