mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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:
committed by
Jan Kiszka
parent
c1990468d5
commit
68756ba8be
+8
-8
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user