From 3298c5517bb9aade0f397fde3626919f97e7945a Mon Sep 17 00:00:00 2001 From: burlex Date: Thu, 14 Jun 2007 18:34:23 +0000 Subject: - Fix for a bug in the win32 inet_ptoa implementation causing CIDR parsing to incorrectly return false in some instances. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7307 e03df62e-2008-0410-955e-edbf42e46eb7 --- win/inspircd_win32wrapper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index 6bea73640..d2dcd7456 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -65,6 +65,13 @@ int inet_pton(int af, const char *src, void *dst) sockaddr_in sa; int len = sizeof(SOCKADDR); int rv = WSAStringToAddress((LPSTR)src, af, NULL, (LPSOCKADDR)&sa, &len); + if(rv >= 0) + { + if(WSAGetLastError() == 10022) // Invalid Argument + rv = 0; + else + rv = 1; + } memcpy(dst, &sa.sin_addr, sizeof(struct in_addr)); return rv; } -- cgit v1.2.3