Hi David.
于 2012年02月27日 14:36, Gao feng 写道:
If the ipv6 dst cache which copy from the dst generated by ICMPV6 RA packet.
this dst cache will not check expire because it has no RTF_EXPIRES flag.
So this dst cache will always be used until the dst gc run.
Change the struct dst_entry,add a union contains new pointer from and expires.
When rt6_info.rt6i_flags has no RTF_EXPIRES flag,the dst.expires has no use.
we can use this field to point to where the dst cache copy from.
The dst.from is only used in IPV6.
In func rt6_check_expired check if rt6_info.dst.from is expired.
In func ip6_rt_copy only set dst.from when the ort has flag RTF_ADDRCONF
and RTF_DEFAULT.
I will send the v3 PATCH.
This version has some changes.
1,hold the ort in ip6_rt_copy and release it in ip6_dst_destroy just as Eric said.
2,add some functions to operate the RTF_EXPIRES flag and expires(from).
3,change the code to use the functions added in 2.