Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/nd6_nbr.c
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
static void nd6_dad_stoptimer(struct dadq *); | static void nd6_dad_stoptimer(struct dadq *); | ||||
static void nd6_dad_timer(struct dadq *); | static void nd6_dad_timer(struct dadq *); | ||||
static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); | static void nd6_dad_duplicated(struct ifaddr *, struct dadq *); | ||||
static void nd6_dad_ns_output(struct dadq *, struct ifaddr *); | static void nd6_dad_ns_output(struct dadq *, struct ifaddr *); | ||||
static void nd6_dad_ns_input(struct ifaddr *); | static void nd6_dad_ns_input(struct ifaddr *); | ||||
static void nd6_dad_na_input(struct ifaddr *); | static void nd6_dad_na_input(struct ifaddr *); | ||||
static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, | static void nd6_na_output_fib(struct ifnet *, const struct in6_addr *, | ||||
const struct in6_addr *, u_long, int, struct sockaddr *, u_int); | const struct in6_addr *, u_long, int, struct sockaddr *, u_int); | ||||
static void nd6_ns_output_fib(struct ifnet *, const struct in6_addr *, | |||||
const struct in6_addr *, struct llentry *, int, u_int); | |||||
static VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD | static VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD | ||||
- specwise incorrect */ | - specwise incorrect */ | ||||
static VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to | static VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to | ||||
transmit DAD packet */ | transmit DAD packet */ | ||||
#define V_dad_ignore_ns VNET(dad_ignore_ns) | #define V_dad_ignore_ns VNET(dad_ignore_ns) | ||||
#define V_dad_maxtry VNET(dad_maxtry) | #define V_dad_maxtry VNET(dad_maxtry) | ||||
▲ Show 20 Lines • Show All 277 Lines • ▼ Show 20 Lines | |||||
* - ND6 header source datalink address | * - ND6 header source datalink address | ||||
* | * | ||||
* Based on RFC 2461 | * Based on RFC 2461 | ||||
* Based on RFC 2462 (duplicate address detection) | * Based on RFC 2462 (duplicate address detection) | ||||
* | * | ||||
* ln - for source address determination | * ln - for source address determination | ||||
* dad - duplicate address detection | * dad - duplicate address detection | ||||
*/ | */ | ||||
void | static void | ||||
nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, | nd6_ns_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6, | ||||
const struct in6_addr *taddr6, struct llentry *ln, int dad) | const struct in6_addr *taddr6, struct llentry *ln, int dad, u_int fibnum) | ||||
{ | { | ||||
struct mbuf *m; | struct mbuf *m; | ||||
struct m_tag *mtag; | struct m_tag *mtag; | ||||
struct ip6_hdr *ip6; | struct ip6_hdr *ip6; | ||||
struct nd_neighbor_solicit *nd_ns; | struct nd_neighbor_solicit *nd_ns; | ||||
struct ip6_moptions im6o; | struct ip6_moptions im6o; | ||||
int icmp6len; | int icmp6len; | ||||
int maxlen; | int maxlen; | ||||
Show All 15 Lines | #endif | ||||
} | } | ||||
if (max_linkhdr + maxlen > MHLEN) | if (max_linkhdr + maxlen > MHLEN) | ||||
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); | m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); | ||||
else | else | ||||
m = m_gethdr(M_NOWAIT, MT_DATA); | m = m_gethdr(M_NOWAIT, MT_DATA); | ||||
if (m == NULL) | if (m == NULL) | ||||
return; | return; | ||||
M_SETFIB(m, fibnum); | |||||
bzero(&ro, sizeof(ro)); | bzero(&ro, sizeof(ro)); | ||||
if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { | if (daddr6 == NULL || IN6_IS_ADDR_MULTICAST(daddr6)) { | ||||
m->m_flags |= M_MCAST; | m->m_flags |= M_MCAST; | ||||
im6o.im6o_multicast_ifp = ifp; | im6o.im6o_multicast_ifp = ifp; | ||||
im6o.im6o_multicast_hlim = 255; | im6o.im6o_multicast_hlim = 255; | ||||
im6o.im6o_multicast_loop = 0; | im6o.im6o_multicast_loop = 0; | ||||
▲ Show 20 Lines • Show All 162 Lines • ▼ Show 20 Lines | #endif | ||||
bad: | bad: | ||||
if (ro.ro_rt) { | if (ro.ro_rt) { | ||||
RTFREE(ro.ro_rt); | RTFREE(ro.ro_rt); | ||||
} | } | ||||
m_freem(m); | m_freem(m); | ||||
return; | return; | ||||
} | } | ||||
#ifndef BURN_BRIDGES | |||||
void | |||||
nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, | |||||
const struct in6_addr *taddr6, struct llentry *ln, int dad) | |||||
{ | |||||
nd6_ns_output_fib(ifp, daddr6, taddr6, ln, dad, RT_DEFAULT_FIB); | |||||
} | |||||
#endif | |||||
/* | /* | ||||
* Neighbor advertisement input handling. | * Neighbor advertisement input handling. | ||||
* | * | ||||
* Based on RFC 2461 | * Based on RFC 2461 | ||||
* Based on RFC 2462 (duplicate address detection) | * Based on RFC 2462 (duplicate address detection) | ||||
* | * | ||||
* the following items are not implemented yet: | * the following items are not implemented yet: | ||||
* - proxy advertisement delay rule (RFC2461 7.2.8, last paragraph, SHOULD) | * - proxy advertisement delay rule (RFC2461 7.2.8, last paragraph, SHOULD) | ||||
▲ Show 20 Lines • Show All 931 Lines • Show Last 20 Lines |