summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordsentinel <14005083+dsentinel@users.noreply.github.com>2023-01-09 09:00:40 (GMT)
committerGitHub <noreply@github.com>2023-01-09 09:00:40 (GMT)
commit7a50d6b5b09a88e915891757fdd6d371310d2e96 (patch)
tree771bb40915d3d4303087ff8de04670b09f2a09a3
parente47b13934b2eb50914e4dbae91f1dc59f8325e30 (diff)
downloadcpython-7a50d6b5b09a88e915891757fdd6d371310d2e96.zip
cpython-7a50d6b5b09a88e915891757fdd6d371310d2e96.tar.gz
cpython-7a50d6b5b09a88e915891757fdd6d371310d2e96.tar.bz2
GH-100813: Add `socket.IP_PKTINFO` constant (#10294)
-rw-r--r--Doc/library/socket.rst1
-rw-r--r--Misc/NEWS.d/next/Library/2023-01-06-22-36-27.gh-issue-100813.mHRdQn.rst1
-rw-r--r--Modules/socketmodule.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index cffb19c..aec79da 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -436,6 +436,7 @@ Constants
``TCP_FASTOPEN_CONNECT``, ``TCP_ULP``, ``TCP_MD5SIG_EXT``,
``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``,
``TCP_ZEROCOPY_RECEIVE``, ``TCP_INQ``, ``TCP_TX_DELAY``.
+ Added ``IP_PKTINFO``.
.. data:: AF_CAN
PF_CAN
diff --git a/Misc/NEWS.d/next/Library/2023-01-06-22-36-27.gh-issue-100813.mHRdQn.rst b/Misc/NEWS.d/next/Library/2023-01-06-22-36-27.gh-issue-100813.mHRdQn.rst
new file mode 100644
index 0000000..5bb876d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-01-06-22-36-27.gh-issue-100813.mHRdQn.rst
@@ -0,0 +1 @@
+Add :data:`socket.IP_PKTINFO` constant.
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 2c59c2f..4747a23 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -8351,6 +8351,9 @@ PyInit__socket(void)
#ifdef IP_TRANSPARENT
PyModule_AddIntMacro(m, IP_TRANSPARENT);
#endif
+#ifdef IP_PKTINFO
+ PyModule_AddIntMacro(m, IP_PKTINFO);
+#endif
#ifdef IP_BIND_ADDRESS_NO_PORT
PyModule_AddIntMacro(m, IP_BIND_ADDRESS_NO_PORT);
#endif