From 12b513d837c9da5277390ddaf98ca0058339977a Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 20 Jul 2011 12:20:13 +0200 Subject: slirp: Fix restricted mode This aligns the code to what the documentation claims: Allow everything but requests that would have to be routed outside of the virtual LAN. So we need to drop the unneeded IP-level filter, allow TFTP requests, and add the missing protocol-level filter to ICMP. CC: Gleb Natapov Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- slirp/ip_icmp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'slirp/ip_icmp.c') diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c index 751a8e2..0cd129c 100644 --- a/slirp/ip_icmp.c +++ b/slirp/ip_icmp.c @@ -101,6 +101,8 @@ icmp_input(struct mbuf *m, int hlen) ip->ip_len += hlen; /* since ip_input subtracts this */ if (ip->ip_dst.s_addr == slirp->vhost_addr.s_addr) { icmp_reflect(m); + } else if (slirp->restricted) { + goto freeit; } else { struct socket *so; struct sockaddr_in addr; -- cgit v1.1