[Slirp] [Git][slirp/libslirp][master] 2 commits: ip6_output: fix memory leak on fast-send
Samuel Thibault
gitlab at gitlab.freedesktop.org
Thu Feb 18 11:33:23 UTC 2021
Samuel Thibault pushed to branch master at slirp / libslirp
Commits:
a973c592 by Samuel Thibault at 2021-02-18T12:06:46+01:00
ip6_output: fix memory leak on fast-send
When emitting NDP Neighbour Sollicitations, ip6_output immediately calls
if_encap without going through any queue. if_encap however does not free
the mbuf, so ip6_output has to do it.
This was leaking one mbuf per NDP NS sent by slirp. Hopefully the guest was
not using more than NDP_TABLE_SIZE (16) IPv6 addresses, in which case it was
limited to a bound number, but more addresses would result to leaks.
- - - - -
99b3b70a by Samuel Thibault at 2021-02-18T11:33:21+00:00
Merge branch 'ndp-leak' into 'master'
ip6_output: fix memory leak on fast-send
See merge request slirp/libslirp!67
- - - - -
1 changed file:
- src/ip6_output.c
Changes:
=====================================
src/ip6_output.c
=====================================
@@ -30,7 +30,10 @@ int ip6_output(struct socket *so, struct mbuf *m, int fast)
ip->ip_fl_lo = 0;
if (fast) {
+ /* We cannot fast-send non-multicast, we'd need a NDP NS */
+ assert(IN6_IS_ADDR_MULTICAST(&ip->ip_dst));
if_encap(m->slirp, m);
+ m_free(m);
} else {
if_output(so, m);
}
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/26ae658a83eeca16780cf5615c8247cbb151c3fa...99b3b70af627980ee3490944c702b42fc855ef2a
--
View it on GitLab: https://gitlab.freedesktop.org/slirp/libslirp/-/compare/26ae658a83eeca16780cf5615c8247cbb151c3fa...99b3b70af627980ee3490944c702b42fc855ef2a
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/slirp/attachments/20210218/82efd0b3/attachment-0001.htm>
More information about the Slirp
mailing list