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 --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * $KAME: in6_ifattach.c,v 1.118 2001/05/24 07:44:00 itojun Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/in6_ifattach.c 193232 2009-06-01 15:49:42Z bz $"); |
34 35#include "opt_route.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/malloc.h> 40#include <sys/socket.h> 41#include <sys/sockio.h> --- 730 unchanged lines hidden (view full) --- 772/* 773 * NOTE: in6_ifdetach() does not support loopback if at this moment. 774 * We don't need this function in bsdi, because interfaces are never removed 775 * from the ifnet list in bsdi. 776 */ 777void 778in6_ifdetach(struct ifnet *ifp) 779{ |
780 INIT_VNET_INET(ifp->if_vnet); 781 INIT_VNET_INET6(ifp->if_vnet); 782 struct in6_ifaddr *ia, *oia; 783 struct ifaddr *ifa, *next; |
784 struct radix_node_head *rnh; |
785 struct rtentry *rt; 786 short rtflags; 787 struct sockaddr_in6 sin6; 788 struct in6_multi_mship *imm; 789 790 /* remove neighbor management table */ 791 nd6_purge(ifp); 792 --- 76 unchanged lines hidden (view full) --- 869 bzero(&sin6, sizeof(sin6)); 870 sin6.sin6_len = sizeof(struct sockaddr_in6); 871 sin6.sin6_family = AF_INET6; 872 sin6.sin6_addr = in6addr_linklocal_allnodes; 873 if (in6_setscope(&sin6.sin6_addr, ifp, NULL)) 874 /* XXX: should not fail */ 875 return; 876 /* XXX grab lock first to avoid LOR */ |
877 rnh = rt_tables_get_rnh(0, AF_INET6); 878 if (rnh != NULL) { 879 RADIX_NODE_HEAD_LOCK(rnh); |
880 rt = rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED); 881 if (rt) { 882 if (rt->rt_ifp == ifp) 883 rtexpunge(rt); 884 RTFREE_LOCKED(rt); 885 } |
886 RADIX_NODE_HEAD_UNLOCK(rnh); |
887 } 888} 889 890int 891in6_get_tmpifid(struct ifnet *ifp, u_int8_t *retbuf, 892 const u_int8_t *baseid, int generate) 893{ 894 u_int8_t nullbuf[8]; --- 85 unchanged lines hidden --- |