https://github.com/python/cpython/commit/fcd9500c53cd828c39b734a3e7fa588b0c29a76b commit: fcd9500c53cd828c39b734a3e7fa588b0c29a76b branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: vstinner <[email protected]> date: 2026-01-07T14:20:07Z summary:
[3.14] gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (GH-142993) (#143481) gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (GH-142993) (cherry picked from commit 05406b221dc9d5946c60253392788d60f1f08c8b) Co-authored-by: Gleb Smirnoff <[email protected]> files: A Misc/NEWS.d/next/Library/2025-12-20-10-21-23.gh-issue-142991.jYHD9E.rst M Modules/socketmodule.c diff --git a/Misc/NEWS.d/next/Library/2025-12-20-10-21-23.gh-issue-142991.jYHD9E.rst b/Misc/NEWS.d/next/Library/2025-12-20-10-21-23.gh-issue-142991.jYHD9E.rst new file mode 100644 index 00000000000000..2c76bb4f2bcff9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-12-20-10-21-23.gh-issue-142991.jYHD9E.rst @@ -0,0 +1,2 @@ +Fixed socket operations such as recvfrom() and sendto() for FreeBSD +divert(4) socket. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 1fbd6eb9294cfa..8c8a5efa8c99b7 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2774,6 +2774,12 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret) _Py_FALLTHROUGH; #endif /* AF_RDS */ +#ifdef AF_DIVERT + case AF_DIVERT: + /* FreeBSD divert(4) sockets use sockaddr_in: fall-through */ + _Py_FALLTHROUGH; +#endif /* AF_DIVERT */ + case AF_INET: { *len_ret = sizeof (struct sockaddr_in); _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
