aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/in_var.h
diff options
context:
space:
mode:
authorBruce M Simpson <bms@FreeBSD.org>2007-03-20 00:36:10 +0000
committerBruce M Simpson <bms@FreeBSD.org>2007-03-20 00:36:10 +0000
commitec002fee9957c147af90cc5159ef6d2f5538dc73 (patch)
treea99ae311b25195ab5b7322b739f496dec7a7cd69 /sys/netinet/in_var.h
parent9239bab2fe997237304f8b04476a165276571595 (diff)
downloadsrc-ec002fee9957c147af90cc5159ef6d2f5538dc73.tar.gz
src-ec002fee9957c147af90cc5159ef6d2f5538dc73.zip
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
Notes
Notes: svn path=/head/; revision=167729
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 7d22844fe513..7605199c8d88 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);