fix -net user checks by reordering checks

reorder slirp config options. first check the dns-server-address,
then check the first-dhcp-address. the original code was comparing
the first-dhcp-address with the default dns-server-address, not
the configured dns-server-address.

Signed-off-by: Bas van Sisseren <bas@quarantainenet.nl>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Bas van Sisseren 2013-06-03 15:11:49 +02:00 committed by Jan Kiszka
parent c1990468d5
commit 68756ba8be
1 changed files with 8 additions and 8 deletions

View File

@ -212,14 +212,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
return -1;
}
if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
return -1;
}
if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
return -1;
}
if (vnameserver && !inet_aton(vnameserver, &dns)) {
return -1;
}
@ -228,6 +220,14 @@ static int net_slirp_init(NetClientState *peer, const char *model,
return -1;
}
if (vdhcp_start && !inet_aton(vdhcp_start, &dhcp)) {
return -1;
}
if ((dhcp.s_addr & mask.s_addr) != net.s_addr ||
dhcp.s_addr == host.s_addr || dhcp.s_addr == dns.s_addr) {
return -1;
}
#ifndef _WIN32
if (vsmbserver && !inet_aton(vsmbserver, &smbsrv)) {
return -1;