aboutsummaryrefslogtreecommitdiff
path: root/src/ip6_icmp.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-11slirp: invoke client callback before creating timersPaolo Bonzini1-1/+1
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>
2022-04-10introduce slirp_timer_new wrapperPaolo Bonzini1-6/+2
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>
2022-04-10icmp6: make ndp_send_ra staticPaolo Bonzini1-11/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-06-06mbuf: Add debugging helpers for allocationSamuel Thibault1-2/+2
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>
2021-06-06Check that we have the expected room before m_dataSamuel Thibault1-0/+5
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2020-07-19icmp, icmp6: Add icmp_forward_error and icmp6_forward_errorSamuel Thibault1-2/+8
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>
2020-06-01Remove unnecessary breakPhilippe Mathieu-Daudé1-1/+0
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>
2019-08-01allow custom MTUAkihiro Suda1-3/+3
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>
2019-03-22slirp: clarify license of slirp files using SPDX: implicit via unstatedMarc-André Lureau1-0/+1
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>
2019-03-07slirp: move sources to src/ subdirectoryMarc-André Lureau1-0/+433
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>