summaryrefslogtreecommitdiff
path: root/slirp/slirp.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/slirp.c')
-rw-r--r--slirp/slirp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/slirp/slirp.c b/slirp/slirp.c
index 998f27876c..fef526c5ad 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -200,8 +200,9 @@ static void slirp_init_once(void)
static void slirp_state_save(QEMUFile *f, void *opaque);
static int slirp_state_load(QEMUFile *f, void *opaque, int version_id);
-Slirp *slirp_init(int restricted, struct in_addr vnetwork,
+Slirp *slirp_init(int restricted, bool in_enabled, struct in_addr vnetwork,
struct in_addr vnetmask, struct in_addr vhost,
+ bool in6_enabled,
struct in6_addr vprefix_addr6, uint8_t vprefix_len,
struct in6_addr vhost6, const char *vhostname,
const char *tftp_path, const char *bootfile,
@@ -216,6 +217,9 @@ Slirp *slirp_init(int restricted, struct in_addr vnetwork,
slirp->grand = g_rand_new();
slirp->restricted = restricted;
+ slirp->in_enabled = in_enabled;
+ slirp->in6_enabled = in6_enabled;
+
if_init(slirp);
ip_init(slirp);
ip6_init(slirp);
@@ -694,6 +698,10 @@ static void arp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len)
int ar_op;
struct ex_list *ex_ptr;
+ if (!slirp->in_enabled) {
+ return;
+ }
+
ar_op = ntohs(ah->ar_op);
switch(ar_op) {
case ARPOP_REQUEST: