Merge in6_pcb.c:1.86 from HEAD to RELENG_6:

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 <tanyong at ercist dot iscas dot ac dot cn>,
                  zhouzhouyi

Approved by:	re (kensmith)
This commit is contained in:
rwatson 2007-12-22 15:06:51 +00:00
parent 88ff3b6258
commit 7c5b9ca5c3

View File

@ -65,9 +65,11 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
#include "opt_mac.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/domain.h>
@ -457,6 +459,9 @@ in6_pcbdetach(inp)
(void)m_free(inp->inp_options);
ip_freemoptions(inp->inp_moptions);
inp->inp_vflag = 0;
#ifdef MAC
mac_destroy_inpcb(inp);
#endif
INP_UNLOCK(inp);
uma_zfree(ipi->ipi_zone, inp);
}