Deleted Added
full compact
in6_ifattach.c (193066) in6_ifattach.c (193232)
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>
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 193066 2009-05-29 21:27:12Z jamie $");
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{
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_NET(ifp->if_vnet);
781 INIT_VNET_INET(ifp->if_vnet);
782 INIT_VNET_INET6(ifp->if_vnet);
783 struct in6_ifaddr *ia, *oia;
784 struct ifaddr *ifa, *next;
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 */
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 if (V_rt_tables[0][AF_INET6] != NULL) {
878 RADIX_NODE_HEAD_LOCK(V_rt_tables[0][AF_INET6]);
877 rnh = rt_tables_get_rnh(0, AF_INET6);
878 if (rnh != NULL) {
879 RADIX_NODE_HEAD_LOCK(rnh);
879 rt = rtalloc1((struct sockaddr *)&sin6, 0, RTF_RNH_LOCKED);
880 if (rt) {
881 if (rt->rt_ifp == ifp)
882 rtexpunge(rt);
883 RTFREE_LOCKED(rt);
884 }
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 }
885 RADIX_NODE_HEAD_UNLOCK(V_rt_tables[0][AF_INET6]);
886 RADIX_NODE_HEAD_UNLOCK(rnh);
886 }
887}
888
889int
890in6_get_tmpifid(struct ifnet *ifp, u_int8_t *retbuf,
891 const u_int8_t *baseid, int generate)
892{
893 u_int8_t nullbuf[8];

--- 85 unchanged lines hidden ---
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 ---