summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSteven Jin <stevenjin8@gmail.com>2024-10-14 22:36:38 (GMT)
committerGitHub <noreply@github.com>2024-10-14 22:36:38 (GMT)
commit1bffd7a2a738506a4ad50c6c3c2c32926cce6d14 (patch)
tree4e956cad055c24f6372b8ff53099ed1630936832 /Modules
parent2a5cdb251674ce8d9a824c102f7cd846d944cfa4 (diff)
downloadcpython-1bffd7a2a738506a4ad50c6c3c2c32926cce6d14.zip
cpython-1bffd7a2a738506a4ad50c6c3c2c32926cce6d14.tar.gz
cpython-1bffd7a2a738506a4ad50c6c3c2c32926cce6d14.tar.bz2
gh-124944: Add socket.SO_ORIGINAL_DST (#124945)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c3
-rw-r--r--Modules/socketmodule.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 0829d23..744e5e0 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -7921,6 +7921,9 @@ socket_exec(PyObject *m)
#ifdef SO_OOBINLINE
ADD_INT_MACRO(m, SO_OOBINLINE);
#endif
+#ifdef SO_ORIGINAL_DST
+ ADD_INT_MACRO(m, SO_ORIGINAL_DST);
+#endif
#ifndef __GNU__
#ifdef SO_REUSEPORT
ADD_INT_MACRO(m, SO_REUSEPORT);
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index a77c620..e1d9637 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -172,6 +172,10 @@ typedef int socklen_t;
# undef AF_VSOCK
#endif
+#ifdef HAVE_LINUX_NETFILTER_IPV4_H
+# include <linux/netfilter_ipv4.h>
+#endif
+
#ifdef HAVE_SOCKADDR_ALG
# include <linux/if_alg.h>