gh-124944: Add socket.SO_ORIGINAL_DST (#124945)

This commit is contained in:
Steven Jin 2024-10-14 18:36:38 -04:00 committed by GitHub
parent 2a5cdb2516
commit 1bffd7a2a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1 @@
Add ``SO_ORIGINAL_DST`` to the :mod:`socket` module.

View File

@ -7921,6 +7921,9 @@ socket_exec(PyObject *m)
#ifdef SO_OOBINLINE #ifdef SO_OOBINLINE
ADD_INT_MACRO(m, SO_OOBINLINE); ADD_INT_MACRO(m, SO_OOBINLINE);
#endif #endif
#ifdef SO_ORIGINAL_DST
ADD_INT_MACRO(m, SO_ORIGINAL_DST);
#endif
#ifndef __GNU__ #ifndef __GNU__
#ifdef SO_REUSEPORT #ifdef SO_REUSEPORT
ADD_INT_MACRO(m, SO_REUSEPORT); ADD_INT_MACRO(m, SO_REUSEPORT);

View File

@ -172,6 +172,10 @@ typedef int socklen_t;
# undef AF_VSOCK # undef AF_VSOCK
#endif #endif
#ifdef HAVE_LINUX_NETFILTER_IPV4_H
# include <linux/netfilter_ipv4.h>
#endif
#ifdef HAVE_SOCKADDR_ALG #ifdef HAVE_SOCKADDR_ALG
# include <linux/if_alg.h> # include <linux/if_alg.h>

6
configure generated vendored
View File

@ -11092,6 +11092,12 @@ if test "x$ac_cv_header_linux_memfd_h" = xyes
then : then :
printf "%s\n" "#define HAVE_LINUX_MEMFD_H 1" >>confdefs.h printf "%s\n" "#define HAVE_LINUX_MEMFD_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "linux/netfilter_ipv4.h" "ac_cv_header_linux_netfilter_ipv4_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_netfilter_ipv4_h" = xyes
then :
printf "%s\n" "#define HAVE_LINUX_NETFILTER_IPV4_H 1" >>confdefs.h
fi fi
ac_fn_c_check_header_compile "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "$ac_includes_default" ac_fn_c_check_header_compile "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_random_h" = xyes if test "x$ac_cv_header_linux_random_h" = xyes

View File

@ -3013,7 +3013,7 @@ AC_DEFINE([STDC_HEADERS], [1],
AC_CHECK_HEADERS([ \ AC_CHECK_HEADERS([ \
alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \ alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \ io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
linux/random.h linux/soundcard.h \ linux/netfilter_ipv4.h linux/random.h linux/soundcard.h \
linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \ linux/tipc.h linux/wait.h netdb.h net/ethernet.h netinet/in.h netpacket/packet.h poll.h process.h pthread.h pty.h \
sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \ sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \ sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \

View File

@ -739,6 +739,9 @@
/* Define to 1 if you have the <linux/memfd.h> header file. */ /* Define to 1 if you have the <linux/memfd.h> header file. */
#undef HAVE_LINUX_MEMFD_H #undef HAVE_LINUX_MEMFD_H
/* Define to 1 if you have the <linux/netfilter_ipv4.h> header file. */
#undef HAVE_LINUX_NETFILTER_IPV4_H
/* Define to 1 if you have the <linux/netlink.h> header file. */ /* Define to 1 if you have the <linux/netlink.h> header file. */
#undef HAVE_LINUX_NETLINK_H #undef HAVE_LINUX_NETLINK_H