From a743ccd4683feafa94961764c8af21ee1c6740d1 Mon Sep 17 00:00:00 2001 From: "Alexander V. Chernikov" Date: Sun, 7 Dec 2014 15:42:46 +0000 Subject: * Add llt_clear_entry() callback which is able to do all lle cleanup including unlinking/freeing * Relax locking in lltable_prefix_free_af/lltable_free * Do not pass @llt to lle free callback: it is always NULL now. * Unify arptimer/nd6_llinfo_timer: explicitly unlock lle avoiding unlock/lock sequinces * Do not pass unlocked lle to nd6_ns_output(): add nd6_llinfo_get_holdsrc() to retrieve preferred source address from lle hold queue and pass it instead of lle. * Finally, make nd6_create() create and return unlocked lle * Separate defrtr handling code from nd6_free(): use nd6_check_del_defrtr() to check if we need to keep entry instead of performing GC, use nd6_check_recalc_defrtr() to perform actual recalc on lle removal. * Move isRouter handling from nd6_cache_lladdr() to separate nd6_check_router() * Add initial code to maintain lle runtime flags in sync. --- sys/net/if_llatbl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/net/if_llatbl.h') diff --git a/sys/net/if_llatbl.h b/sys/net/if_llatbl.h index 13c20f08f969..c8feb8851895 100644 --- a/sys/net/if_llatbl.h +++ b/sys/net/if_llatbl.h @@ -68,7 +68,7 @@ struct llentry { /* FIELDS PROTECTED BY LLE rwlock */ struct lltable *lle_tbl; struct llentries *lle_head; - void (*lle_free)(struct lltable *, struct llentry *); + void (*lle_free)(struct llentry *); struct mbuf *la_hold; int la_numheld; /* # of packets currently held */ time_t la_expire; @@ -117,7 +117,7 @@ struct llentry { #define LLE_FREE_LOCKED(lle) do { \ if ((lle)->lle_refcnt == 1) \ - (lle)->lle_free((lle)->lle_tbl, (lle)); \ + (lle)->lle_free((lle)); \ else { \ LLE_REMREF(lle); \ LLE_WUNLOCK(lle); \ @@ -158,7 +158,7 @@ typedef int (llt_dump_entry_t)(struct lltable *, struct llentry *, typedef uint32_t (llt_hash_t)(const struct llentry *); typedef int (llt_match_prefix_t)(const struct sockaddr *, const struct sockaddr *, u_int, struct llentry *); -typedef void (llt_stop_timers_t)(struct llentry *lle); +typedef void (llt_clear_entry_t)(struct lltable *, struct llentry *); struct lltable { SLIST_ENTRY(lltable) llt_link; @@ -172,7 +172,7 @@ struct lltable { llt_dump_entry_t *llt_dump_entry; llt_hash_t *llt_hash; llt_match_prefix_t *llt_match_prefix; - llt_stop_timers_t *llt_stop_timers; + llt_clear_entry_t *llt_clear_entry; }; MALLOC_DECLARE(M_LLTABLE); -- cgit v1.2.3