Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
In order to support CFI, we would like to avoid passing function pointers out of
libslirp, and instead use opaque integers for the timer callbacks. This patch
introduces an internal API for creating a timer that is based on such a timer
callback.
For now, it receives the id (SLIRP_TIMER_RA is the only one) and calls
slirp->cb->timer_new. The prototype of ra_timer_handler is changed slightly
to fit better with the next patch which introduces a new libslirp function,
to be called on timer expiration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This adds a few helpers for debugging mbuf allocations when running in
debugging mode (lsan, valgrind, etc.)
- We do not want to cache allocations, so always set M_DOFREE to prevent
us from putting any mbuf in it.
- We want to update the mbuf allocation owner on function call for more
precise leak reporting.
Based on Jeremy Marchand's fuzzing work.
Signed-off-by: jeremy marchand <jeremy.marchand@etu.u-bordeaux.fr>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
They work like icmp_send_error and icmp6_send_error but allow to specify
the source IP address
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
The code is unreachable, so no need to break.
This silence static analyzer warnings.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|
|
From https://github.com/rootless-containers/slirp4netns/blob/4889f5299f407d7d7566c76a3b8b5f71c99b6db5/qemu_patches/0002-slirp-allow-custom-MTU.patch
Original commits:
* https://github.com/rootless-containers/slirp4netns/commit/ea630a7e945cf538184ff1b1b4bd7b8ddc01993e
* https://github.com/rootless-containers/slirp4netns/commit/1508a66c93c223555f08651592dde3d2d708b166
* https://github.com/rootless-containers/slirp4netns/commit/19f3f41df4066d6103e6f882500e24db7ea7d9e1
* https://github.com/rootless-containers/slirp4netns/commit/a11abedafcc627ef0657999e63b211b0f26d4c02
* https://github.com/rootless-containers/slirp4netns/commit/2adbd7c449944d3b837164c86eedd3dcabbba1a6
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
|
Add SPDX license identifier to clarify the license of files without
explicit license header.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
|
Prepare for making slirp/ a standalone project.
Remove some useless includes while at it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190212162524.31504-5-marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|