mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
slirp: Rework internal configuration
The user mode IP stack is currently only minimally configurable /wrt to its virtual IP addresses. This is unfortunate if some guest has a fixed idea of which IP addresses to use. Therefore this patch prepares the stack for fully configurable IP addresses and masks. The user interface and default addresses remain untouched in this step, they will be enhanced in the following patch. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
ad196a9d0c
commit
a13a4126c8
@@ -134,18 +134,19 @@ ip_input(struct mbuf *m)
|
||||
}
|
||||
|
||||
if (slirp_restrict) {
|
||||
if (memcmp(&ip->ip_dst.s_addr, &special_addr, 3)) {
|
||||
if ((ip->ip_dst.s_addr & vnetwork_mask.s_addr) ==
|
||||
vnetwork_addr.s_addr) {
|
||||
if (ip->ip_dst.s_addr == 0xffffffff && ip->ip_p != IPPROTO_UDP)
|
||||
goto bad;
|
||||
} else {
|
||||
int host = ntohl(ip->ip_dst.s_addr) & 0xff;
|
||||
struct ex_list *ex_ptr;
|
||||
|
||||
if (host == 0xff)
|
||||
if ((ip->ip_dst.s_addr & ~vnetwork_mask.s_addr) ==
|
||||
~vnetwork_mask.s_addr)
|
||||
goto bad;
|
||||
|
||||
for (ex_ptr = exec_list; ex_ptr; ex_ptr = ex_ptr->ex_next)
|
||||
if (ex_ptr->ex_addr == host)
|
||||
if (ex_ptr->ex_addr.s_addr == ip->ip_dst.s_addr)
|
||||
break;
|
||||
|
||||
if (!ex_ptr)
|
||||
|
||||
Reference in New Issue
Block a user