if_llatbl.c (210533) | if_llatbl.c (213929) |
---|---|
1/* 2 * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. 3 * Copyright (c) 2004-2008 Qing Li. All rights reserved. 4 * Copyright (c) 2008 Kip Macy. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved. 3 * Copyright (c) 2004-2008 Qing Li. All rights reserved. 4 * Copyright (c) 2008 Kip Macy. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/net/if_llatbl.c 210533 2010-07-27 11:56:49Z glebius $"); | 28__FBSDID("$FreeBSD: head/sys/net/if_llatbl.c 213929 2010-10-16 18:42:09Z bz $"); |
29 30#include "opt_ddb.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> --- 141 unchanged lines hidden (view full) --- 178 LLE_REMREF(lle); 179 llentry_free(lle); 180 } 181 } 182 183 free(llt, M_LLTABLE); 184} 185 | 29 30#include "opt_ddb.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> --- 141 unchanged lines hidden (view full) --- 178 LLE_REMREF(lle); 179 llentry_free(lle); 180 } 181 } 182 183 free(llt, M_LLTABLE); 184} 185 |
186#if 0 |
|
186void 187lltable_drain(int af) 188{ 189 struct lltable *llt; 190 struct llentry *lle; 191 register int i; 192 193 LLTABLE_RLOCK(); 194 SLIST_FOREACH(llt, &V_lltables, llt_link) { 195 if (llt->llt_af != af) 196 continue; 197 198 for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { 199 LIST_FOREACH(lle, &llt->lle_head[i], lle_next) { | 187void 188lltable_drain(int af) 189{ 190 struct lltable *llt; 191 struct llentry *lle; 192 register int i; 193 194 LLTABLE_RLOCK(); 195 SLIST_FOREACH(llt, &V_lltables, llt_link) { 196 if (llt->llt_af != af) 197 continue; 198 199 for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { 200 LIST_FOREACH(lle, &llt->lle_head[i], lle_next) { |
201 LLE_WLOCK(lle); |
|
200 if (lle->la_hold) { 201 m_freem(lle->la_hold); 202 lle->la_hold = NULL; 203 } | 202 if (lle->la_hold) { 203 m_freem(lle->la_hold); 204 lle->la_hold = NULL; 205 } |
206 LLE_WUNLOCK(lle); |
|
204 } 205 } 206 } 207 LLTABLE_RUNLOCK(); 208} | 207 } 208 } 209 } 210 LLTABLE_RUNLOCK(); 211} |
212#endif |
|
209 210void 211lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask) 212{ 213 struct lltable *llt; 214 215 LLTABLE_RLOCK(); 216 SLIST_FOREACH(llt, &V_lltables, llt_link) { --- 306 unchanged lines hidden --- | 213 214void 215lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask) 216{ 217 struct lltable *llt; 218 219 LLTABLE_RLOCK(); 220 SLIST_FOREACH(llt, &V_lltables, llt_link) { --- 306 unchanged lines hidden --- |