From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gao feng Subject: Re: [PATCH v5] ipv6: Fix problem with expired dst cache Date: Mon, 19 Mar 2012 08:49:51 +0800 Message-ID: <4F6682AF.6020307@cn.fujitsu.com> References: <1330064404-24763-1-git-send-email-gaofeng@cn.fujitsu.com> <1330931762-1466-1-git-send-email-gaofeng@cn.fujitsu.com> <20120316.223353.988595838790067214.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com To: David Miller Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:40651 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1757174Ab2CSAt3 convert rfc822-to-8bit (ORCPT ); Sun, 18 Mar 2012 20:49:29 -0400 In-Reply-To: <20120316.223353.988595838790067214.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org List-ID: =E4=BA=8E 2012=E5=B9=B403=E6=9C=8817=E6=97=A5 13:33, David Miller =E5=86= =99=E9=81=93: > From: Gao feng > Date: Mon, 5 Mar 2012 15:16:02 +0800 >=20 >> 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 f= lag. >> 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 an= d 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_ADDR= CONF >> and RTF_DEFAULT.then hold the ort. >> >> In func ip6_dst_destroy release the ort. >> >> Add some functions to operate the RTF_EXPIRES flag and expires(from)= together. >> and change the code to use these new adding functions. >> >> Signed-off-by: Gao feng >=20 > I see some unprotected access to dst.expires in the router discovery > code in net/ipv6/ndisc.c, doesn't that need to be updated? >=20 > There are probably some more similar cases elsewhere in the ipv6 code > too. >=20 Hi David I only search the RTF_EXPIRES flag and forget the expires.I will do thi= s. BUT what confuse me is that, in func ip6_rt_copy should we do rt6_set_f= rom in any case or only when the ort has flag RTF_ADDRCONF and RTF_DEFAULT? thanks.