Skip to content

Commit

Permalink
lib: fixed a small issue with windows address parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri committed Sep 23, 2021
1 parent 75b3474 commit 0c92a52
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions core/src/lib/bnet.cc
Expand Up @@ -417,11 +417,7 @@ dlist<IPADDR>* BnetHost2IpAddrs(const char* host,
addr->SetAddr4(&inaddr);
addr_list->append(addr);
#ifdef HAVE_IPV6
# ifndef HAVE_WIN32
} else if (inet_pton(AF_INET6, host, &inaddr6) == 1) {
# else
} else if (p_InetPton && p_InetPton(AF_INET6, host, &inaddr6) == 1) {
# endif
addr = new IPADDR(AF_INET6);
addr->SetType(IPADDR::R_MULTIPLE);
addr->SetAddr6(&inaddr6);
Expand Down
4 changes: 0 additions & 4 deletions core/src/win32/compat/winapi.cc
Expand Up @@ -105,7 +105,6 @@ t_CreateProcessW p_CreateProcessW = NULL;
t_GetLogicalDriveStringsA p_GetLogicalDriveStringsA = NULL;
t_GetLogicalDriveStringsW p_GetLogicalDriveStringsW = NULL;

t_InetPton p_InetPton = NULL;

void InitWinAPIWrapper()
{
Expand Down Expand Up @@ -259,8 +258,5 @@ void InitWinAPIWrapper()
}
}

hLib = LoadLibraryA("WS2_32.DLL");
if (hLib) { p_InetPton = (t_InetPton)GetProcAddress(hLib, "InetPtonA"); }

atexit(Win32TSDCleanup);
}
1 change: 0 additions & 1 deletion core/src/win32/include/winapi.h
Expand Up @@ -275,7 +275,6 @@ extern t_SHGetFolderPath p_SHGetFolderPath;
typedef INT(WSAAPI* t_InetPton)(INT Family,
PCTSTR pszAddrString,
PVOID pAddrBuf);
extern t_InetPton p_InetPton;

#endif
#endif // BAREOS_WIN32_INCLUDE_WINAPI_H_

0 comments on commit 0c92a52

Please sign in to comment.