summaryrefslogtreecommitdiffstats
path: root/sys/netinet/in_var.h
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2007-03-20 00:36:10 +0000
committerbms <bms@FreeBSD.org>2007-03-20 00:36:10 +0000
commit4ffc00490175f1ea8b4a87149bed2b0076df6f3b (patch)
treea99ae311b25195ab5b7322b739f496dec7a7cd69 /sys/netinet/in_var.h
parenta8db64a5b356ec426744ef16079c671b79e6369b (diff)
downloadFreeBSD-src-4ffc00490175f1ea8b4a87149bed2b0076df6f3b.zip
FreeBSD-src-4ffc00490175f1ea8b4a87149bed2b0076df6f3b.tar.gz
Implement reference counting for ifmultiaddr, in_multi, and in6_multi
structures. Detect when ifnet instances are detached from the network stack and perform appropriate cleanup to prevent memory leaks. This has been implemented in such a way as to be backwards ABI compatible. Kernel consumers are changed to use if_delmulti_ifma(); in_delmulti() is unable to detect interface removal by design, as it performs searches on structures which are removed with the interface. With this architectural change, the panics FreeBSD users have experienced with carp and pfsync should be resolved. Obtained from: p4 branch bms_netdev Reviewed by: andre Sponsored by: Garance A Drosehn Idea from: NetBSD MFC after: 1 month
Diffstat (limited to 'sys/netinet/in_var.h')
-rw-r--r--sys/netinet/in_var.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/in_var.h b/sys/netinet/in_var.h
index 7d22844..7605199 100644
--- a/sys/netinet/in_var.h
+++ b/sys/netinet/in_var.h
@@ -165,6 +165,7 @@ struct in_multi {
u_int inm_timer; /* IGMP membership report timer */
u_int inm_state; /* state of the membership */
struct router_info *inm_rti; /* router info*/
+ u_int inm_refcount; /* reference count */
};
#ifdef _KERNEL
@@ -248,7 +249,6 @@ struct route;
struct in_multi *in_addmulti(struct in_addr *, struct ifnet *);
void in_delmulti(struct in_multi *);
void in_delmulti_locked(struct in_multi *);
-void in_delmulti_ifp(struct ifnet *ifp);
int in_control(struct socket *, u_long, caddr_t, struct ifnet *,
struct thread *);
void in_rtqdrain(void);
OpenPOWER on IntegriCloud