Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
gh-120056: Add IP_RECVERR and IP_RECVTTL to socket module
  • Loading branch information
sobolevn committed Jun 4, 2024
commit 1447a76d710b551bdf495dde9bf121bd2c84320a
3 changes: 3 additions & 0 deletions Doc/library/socket.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,9 @@ Constants
same way that ``SO_BINDTODEVICE`` is used, but with the index of a
network interface instead of its name.

.. versionchanged:: 3.14
Added ``IP_RECVERR`` and ``IP_RECVTTL``.
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated

.. data:: AF_CAN
PF_CAN
SOL_CAN_*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add :data:`socket.IP_RECVTTL` and :data:`socket.IP_RECVERR` constants.
6 changes: 6 additions & 0 deletions Modules/socketmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -8421,6 +8421,12 @@ socket_exec(PyObject *m)
#ifdef IP_RECVTOS
ADD_INT_MACRO(m, IP_RECVTOS);
#endif
#ifdef IP_RECVERR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you insert these in alphabetical order?

OOC why these two options? Just looking at man 7 ip, it looks like there are a few other options we are missing, e.g. IP_RECVORIGDSTADDR. Would it make sense to add more to make this list of options more complete?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I added these two, because I only needed these two :)
Will add more.

ADD_INT_MACRO(m, IP_RECVERR);
#endif
#ifdef IP_RECVTTL
ADD_INT_MACRO(m, IP_RECVTTL);
#endif
#ifdef IP_RECVDSTADDR
ADD_INT_MACRO(m, IP_RECVDSTADDR);
#endif
Expand Down