diff -r 0d77a17567a4 Modules/socketmodule.c --- a/Modules/socketmodule.c Mon Mar 07 14:52:46 2016 -0500 +++ b/Modules/socketmodule.c Thu Mar 10 19:06:01 2016 -0800 @@ -4034,6 +4034,15 @@ return set_error(); } return PyLong_FromUnsignedLong(recv); } + case SIO_LOOPBACK_FAST_PATH: { + unsigned int option; + if (!PyArg_ParseTuple(arg, "kI:ioctl", &cmd, &option)) + return NULL; + if (WSAIoctl(s->sock_fd, cmd, &option, sizeof(option), + NULL, 0, &recv, NULL, NULL) == SOCKET_ERROR) { + return set_error(); + } + return PyLong_FromUnsignedLong(recv); } default: PyErr_Format(PyExc_ValueError, "invalid ioctl command %d", cmd); return NULL; @@ -4044,7 +4053,8 @@ \n\ Control the socket with WSAIoctl syscall. Currently supported 'cmd' values are\n\ SIO_RCVALL: 'option' must be one of the socket.RCVALL_* constants.\n\ -SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval)."); +SIO_KEEPALIVE_VALS: 'option' is a tuple of (onoff, timeout, interval).\n\ +SIO_LOOPBACK_FAST_PATH: 'option' is a boolean value (on or off)"); #endif #if defined(MS_WINDOWS) @@ -7220,8 +7230,8 @@ #ifdef SIO_RCVALL { - DWORD codes[] = {SIO_RCVALL, SIO_KEEPALIVE_VALS}; - const char *names[] = {"SIO_RCVALL", "SIO_KEEPALIVE_VALS"}; + DWORD codes[] = {SIO_RCVALL, SIO_KEEPALIVE_VALS, SIO_LOOPBACK_FAST_PATH}; + const char *names[] = {"SIO_RCVALL", "SIO_KEEPALIVE_VALS", "SIO_LOOPBACK_FAST_PATH"}; int i; for(i = 0; i