slirp: drop <Vista compatibility

Since commit 12f8def0e0 (v2.9), qemu
requires Vista. Let's remove some conditional code.

Note that this introduces a missing declaration warning with mingw.
warning: implicit declaration of function 'inet_ntop'

See also: 36473782/

We could workaround it by declaring it ourself depending on __MINGW64_VERSION_*:
WINSOCK_API_LINKAGE INT WSAAPI inet_pton(int Family, PCTSTR pszAddrString, PVOID pAddrBuf);

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
Marc-André Lureau 2018-11-22 02:06:19 +04:00 committed by Samuel Thibault
parent e589a4423f
commit df2ad332da
3 changed files with 10 additions and 36 deletions

View file

@ -290,17 +290,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
}
#endif
#if defined(_WIN32) && (_WIN32_WINNT < 0x0600)
/* No inet_pton helper before Vista... */
if (vprefix6) {
/* Unsupported */
error_setg(errp, "IPv6 prefix not supported");
return -1;
}
memset(&ip6_prefix, 0, sizeof(ip6_prefix));
ip6_prefix.s6_addr[0] = 0xfe;
ip6_prefix.s6_addr[1] = 0xc0;
#else
if (!vprefix6) {
vprefix6 = "fec0::";
}
@ -308,7 +297,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
error_setg(errp, "Failed to parse IPv6 prefix");
return -1;
}
#endif
if (!vprefix6_len) {
vprefix6_len = 64;
@ -320,10 +308,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
}
if (vhost6) {
#if defined(_WIN32) && (_WIN32_WINNT < 0x0600)
error_setg(errp, "IPv6 host not supported");
return -1;
#else
if (!inet_pton(AF_INET6, vhost6, &ip6_host)) {
error_setg(errp, "Failed to parse IPv6 host");
return -1;
@ -332,17 +316,12 @@ static int net_slirp_init(NetClientState *peer, const char *model,
error_setg(errp, "IPv6 Host doesn't belong to network");
return -1;
}
#endif
} else {
ip6_host = ip6_prefix;
ip6_host.s6_addr[15] |= 2;
}
if (vnameserver6) {
#if defined(_WIN32) && (_WIN32_WINNT < 0x0600)
error_setg(errp, "IPv6 DNS not supported");
return -1;
#else
if (!inet_pton(AF_INET6, vnameserver6, &ip6_dns)) {
error_setg(errp, "Failed to parse IPv6 DNS");
return -1;
@ -351,7 +330,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
error_setg(errp, "IPv6 DNS doesn't belong to network");
return -1;
}
#endif
} else {
ip6_dns = ip6_prefix;
ip6_dns.s6_addr[15] |= 3;