aboutsummaryrefslogtreecommitdiff
path: root/slirp/ip6_icmp.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-20 12:29:54 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-04-01 17:51:55 +0200
commit0b11c036620251f8f831ab8f0d9a7280ec1c4813 (patch)
treec8f390cd7e7cc6986b6a5febcdcaf5c99bc6012f /slirp/ip6_icmp.c
parentde1d099a448beb2ec39af4bd9ce4dd6452a18cb5 (diff)
downloadqemu-0b11c036620251f8f831ab8f0d9a7280ec1c4813.zip
qemu-0b11c036620251f8f831ab8f0d9a7280ec1c4813.tar.gz
qemu-0b11c036620251f8f831ab8f0d9a7280ec1c4813.tar.bz2
slirp: Allow disabling IPv4 or IPv6
Add ipv4 and ipv6 boolean options, so the user can setup IPv4-only and IPv6-only network environments. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'slirp/ip6_icmp.c')
-rw-r--r--slirp/ip6_icmp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/slirp/ip6_icmp.c b/slirp/ip6_icmp.c
index 9d61349..09571bc 100644
--- a/slirp/ip6_icmp.c
+++ b/slirp/ip6_icmp.c
@@ -24,6 +24,10 @@ static void ra_timer_handler(void *opaque)
void icmp6_init(Slirp *slirp)
{
+ if (!slirp->in6_enabled) {
+ return;
+ }
+
slirp->ra_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, ra_timer_handler, slirp);
timer_mod(slirp->ra_timer,
qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + NDP_Interval);
@@ -31,6 +35,10 @@ void icmp6_init(Slirp *slirp)
void icmp6_cleanup(Slirp *slirp)
{
+ if (!slirp->in6_enabled) {
+ return;
+ }
+
timer_del(slirp->ra_timer);
timer_free(slirp->ra_timer);
}