Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/in6.c
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
#include <sys/rmlock.h> | #include <sys/rmlock.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <sys/syslog.h> | #include <sys/syslog.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#include <net/if_types.h> | #include <net/if_types.h> | ||||
#include <net/route.h> | #include <net/route.h> | ||||
#include <net/route/nhop.h> | |||||
#include <net/if_dl.h> | #include <net/if_dl.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_var.h> | #include <netinet/in_var.h> | ||||
#include <net/if_llatbl.h> | #include <net/if_llatbl.h> | ||||
#include <netinet/if_ether.h> | #include <netinet/if_ether.h> | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
▲ Show 20 Lines • Show All 2,034 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
in6_lltable_rtcheck(struct ifnet *ifp, | in6_lltable_rtcheck(struct ifnet *ifp, | ||||
u_int flags, | u_int flags, | ||||
const struct sockaddr *l3addr) | const struct sockaddr *l3addr) | ||||
{ | { | ||||
const struct sockaddr_in6 *sin6; | const struct sockaddr_in6 *sin6; | ||||
struct nhop6_basic nh6; | struct nhop_object *nh; | ||||
struct in6_addr dst; | struct in6_addr dst; | ||||
uint32_t scopeid; | uint32_t scopeid; | ||||
int error; | |||||
char ip6buf[INET6_ADDRSTRLEN]; | char ip6buf[INET6_ADDRSTRLEN]; | ||||
int fibnum; | int fibnum; | ||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
KASSERT(l3addr->sa_family == AF_INET6, | KASSERT(l3addr->sa_family == AF_INET6, | ||||
("sin_family %d", l3addr->sa_family)); | ("sin_family %d", l3addr->sa_family)); | ||||
sin6 = (const struct sockaddr_in6 *)l3addr; | sin6 = (const struct sockaddr_in6 *)l3addr; | ||||
in6_splitscope(&sin6->sin6_addr, &dst, &scopeid); | in6_splitscope(&sin6->sin6_addr, &dst, &scopeid); | ||||
fibnum = V_rt_add_addr_allfibs ? RT_DEFAULT_FIB : ifp->if_fib; | fibnum = V_rt_add_addr_allfibs ? RT_DEFAULT_FIB : ifp->if_fib; | ||||
error = fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6); | nh = fib6_lookup(fibnum, &dst, scopeid, NHR_NONE, 0); | ||||
if (error != 0 || (nh6.nh_flags & NHF_GATEWAY) || nh6.nh_ifp != ifp) { | if (nh && ((nh->nh_flags & NHF_GATEWAY) || nh->nh_ifp != ifp)) { | ||||
struct ifaddr *ifa; | struct ifaddr *ifa; | ||||
/* | /* | ||||
* Create an ND6 cache for an IPv6 neighbor | * Create an ND6 cache for an IPv6 neighbor | ||||
* that is not covered by our own prefix. | * that is not covered by our own prefix. | ||||
*/ | */ | ||||
ifa = ifaof_ifpforaddr(l3addr, ifp); | ifa = ifaof_ifpforaddr(l3addr, ifp); | ||||
if (ifa != NULL) { | if (ifa != NULL) { | ||||
return 0; | return 0; | ||||
▲ Show 20 Lines • Show All 390 Lines • Show Last 20 Lines |