From 5c1368a7243978761479cb07b26a26d103f8f6e0 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Fri, 21 Dec 2007 14:25:43 +0000 Subject: Merge in6_pcb.c:1.86 from HEAD to RELENG_7: Fix leaking MAC labels for IPv6 inpcbs by adding missing MAC label destroy call; this transpired because the inpcb alloc path for IPv4/IPv6 is the same code, but IPv6 has a separate free path. The results was that as new IPv6 TCP connections were created, kernel memory would gradually leak. Reported by: tanyong , zhouzhouyi Approved by: re (kensmith) --- sys/netinet6/in6_pcb.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sys/netinet6') diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index f21a0f67ee1e..d81c6f20c6a5 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -65,6 +65,7 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" +#include "opt_mac.h" #include #include @@ -105,6 +106,8 @@ #include #endif /* IPSEC */ +#include + struct in6_addr zeroin6_addr; int @@ -433,6 +436,9 @@ in6_pcbfree(struct inpcb *inp) if (inp->inp_moptions != NULL) inp_freemoptions(inp->inp_moptions); inp->inp_vflag = 0; +#ifdef MAC + mac_destroy_inpcb(inp); +#endif INP_UNLOCK(inp); uma_zfree(ipi->ipi_zone, inp); } -- cgit v1.3