Skip to content

Commit fcd9500

Browse files
[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 05406b2) Co-authored-by: Gleb Smirnoff <glebius@FreeBSD.org>
1 parent ad53bf5 commit fcd9500

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed socket operations such as recvfrom() and sendto() for FreeBSD
2+
divert(4) socket.

Modules/socketmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2774,6 +2774,12 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
27742774
_Py_FALLTHROUGH;
27752775
#endif /* AF_RDS */
27762776

2777+
#ifdef AF_DIVERT
2778+
case AF_DIVERT:
2779+
/* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
2780+
_Py_FALLTHROUGH;
2781+
#endif /* AF_DIVERT */
2782+
27772783
case AF_INET:
27782784
{
27792785
*len_ret = sizeof (struct sockaddr_in);

0 commit comments

Comments
 (0)