aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip_icmp.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-07-20 12:20:13 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2011-07-23 10:19:49 -0500
commit12b513d837c9da5277390ddaf98ca0058339977a (patch)
tree57d4e937818492effc1f31402dc830b1ca0b206c /slirp/ip_icmp.c
parent80f52a6694423da7a40e2ec39e14a5817184c7ef (diff)
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 <gleb@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'slirp/ip_icmp.c')
-rw-r--r--slirp/ip_icmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c
index 751a8e249a..0cd129cc97 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;