mirror of https://github.com/xemu-project/xemu.git
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:
parent
c1990468d5
commit
68756ba8be
16
net/slirp.c
16
net/slirp.c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue