In article <[EMAIL PROTECTED]> (at Wed, 7 Feb 2007 15:55:03 -0500), Neil Horman <[EMAIL PROTECTED]> says:
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c > index 7b7bd44..8a1ea96 100644 > --- a/net/ipv6/ip6_output.c > +++ b/net/ipv6/ip6_output.c > @@ -859,6 +859,34 @@ static int ip6_dst_lookup_tail(struct sock *sk, > err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); > if (err) > goto out_err_release; > +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD > + /* > + * Here if the dst entry we've looked up > + * has a neighbour entry that is in the INCOMPLETE > + * state and the src address from the flow is > + * marked as OPTIMISTIC, we release the found > + * dst entry and replace it instead with the > + * dst entry of the nexthop router > + */ > + if (!((*dst)->neighbour->nud_state & NUD_VALID)) { > + struct inet6_ifaddr *ifp; > + struct flowi fl_gw; > + ifp = ipv6_get_ifaddr(&fl->fl6_src, (*dst)->dev, 1); > + > + if (ifp && ifp->flags & IFA_F_OPTIMISTIC) { > + /* > + * We need to get the dst entry for the > + * default router instead > + */ > + dst_release(*dst); > + memcpy(&fl_gw, fl, sizeof(struct flowi)); > + memset(&fl_gw.fl6_dst, 0, sizeof(struct > in6_addr)); > + *dst = ip6_route_output(sk, &fl_gw); > + if ((err = (*dst)->error)) > + goto out_err_release; > > + } > + } > +#endif > } > > return 0; Sorry, this is still not correct if the source address is already specified. I think they should be placed just betwee laste "}" and "return 0;", no? I still have a question. Now, who will install the kernel route for the incoming packet? Can we get packet for our unicast address during optimistic DAD period? --yoshfuji - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html