in6.c (219819) | in6.c (222143) |
---|---|
1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)in.c 8.2 (Berkeley) 11/15/93 61 */ 62 63#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 47 unchanged lines hidden (view full) --- 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 58 * SUCH DAMAGE. 59 * 60 * @(#)in.c 8.2 (Berkeley) 11/15/93 61 */ 62 63#include <sys/cdefs.h> |
64__FBSDID("$FreeBSD: head/sys/netinet6/in6.c 219819 2011-03-21 09:40:01Z jeff $"); | 64__FBSDID("$FreeBSD: head/sys/netinet6/in6.c 222143 2011-05-20 19:12:20Z qingli $"); |
65 66#include "opt_compat.h" 67#include "opt_inet.h" 68#include "opt_inet6.h" 69 70#include <sys/param.h> 71#include <sys/errno.h> 72#include <sys/jail.h> --- 2298 unchanged lines hidden (view full) --- 2371 LLE_WUNLOCK(lle); 2372 LLE_LOCK_DESTROY(lle); 2373 free(lle, M_LLTABLE); 2374} 2375 2376static void 2377in6_lltable_prefix_free(struct lltable *llt, 2378 const struct sockaddr *prefix, | 65 66#include "opt_compat.h" 67#include "opt_inet.h" 68#include "opt_inet6.h" 69 70#include <sys/param.h> 71#include <sys/errno.h> 72#include <sys/jail.h> --- 2298 unchanged lines hidden (view full) --- 2371 LLE_WUNLOCK(lle); 2372 LLE_LOCK_DESTROY(lle); 2373 free(lle, M_LLTABLE); 2374} 2375 2376static void 2377in6_lltable_prefix_free(struct lltable *llt, 2378 const struct sockaddr *prefix, |
2379 const struct sockaddr *mask) | 2379 const struct sockaddr *mask, 2380 u_int flags) |
2380{ 2381 const struct sockaddr_in6 *pfx = (const struct sockaddr_in6 *)prefix; 2382 const struct sockaddr_in6 *msk = (const struct sockaddr_in6 *)mask; 2383 struct llentry *lle, *next; 2384 register int i; 2385 | 2381{ 2382 const struct sockaddr_in6 *pfx = (const struct sockaddr_in6 *)prefix; 2383 const struct sockaddr_in6 *msk = (const struct sockaddr_in6 *)mask; 2384 struct llentry *lle, *next; 2385 register int i; 2386 |
2387 /* 2388 * (flags & LLE_STATIC) means deleting all entries 2389 * including static ND6 entries 2390 */ |
|
2386 for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { 2387 LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { 2388 if (IN6_ARE_MASKED_ADDR_EQUAL( 2389 &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 2390 &pfx->sin6_addr, | 2391 for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { 2392 LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { 2393 if (IN6_ARE_MASKED_ADDR_EQUAL( 2394 &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 2395 &pfx->sin6_addr, |
2391 &msk->sin6_addr)) { | 2396 &msk->sin6_addr) && 2397 ((flags & LLE_STATIC) || !(lle->la_flags & LLE_STATIC))) { |
2392 int canceled; 2393 2394 canceled = callout_drain(&lle->la_timer); 2395 LLE_WLOCK(lle); 2396 if (canceled) 2397 LLE_REMREF(lle); 2398 llentry_free(lle); 2399 } --- 295 unchanged lines hidden --- | 2398 int canceled; 2399 2400 canceled = callout_drain(&lle->la_timer); 2401 LLE_WLOCK(lle); 2402 if (canceled) 2403 LLE_REMREF(lle); 2404 llentry_free(lle); 2405 } --- 295 unchanged lines hidden --- |