Skip to content

Commit d32d48b

Browse files
glebiusmiss-islington
authored andcommitted
pythongh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (pythonGH-142993)
(cherry picked from commit 05406b2) Co-authored-by: Gleb Smirnoff <[email protected]>
1 parent 97694de commit d32d48b

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
@@ -2649,6 +2649,12 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
26492649
/* RDS sockets use sockaddr_in: fall-through */
26502650
#endif /* AF_RDS */
26512651

2652+
#ifdef AF_DIVERT
2653+
case AF_DIVERT:
2654+
/* FreeBSD divert(4) sockets use sockaddr_in: fall-through */
2655+
_Py_FALLTHROUGH;
2656+
#endif /* AF_DIVERT */
2657+
26522658
case AF_INET:
26532659
{
26542660
*len_ret = sizeof (struct sockaddr_in);

0 commit comments

Comments
 (0)