8000 gh-120056: Add `IP_RECVERR`, `IP_RECVORIGDSTADDR`, `IP_RECVTTL` to `socket` module by sobolevn · Pull Request #120058 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120056: Add IP_RECVERR, IP_RECVORIGDSTADDR, IP_RECVTTL to socket module #120058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ Constants
same way that ``SO_BINDTODEVICE`` is used, but with the index of a
network interface instead of its name.

.. versionchanged:: 3.14
Added missing ``IP_RECVERR``, ``IP_RECVTTL``, and ``IP_RECVORIGDSTADDR``
on Linux.

.. data:: AF_CAN
PF_CAN
SOL_CAN_*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add :data:`!socket.IP_RECVERR` and :data:`!socket.IP_RECVTTL` constants
(both available since Linux 2.2).
And :data:`!socket.IP_RECVORIGDSTADDR` constant (available since Linux 2.6.29).
9 changes: 9 additions & 0 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8412,15 +8412,24 @@ socket_exec(PyObject *m)
#ifdef IP_TTL
ADD_INT_MACRO(m, IP_TTL);
#endif
#ifdef IP_RECVERR
ADD_INT_MACRO(m, IP_RECVERR);
#endif
#ifdef IP_RECVOPTS
ADD_INT_MACRO(m, IP_RECVOPTS);
#endif
#ifdef IP_RECVORIGDSTADDR
ADD_INT_MACRO(m, IP_RECVORIGDSTADDR);
#endif
#ifdef IP_RECVRETOPTS
ADD_INT_MACRO(m, IP_RECVRETOPTS);
#endif
#ifdef IP_RECVTOS
ADD_INT_MACRO(m, IP_RECVTOS);
#endif
#ifdef IP_RECVTTL
ADD_INT_MACRO(m, IP_RECVTTL);
#endif
#ifdef IP_RECVDSTADDR
ADD_INT_MACRO(m, IP_RECVDSTADDR);
#endif
Expand Down
Loading
0