diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-08 19:24:00 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-08 19:24:00 +0000 |
commit | 27798c4bad6c56ce7faeefdc082fd501824c00bf (patch) | |
tree | 41fedaaa3c71d33e1435c878521c37563eaef404 /slirp.c | |
parent | 8a83e031bcc60c0fbfee518a265ee8b7c12c1e36 (diff) | |
download | slirp-27798c4bad6c56ce7faeefdc082fd501824c00bf.zip slirp-27798c4bad6c56ce7faeefdc082fd501824c00bf.tar.gz slirp-27798c4bad6c56ce7faeefdc082fd501824c00bf.tar.bz2 |
Add slirp_restrict option (Gleb Natapov)
Add "slirp firewall" to permit connection only to vmchannel addresses.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6241 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'slirp.c')
-rw-r--r-- | slirp.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -46,6 +46,8 @@ static struct in_addr client_ipaddr; static const uint8_t zero_ethaddr[6] = { 0, 0, 0, 0, 0, 0 }; +char *slirp_special_ip = CTL_SPECIAL; +int slirp_restrict; int do_slowtimo; int link_up; struct timeval tt; @@ -164,7 +166,7 @@ static void slirp_cleanup(void) } #endif -void slirp_init(void) +void slirp_init(int restrict, char *special_ip) { // debug_init("/tmp/slirp.log", DEBUG_DEFAULT); @@ -177,6 +179,7 @@ void slirp_init(void) #endif link_up = 1; + slirp_restrict = restrict; if_init(); ip_init(); @@ -192,7 +195,10 @@ void slirp_init(void) fprintf(stderr, "Warning: No DNS servers found\n"); } - inet_aton(CTL_SPECIAL, &special_addr); + if (special_ip) + slirp_special_ip = special_ip; + + inet_aton(slirp_special_ip, &special_addr); alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS); getouraddr(); } |