> + if (new) > + ip6_dst_store(sk, dst, NULL, NULL); > + I read through the code for ip6_dst_store(), the last 2 params are for sk->daddr_cache and sk->saddr_cache. Those are examined and used in ip6_sk_dst_lookup_flow(). If those 2 (mostly only check sk->daddr_cache) are valid, it will try to use sk->sk_dst_cache and avoid ip6_route_output() call. If we put it as NULL, it is guaranteed to not pass the validation check and do ip6_route_output() lookup. So we probably don't want to use NULL but something similar as used in udpv6_sendmsg() like the following? ip6_dst_store(sk, dst, ipv6_addr_equal(&fl6.daddr, &sk->sk_v6_daddr) ? &sk->sk_v6_daddr : NULL, #ifdef CONFIG_IPV6_SUBTREES ipv6_addr_equal(&fl6.saddr, &np->saddr) ? &np->saddr : #endif NULL);
Thanks. Wei