-/* $OpenBSD: tcp_input.c,v 1.269 2013/10/20 11:03:01 phessler Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.270 2014/01/07 17:07:45 mikeb Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
do { \
if (tp && tp->t_inpcb && (tp->t_inpcb->inp_flags & INP_IPV6) && \
tp->t_inpcb->inp_route6.ro_rt) { \
- nd6_nud_hint(tp->t_inpcb->inp_route6.ro_rt, NULL, 0); \
+ nd6_nud_hint(tp->t_inpcb->inp_route6.ro_rt, NULL, 0, \
+ tp->t_inpcb->inp_rtableid); \
} \
} while (0)
#else
-/* $OpenBSD: icmp6.c,v 1.137 2013/12/20 02:04:08 krw Exp $ */
+/* $OpenBSD: icmp6.c,v 1.138 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $ */
/*
struct nd_opt_hdr *nd_opt;
char *lladdr;
- rt_nexthop = nd6_lookup(nexthop, 0, ifp);
+ rt_nexthop = nd6_lookup(nexthop, 0, ifp, ifp->if_rdomain);
if (!rt_nexthop)
goto nolladdropt;
len = sizeof(*nd_opt) + ifp->if_addrlen;
-/* $OpenBSD: in6_src.c,v 1.36 2013/11/11 09:15:35 mpi Exp $ */
+/* $OpenBSD: in6_src.c,v 1.37 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $ */
/*
if (opts && opts->ip6po_nexthop) {
sin6_next = satosin6(opts->ip6po_nexthop);
- rt = nd6_lookup(&sin6_next->sin6_addr, 1, NULL);
+ rt = nd6_lookup(&sin6_next->sin6_addr, 1, NULL,
+ rtableid);
if (rt) {
ia6 = in6_ifawithscope(rt->rt_ifp, dst,
rtableid);
-/* $OpenBSD: nd6.c,v 1.105 2013/11/11 09:15:35 mpi Exp $ */
+/* $OpenBSD: nd6.c,v 1.106 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: nd6.c,v 1.280 2002/06/08 19:52:07 itojun Exp $ */
/*
}
struct rtentry *
-nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp)
+nd6_lookup(struct in6_addr *addr6, int create, struct ifnet *ifp,
+ u_int rtableid)
{
struct rtentry *rt;
struct sockaddr_in6 sin6;
sin6.sin6_family = AF_INET6;
sin6.sin6_addr = *addr6;
- rt = rtalloc1(sin6tosa(&sin6), create, ifp->if_rdomain);
+ rt = rtalloc1(sin6tosa(&sin6), create, rtableid);
if (rt && (rt->rt_flags & RTF_LLINFO) == 0) {
/*
* This is the case for the default route.
info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr;
info.rti_info[RTAX_NETMASK] = sin6tosa(&all1_sa);
if ((e = rtrequest1(RTM_ADD, &info, RTP_CONNECTED,
- &rt, ifp->if_rdomain)) != 0) {
+ &rt, rtableid)) != 0) {
#if 0
char ip[INET6_ADDRSTRLEN];
log(LOG_ERR,
* Even if the address matches none of our addresses, it might be
* in the neighbor cache.
*/
- if ((rt = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL)
+ if ((rt = nd6_lookup(&addr->sin6_addr, 0, ifp,
+ ifp->if_rdomain)) != NULL)
return (1);
return (0);
* XXX cost-effective methods?
*/
void
-nd6_nud_hint(struct rtentry *rt, struct in6_addr *dst6, int force)
+nd6_nud_hint(struct rtentry *rt, struct in6_addr *dst6, int force,
+ u_int rtableid)
{
struct llinfo_nd6 *ln;
if (!rt) {
if (!dst6)
return;
- if (!(rt = nd6_lookup(dst6, 0, NULL)))
+ if (!(rt = nd6_lookup(dst6, 0, NULL, rtableid)))
return;
}
}
s = splsoftnet();
- if ((rt = nd6_lookup(&nb_addr, 0, ifp)) == NULL ||
+ if ((rt = nd6_lookup(&nb_addr, 0, ifp, ifp->if_rdomain)) == NULL ||
(ln = (struct llinfo_nd6 *)rt->rt_llinfo) == NULL) {
error = EINVAL;
splx(s);
* description on it in NS section (RFC 2461 7.2.3).
*/
- rt = nd6_lookup(from, 0, ifp);
+ rt = nd6_lookup(from, 0, ifp, ifp->if_rdomain);
if (!rt) {
#if 0
/* nothing must be done if there's no lladdr */
return NULL;
#endif
- rt = nd6_lookup(from, RT_REPORT, ifp);
+ rt = nd6_lookup(from, RT_REPORT, ifp, ifp->if_rdomain);
is_newentry = 1;
} else {
/* do nothing if static ndp is set */
* it is tolerable, because this should be a rare case.
*/
if (nd6_is_addr_neighbor(dst, ifp) &&
- (rt = nd6_lookup(&dst->sin6_addr, RT_REPORT, ifp)) != NULL)
+ (rt = nd6_lookup(&dst->sin6_addr, RT_REPORT, ifp,
+ ifp->if_rdomain)) != NULL)
ln = (struct llinfo_nd6 *)rt->rt_llinfo;
}
if (!ln || !rt) {
-/* $OpenBSD: nd6.h,v 1.35 2013/10/25 02:54:42 deraadt Exp $ */
+/* $OpenBSD: nd6.h,v 1.36 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */
/*
void nd6_option_init(void *, int, union nd_opts *);
struct nd_opt_hdr *nd6_option(union nd_opts *);
int nd6_options(union nd_opts *);
-struct rtentry *nd6_lookup(struct in6_addr *, int, struct ifnet *);
+struct rtentry *nd6_lookup(struct in6_addr *, int, struct ifnet *, u_int);
void nd6_setmtu(struct ifnet *);
void nd6_llinfo_settimer(struct llinfo_nd6 *, long);
void nd6_timer(void *);
void nd6_purge(struct ifnet *);
-void nd6_nud_hint(struct rtentry *, struct in6_addr *, int);
+void nd6_nud_hint(struct rtentry *, struct in6_addr *, int, u_int);
int nd6_resolve(struct ifnet *, struct rtentry *,
struct mbuf *, struct sockaddr *, u_char *);
void nd6_rtrequest(int, struct rtentry *);
-/* $OpenBSD: nd6_nbr.c,v 1.72 2013/11/19 09:00:43 mpi Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.73 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
* If no neighbor cache entry is found, NA SHOULD silently be
* discarded.
*/
- rt = nd6_lookup(&taddr6, 0, ifp);
+ rt = nd6_lookup(&taddr6, 0, ifp, ifp->if_rdomain);
if ((rt == NULL) ||
((ln = (struct llinfo_nd6 *)rt->rt_llinfo) == NULL) ||
((sdl = SDL(rt->rt_gateway)) == NULL))
-/* $OpenBSD: nd6_rtr.c,v 1.74 2013/11/11 09:15:35 mpi Exp $ */
+/* $OpenBSD: nd6_rtr.c,v 1.75 2014/01/07 17:07:46 mikeb Exp $ */
/* $KAME: nd6_rtr.c,v 1.97 2001/02/07 11:09:13 itojun Exp $ */
/*
*/
TAILQ_FOREACH(dr, &nd_defrouter, dr_entry) {
if (!selected_dr &&
- (rt = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) &&
+ (rt = nd6_lookup(&dr->rtaddr, 0, dr->ifp,
+ dr->ifp->if_rdomain)) &&
(ln = (struct llinfo_nd6 *)rt->rt_llinfo) &&
ND6_IS_LLINFO_PROBREACH(ln)) {
selected_dr = dr;
else
selected_dr = TAILQ_NEXT(installed_dr, dr_entry);
} else if (installed_dr &&
- (rt = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) &&
+ (rt = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp,
+ installed_dr->ifp->if_rdomain)) &&
(ln = (struct llinfo_nd6 *)rt->rt_llinfo) &&
ND6_IS_LLINFO_PROBREACH(ln) &&
rtpref(selected_dr) <= rtpref(installed_dr)) {
LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) {
if ((rt = nd6_lookup(&pfxrtr->router->rtaddr, 0,
- pfxrtr->router->ifp)) &&
+ pfxrtr->router->ifp, pfxrtr->router->ifp->if_rdomain)) &&
(ln = (struct llinfo_nd6 *)rt->rt_llinfo) &&
ND6_IS_LLINFO_PROBREACH(ln))
break; /* found */