+ /*
+ * In the prefix proxying case, the route to the proxied node normally
+ * gets created by nd6_prproxy_ns_output(), as part of forwarding a
+ * NS (NUD/AR) packet to the proxied node. In the event that such
+ * packet did not arrive in time before the correct route gets created,
+ * ip6_input() would have performed a rtalloc() which most likely will
+ * create the wrong cloned route; this route points back to the same
+ * interface as the inbound interface, since the parent non-scoped
+ * prefix route points there. Therefore we check if that is the case
+ * and perform the necessary fixup to get the correct route installed.
+ */
+ if (!srcrt && nd6_prproxy &&
+ (rt = ip6forward_rt->ro_rt) != NULL && (rt->rt_flags & RTF_PROXY)) {
+ nd6_proxy_find_fwdroute(m->m_pkthdr.rcvif, ip6forward_rt);
+ if ((rt = ip6forward_rt->ro_rt) != NULL)
+ ifscope = rt->rt_ifp->if_index;
+ }
+