nd6_nbr.c (175162) | nd6_nbr.c (178167) |
---|---|
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: nd6_nbr.c,v 1.86 2002/01/21 02:33:04 jinmei 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: nd6_nbr.c,v 1.86 2002/01/21 02:33:04 jinmei Exp $ 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/netinet6/nd6_nbr.c 175162 2008-01-08 19:08:58Z obrien $"); | 33__FBSDID("$FreeBSD: head/sys/netinet6/nd6_nbr.c 178167 2008-04-13 05:45:14Z qingli $"); |
34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_carp.h" | 34 35#include "opt_inet.h" 36#include "opt_inet6.h" 37#include "opt_ipsec.h" 38#include "opt_carp.h" |
39#include "opt_mpath.h" |
|
39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/malloc.h> 43#include <sys/mbuf.h> 44#include <sys/socket.h> 45#include <sys/sockio.h> 46#include <sys/time.h> 47#include <sys/kernel.h> 48#include <sys/errno.h> 49#include <sys/syslog.h> 50#include <sys/queue.h> 51#include <sys/callout.h> 52 53#include <net/if.h> 54#include <net/if_types.h> 55#include <net/if_dl.h> 56#include <net/if_var.h> 57#include <net/route.h> | 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> 45#include <sys/socket.h> 46#include <sys/sockio.h> 47#include <sys/time.h> 48#include <sys/kernel.h> 49#include <sys/errno.h> 50#include <sys/syslog.h> 51#include <sys/queue.h> 52#include <sys/callout.h> 53 54#include <net/if.h> 55#include <net/if_types.h> 56#include <net/if_dl.h> 57#include <net/if_var.h> 58#include <net/route.h> |
59#ifdef RADIX_MPATH 60#include <net/radix_mpath.h> 61#endif |
|
58 59#include <netinet/in.h> 60#include <netinet/in_var.h> 61#include <netinet6/in6_var.h> 62#include <netinet6/in6_ifattach.h> 63#include <netinet/ip6.h> 64#include <netinet6/ip6_var.h> 65#include <netinet6/scope6_var.h> --- 137 unchanged lines hidden (view full) --- 203 ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); 204#endif 205 206 /* (2) check. */ 207 if (ifa == NULL) { 208 struct rtentry *rt; 209 struct sockaddr_in6 tsin6; 210 int need_proxy; | 62 63#include <netinet/in.h> 64#include <netinet/in_var.h> 65#include <netinet6/in6_var.h> 66#include <netinet6/in6_ifattach.h> 67#include <netinet/ip6.h> 68#include <netinet6/ip6_var.h> 69#include <netinet6/scope6_var.h> --- 137 unchanged lines hidden (view full) --- 207 ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6); 208#endif 209 210 /* (2) check. */ 211 if (ifa == NULL) { 212 struct rtentry *rt; 213 struct sockaddr_in6 tsin6; 214 int need_proxy; |
215#ifdef RADIX_MPATH 216 struct route_in6 ro; 217#endif |
|
211 212 bzero(&tsin6, sizeof tsin6); 213 tsin6.sin6_len = sizeof(struct sockaddr_in6); 214 tsin6.sin6_family = AF_INET6; 215 tsin6.sin6_addr = taddr6; 216 | 218 219 bzero(&tsin6, sizeof tsin6); 220 tsin6.sin6_len = sizeof(struct sockaddr_in6); 221 tsin6.sin6_family = AF_INET6; 222 tsin6.sin6_addr = taddr6; 223 |
224#ifdef RADIX_MPATH 225 bzero(&ro, sizeof(ro)); 226 ro.ro_dst = tsin6; 227 rtalloc_mpath((struct route *)&ro, RTF_ANNOUNCE); 228 rt = ro.ro_rt; 229#else |
|
217 rt = rtalloc1((struct sockaddr *)&tsin6, 0, 0); | 230 rt = rtalloc1((struct sockaddr *)&tsin6, 0, 0); |
231#endif |
|
218 need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && 219 rt->rt_gateway->sa_family == AF_LINK); 220 if (rt) 221 rtfree(rt); 222 if (need_proxy) { 223 /* 224 * proxy NDP for single entry 225 */ --- 1230 unchanged lines hidden --- | 232 need_proxy = (rt && (rt->rt_flags & RTF_ANNOUNCE) != 0 && 233 rt->rt_gateway->sa_family == AF_LINK); 234 if (rt) 235 rtfree(rt); 236 if (need_proxy) { 237 /* 238 * proxy NDP for single entry 239 */ --- 1230 unchanged lines hidden --- |