aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_llatbl.h
diff options
context:
space:
mode:
authorKip Macy <kmacy@FreeBSD.org>2012-02-23 18:21:37 +0000
committerKip Macy <kmacy@FreeBSD.org>2012-02-23 18:21:37 +0000
commita93cda789aef8bb33ab335ebfe328971d33c4e39 (patch)
tree3a2da57fb6f6af971e7fb849770dc0f9b231bca2 /sys/net/if_llatbl.h
parent385a06b91741ee440d9817fcf99e7b8a9fc81e28 (diff)
downloadsrc-a93cda789aef8bb33ab335ebfe328971d33c4e39.tar.gz
src-a93cda789aef8bb33ab335ebfe328971d33c4e39.zip
When using flowtable llentrys can outlive the interface with which they're associated
at which the lle_tbl pointer points to freed memory and the llt_free pointer is no longer valid. Move the free pointer in to the llentry itself and update the initalization sites. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=232054
Diffstat (limited to 'sys/net/if_llatbl.h')
-rw-r--r--sys/net/if_llatbl.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h
index 2ae27927362d..e90b29c661dd 100644
--- a/sys/net/if_llatbl.h
+++ b/sys/net/if_llatbl.h
@@ -106,7 +106,6 @@ struct llentry {
("negative refcnt %d", (lle)->lle_refcnt)); \
(lle)->lle_refcnt++; \
} while (0)
-
#define LLE_REMREF(lle) do { \
LLE_WLOCK_ASSERT(lle); \
KASSERT((lle)->lle_refcnt > 1, \
@@ -116,7 +115,7 @@ struct llentry {
#define LLE_FREE_LOCKED(lle) do { \
if ((lle)->lle_refcnt <= 1) \
- (lle)->lle_tbl->llt_free((lle)->lle_tbl, (lle));\
+ (lle)->lle_free((lle)->lle_tbl, (lle));\
else { \
(lle)->lle_refcnt--; \
LLE_WUNLOCK(lle); \
@@ -152,7 +151,6 @@ struct lltable {
int llt_af;
struct ifnet *llt_ifp;
- void (*llt_free)(struct lltable *, struct llentry *);
void (*llt_prefix_free)(struct lltable *,
const struct sockaddr *prefix,
const struct sockaddr *mask,