in6.c (192282) | in6.c (192476) |
---|---|
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 192282 2009-05-18 02:25:45Z qingli $"); | 64__FBSDID("$FreeBSD: head/sys/netinet6/in6.c 192476 2009-05-20 21:07:15Z qingli $"); |
65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_route.h" 69 70#include <sys/param.h> 71#include <sys/errno.h> 72#include <sys/jail.h> --- 2206 unchanged lines hidden (view full) --- 2279static void 2280in6_lltable_free(struct lltable *llt, struct llentry *lle) 2281{ 2282 LLE_WUNLOCK(lle); 2283 LLE_LOCK_DESTROY(lle); 2284 free(lle, M_LLTABLE); 2285} 2286 | 65 66#include "opt_inet.h" 67#include "opt_inet6.h" 68#include "opt_route.h" 69 70#include <sys/param.h> 71#include <sys/errno.h> 72#include <sys/jail.h> --- 2206 unchanged lines hidden (view full) --- 2279static void 2280in6_lltable_free(struct lltable *llt, struct llentry *lle) 2281{ 2282 LLE_WUNLOCK(lle); 2283 LLE_LOCK_DESTROY(lle); 2284 free(lle, M_LLTABLE); 2285} 2286 |
2287static void 2288in6_lltable_prefix_free(struct lltable *llt, 2289 const struct sockaddr *prefix, 2290 const struct sockaddr *mask) 2291{ 2292 const struct sockaddr_in6 *pfx = (const struct sockaddr_in6 *)prefix; 2293 const struct sockaddr_in6 *msk = (const struct sockaddr_in6 *)mask; 2294 struct llentry *lle, *next; 2295 register int i; 2296 2297 for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { 2298 LIST_FOREACH_SAFE(lle, &llt->lle_head[i], lle_next, next) { 2299 if (IN6_ARE_MASKED_ADDR_EQUAL( 2300 &((struct sockaddr_in6 *)L3_ADDR(lle))->sin6_addr, 2301 &pfx->sin6_addr, 2302 &msk->sin6_addr)) { 2303 callout_drain(&lle->la_timer); 2304 LLE_WLOCK(lle); 2305 llentry_free(lle); 2306 } 2307 } 2308 } 2309} 2310 |
|
2287static int 2288in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) 2289{ 2290 struct rtentry *rt; 2291 char ip6buf[INET6_ADDRSTRLEN]; 2292 2293 KASSERT(l3addr->sa_family == AF_INET6, 2294 ("sin_family %d", l3addr->sa_family)); --- 190 unchanged lines hidden (view full) --- 2485 bzero(ext->icmp6_ifstat, sizeof(*ext->icmp6_ifstat)); 2486 2487 ext->nd_ifinfo = nd6_ifattach(ifp); 2488 ext->scope6_id = scope6_ifattach(ifp); 2489 ext->lltable = lltable_init(ifp, AF_INET6); 2490 if (ext->lltable != NULL) { 2491 ext->lltable->llt_new = in6_lltable_new; 2492 ext->lltable->llt_free = in6_lltable_free; | 2311static int 2312in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) 2313{ 2314 struct rtentry *rt; 2315 char ip6buf[INET6_ADDRSTRLEN]; 2316 2317 KASSERT(l3addr->sa_family == AF_INET6, 2318 ("sin_family %d", l3addr->sa_family)); --- 190 unchanged lines hidden (view full) --- 2509 bzero(ext->icmp6_ifstat, sizeof(*ext->icmp6_ifstat)); 2510 2511 ext->nd_ifinfo = nd6_ifattach(ifp); 2512 ext->scope6_id = scope6_ifattach(ifp); 2513 ext->lltable = lltable_init(ifp, AF_INET6); 2514 if (ext->lltable != NULL) { 2515 ext->lltable->llt_new = in6_lltable_new; 2516 ext->lltable->llt_free = in6_lltable_free; |
2517 ext->lltable->llt_prefix_free = in6_lltable_prefix_free; |
|
2493 ext->lltable->llt_rtcheck = in6_lltable_rtcheck; 2494 ext->lltable->llt_lookup = in6_lltable_lookup; 2495 ext->lltable->llt_dump = in6_lltable_dump; 2496 } 2497 2498 ext->mld_ifinfo = mld_domifattach(ifp); 2499 2500 return ext; --- 75 unchanged lines hidden --- | 2518 ext->lltable->llt_rtcheck = in6_lltable_rtcheck; 2519 ext->lltable->llt_lookup = in6_lltable_lookup; 2520 ext->lltable->llt_dump = in6_lltable_dump; 2521 } 2522 2523 ext->mld_ifinfo = mld_domifattach(ifp); 2524 2525 return ext; --- 75 unchanged lines hidden --- |