diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-06-06 16:38:14 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-06-06 17:06:33 +0200 |
commit | 5853f708864c969cf930ad863fef4286865e0310 (patch) | |
tree | 05a80b76e6918e8f31977058f31ff92820dbbd5a /src/ip6_icmp.c | |
parent | fedf9f1815d1d79d95c7d55678c463ec139adde8 (diff) | |
download | slirp-5853f708864c969cf930ad863fef4286865e0310.zip slirp-5853f708864c969cf930ad863fef4286865e0310.tar.gz slirp-5853f708864c969cf930ad863fef4286865e0310.tar.bz2 |
mbuf: Add debugging helpers for allocation
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>
Diffstat (limited to 'src/ip6_icmp.c')
-rw-r--r-- | src/ip6_icmp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ip6_icmp.c b/src/ip6_icmp.c index 21b1407..738b40f 100644 --- a/src/ip6_icmp.c +++ b/src/ip6_icmp.c @@ -385,12 +385,12 @@ static void ndp_input(struct mbuf *m, Slirp *slirp, struct ip6 *ip, */ void icmp6_input(struct mbuf *m) { + Slirp *slirp = m->slirp; /* NDP reads the ethernet header for gratuitous NDP */ - g_assert(M_ROOMBEFORE(m) >= ETH_HLEN); + M_DUP_DEBUG(slirp, m, 1, ETH_HLEN); struct icmp6 *icmp; struct ip6 *ip = mtod(m, struct ip6 *); - Slirp *slirp = m->slirp; int hlen = sizeof(struct ip6); DEBUG_CALL("icmp6_input"); |