gh-142991: socketmodule: fixed getsockaddrlen() for PF_DIVERT socket (GH-142993)
(cherry picked from commit
05406b221dc9d5946c60253392788d60f1f08c8b)
Co-authored-by: Gleb Smirnoff <glebius@FreeBSD.org>
--- /dev/null
+Fixed socket operations such as recvfrom() and sendto() for FreeBSD
+divert(4) socket.
_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);