Zebediah Figura : server: Map ENODEV to STATUS_INVALID_ADDRESS_COMPONENT.

Alexandre Julliard julliard at winehq.org
Thu Jul 22 16:28:18 CDT 2021


Module: wine
Branch: master
Commit: 06dd08ee44b140ca5182120926506e26f21a7c1e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=06dd08ee44b140ca5182120926506e26f21a7c1e

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Jul 21 20:34:55 2021 -0500

server: Map ENODEV to STATUS_INVALID_ADDRESS_COMPONENT.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/tests/sock.c | 4 +++-
 server/sock.c            | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index ed7d5121332..41fcb5d9248 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -10674,8 +10674,10 @@ static void test_bind(void)
                 addr6.sin6_scope_id = 0xabacab;
                 ret = bind(s, (struct sockaddr *)&addr6, sizeof(addr6));
                 todo_wine_if (!((const struct sockaddr_in6 *)unicast_addr->Address.lpSockaddr)->sin6_scope_id)
+                {
                     ok(ret == -1, "expected failure\n");
-                todo_wine ok(WSAGetLastError() == WSAEADDRNOTAVAIL, "got error %u\n", WSAGetLastError());
+                    ok(WSAGetLastError() == WSAEADDRNOTAVAIL, "got error %u\n", WSAGetLastError());
+                }
 
                 addr6.sin6_scope_id = 0;
                 ret = bind(s, (struct sockaddr *)&addr6, sizeof(addr6));
diff --git a/server/sock.c b/server/sock.c
index e28b0349027..f730bb31c55 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1976,6 +1976,9 @@ static int sock_get_ntstatus( int err )
         case ENOPROTOOPT:       return STATUS_INVALID_PARAMETER;
         case EOPNOTSUPP:        return STATUS_NOT_SUPPORTED;
         case EADDRINUSE:        return STATUS_SHARING_VIOLATION;
+        /* Linux returns ENODEV when specifying an invalid sin6_scope_id;
+         * Windows returns STATUS_INVALID_ADDRESS_COMPONENT */
+        case ENODEV:
         case EADDRNOTAVAIL:     return STATUS_INVALID_ADDRESS_COMPONENT;
         case ECONNREFUSED:      return STATUS_CONNECTION_REFUSED;
         case ESHUTDOWN:         return STATUS_PIPE_DISCONNECTED;




More information about the wine-cvs mailing list