diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-11 12:24:58 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-11 12:36:41 +0200 |
commit | ec7c62a2715fef8d267a037166cd38d756e62188 (patch) | |
tree | 0032ea2b8e3f34b114e052e808b06a152a513a58 /src/ip6_icmp.c | |
parent | e7721e7fa54e4380533cf03875faadc5a67af4b7 (diff) | |
download | slirp-ec7c62a2715fef8d267a037166cd38d756e62188.zip slirp-ec7c62a2715fef8d267a037166cd38d756e62188.tar.gz slirp-ec7c62a2715fef8d267a037166cd38d756e62188.tar.bz2 |
slirp: invoke client callback before creating timers
The introduction of .timer_new_opaque adds an interesting conundrum.
The Slirp* needs to be stored in .timer_new_opaque so that it can be
passed back to slirp_handle_timer, but it is not returned by slirp_new
and slirp_init until after the first call to .timer_new_opaque (which
is in ip6_init). This is a problem for programs that, like QEMU, use
more than one Slirp*.
Fix them by passing the Slirp* to a callback before slirp_new returns,
and initializing the timer afterwards.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'src/ip6_icmp.c')
-rw-r--r-- | src/ip6_icmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ip6_icmp.c b/src/ip6_icmp.c index 181989c..0d7ee69 100644 --- a/src/ip6_icmp.c +++ b/src/ip6_icmp.c @@ -10,7 +10,7 @@ #define NDP_Interval \ g_rand_int_range(slirp->grand, NDP_MinRtrAdvInterval, NDP_MaxRtrAdvInterval) -void icmp6_init(Slirp *slirp) +void icmp6_post_init(Slirp *slirp) { if (!slirp->in6_enabled) { return; |