Skip to content

Commit 1bffd7a

Browse files
authored
gh-124944: Add socket.SO_ORIGINAL_DST (#124945)
1 parent 2a5cdb2 commit 1bffd7a

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``SO_ORIGINAL_DST`` to the :mod:`socket` module.

Modules/socketmodule.c

+3
Original file line numberDiff line numberDiff line change
@@ -7921,6 +7921,9 @@ socket_exec(PyObject *m)
79217921
#ifdef SO_OOBINLINE
79227922
ADD_INT_MACRO(m, SO_OOBINLINE);
79237923
#endif
7924+
#ifdef SO_ORIGINAL_DST
7925+
ADD_INT_MACRO(m, SO_ORIGINAL_DST);
7926+
#endif
79247927
#ifndef __GNU__
79257928
#ifdef SO_REUSEPORT
79267929
ADD_INT_MACRO(m, SO_REUSEPORT);

Modules/socketmodule.h

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ typedef int socklen_t;
172172
# undef AF_VSOCK
173173
#endif
174174

175+
#ifdef HAVE_LINUX_NETFILTER_IPV4_H
176+
# include <linux/netfilter_ipv4.h>
177+
#endif
178+
175179
#ifdef HAVE_SOCKADDR_ALG
176180

177181
# include <linux/if_alg.h>

configure

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -3013,7 +3013,7 @@ AC_DEFINE([STDC_HEADERS], [1],
30133013
AC_CHECK_HEADERS([ \
30143014
alloca.h asm/types.h bluetooth.h conio.h direct.h dlfcn.h endian.h errno.h fcntl.h grp.h \
30153015
io.h langinfo.h libintl.h libutil.h linux/auxvec.h sys/auxv.h linux/fs.h linux/limits.h linux/memfd.h \
3016-
linux/random.h linux/soundcard.h \
3016+
linux/netfilter_ipv4.h linux/random.h linux/soundcard.h \
30173017
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 \
30183018
sched.h setjmp.h shadow.h signal.h spawn.h stropts.h sys/audioio.h sys/bsdtty.h sys/devpoll.h \
30193019
sys/endian.h sys/epoll.h sys/event.h sys/eventfd.h sys/file.h sys/ioctl.h sys/kern_control.h \

pyconfig.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,9 @@
739739
/* Define to 1 if you have the <linux/memfd.h> header file. */
740740
#undef HAVE_LINUX_MEMFD_H
741741

742+
/* Define to 1 if you have the <linux/netfilter_ipv4.h> header file. */
743+
#undef HAVE_LINUX_NETFILTER_IPV4_H
744+
742745
/* Define to 1 if you have the <linux/netlink.h> header file. */
743746
#undef HAVE_LINUX_NETLINK_H
744747

0 commit comments

Comments
 (0)