classification
Title: IP_RECVTOS option is missing from socket module
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.11
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: gms, miss-islington, pablogsal, python-dev
Priority: normal Keywords: patch

Created on 2021-05-08 14:57 by gms, last changed 2021-06-20 20:36 by miss-islington.

Pull Requests
URL Status Linked Edit
PR 25992 merged python-dev, 2021-05-08 15:23
PR 26815 merged miss-islington, 2021-06-20 20:08
Messages (3)
msg393261 - (view) Author: Georg Sauthoff (gms) * Date: 2021-05-08 14:57
Currently, the socket module doesn't provide the IP_RECVTOS constant.

This constant is needed for receiving the TOS byte (or the DSCP bits) via ancillary data when calling recvmsg() or recvmsg_into().

That means it would be used in a setsockopt() call like this:

s.setsockopt(socket.IPPROTO_IP, socket.IP_RECVTOS, 1)

This socket option is available on Linux and perhaps other operating systems, as well.

See also https://manpath.be/f33/7/ip#L467
msg396192 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2021-06-20 20:08
New changeset a317778fd58b1c6b250feffbdb4ecf15e293ef48 by Georg Sauthoff in branch 'main':
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
https://github.com/python/cpython/commit/a317778fd58b1c6b250feffbdb4ecf15e293ef48
msg396198 - (view) Author: miss-islington (miss-islington) Date: 2021-06-20 20:36
New changeset 28fe0159f59a761bf52c1999c8f7cb12d0d12562 by Miss Islington (bot) in branch '3.10':
bpo-44077: Expose IP_RECVTOS in the socket module (GH-25992)
https://github.com/python/cpython/commit/28fe0159f59a761bf52c1999c8f7cb12d0d12562
History
Date User Action Args
2021-06-20 20:36:29miss-islingtonsetmessages: + msg396198
2021-06-20 20:08:25miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25396
2021-06-20 20:08:14pablogsalsetnosy: + pablogsal
messages: + msg396192
2021-05-08 15:23:49python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request24645
stage: patch review
2021-05-08 14:57:49gmscreate