You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
socketmodule: support FreeBSD divert(4) socket #96534
FreeBSD has divert(4) socket since previous century. Until recently it was in the namespace of PF_INET:
s = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT)
This had no problems with Python's socketmodule, we just put a numeric constant in place of IPPROTO_DIVERT. And since bind(2) argument for divert(4) socket is struct sockaddr_in, luckily everything just worked.
Unfortunately Python's socketmodule can't support this, cause to perform socket.bind() it doesn't know how to construct sockaddr. Attempt to socket.bind() just bails out due to internal socket module error, not even coming to syscall:
s.bind(('0.0.0.0', port))
OSError: bind(): bad family
Activity
gh-96534: socketmodule: support FreeBSD divert(4) socket (#96536)
Merge branch 'main' into inlinecomp2
glebius commentedon Jan 11, 2024
The pull request had been merged.