ip6_output.c (7159039a128fa0a73ca7b532f6e1d30d9885277f) | ip6_output.c (95c385b4d5a71b8ad552aecaa968ea46d7da2f6a) |
---|---|
1/* 2 * IPv6 output functions 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * $Id: ip6_output.c,v 1.34 2002/02/01 22:01:04 davem Exp $ --- 849 unchanged lines hidden (view full) --- 858 goto out_err_release; 859 860 if (ipv6_addr_any(&fl->fl6_src)) { 861 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); 862 if (err) 863 goto out_err_release; 864 } 865 | 1/* 2 * IPv6 output functions 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * $Id: ip6_output.c,v 1.34 2002/02/01 22:01:04 davem Exp $ --- 849 unchanged lines hidden (view full) --- 858 goto out_err_release; 859 860 if (ipv6_addr_any(&fl->fl6_src)) { 861 err = ipv6_get_saddr(*dst, &fl->fl6_dst, &fl->fl6_src); 862 if (err) 863 goto out_err_release; 864 } 865 |
866#ifdef CONFIG_IPV6_OPTIMISTIC_DAD 867 /* 868 * Here if the dst entry we've looked up 869 * has a neighbour entry that is in the INCOMPLETE 870 * state and the src address from the flow is 871 * marked as OPTIMISTIC, we release the found 872 * dst entry and replace it instead with the 873 * dst entry of the nexthop router 874 */ 875 if (!((*dst)->neighbour->nud_state & NUD_VALID)) { 876 struct inet6_ifaddr *ifp; 877 struct flowi fl_gw; 878 int redirect; 879 880 ifp = ipv6_get_ifaddr(&fl->fl6_src, (*dst)->dev, 1); 881 882 redirect = (ifp && ifp->flags & IFA_F_OPTIMISTIC); 883 if (ifp) 884 in6_ifa_put(ifp); 885 886 if (redirect) { 887 /* 888 * We need to get the dst entry for the 889 * default router instead 890 */ 891 dst_release(*dst); 892 memcpy(&fl_gw, fl, sizeof(struct flowi)); 893 memset(&fl_gw.fl6_dst, 0, sizeof(struct in6_addr)); 894 *dst = ip6_route_output(sk, &fl_gw); 895 if ((err = (*dst)->error)) 896 goto out_err_release; 897 } 898 } 899#endif 900 |
|
866 return 0; 867 868out_err_release: 869 dst_release(*dst); 870 *dst = NULL; 871 return err; 872} 873 --- 504 unchanged lines hidden --- | 901 return 0; 902 903out_err_release: 904 dst_release(*dst); 905 *dst = NULL; 906 return err; 907} 908 --- 504 unchanged lines hidden --- |