From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net] net/ipv6: do not copy DST_NOCOUNT flag on rt init Date: Mon, 17 Sep 2018 09:13:40 -0700 Message-ID: <46b22632-4d71-40a7-d382-a2fff8a86903@gmail.com> References: <20180913203814.189698-1-posk@google.com> <351e6fbc-5356-b5c1-0638-0554843ad833@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: davem@davemloft.net, netdev@vger.kernel.org To: Peter Oskolkov Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:35632 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726795AbeIQVlp (ORCPT ); Mon, 17 Sep 2018 17:41:45 -0400 Received: by mail-pf1-f193.google.com with SMTP id p12-v6so7793002pfh.2 for ; Mon, 17 Sep 2018 09:13:42 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 9/17/18 9:11 AM, Peter Oskolkov wrote: > On Thu, Sep 13, 2018 at 9:11 PM David Ahern wrote: >> >> On 9/13/18 1:38 PM, Peter Oskolkov wrote: >> >>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c >>> index 3eed045c65a5..a3902f805305 100644 >>> --- a/net/ipv6/route.c >>> +++ b/net/ipv6/route.c >>> @@ -946,7 +946,7 @@ static void ip6_rt_init_dst_reject(struct rt6_info *rt, struct fib6_info *ort) >>> >>> static void ip6_rt_init_dst(struct rt6_info *rt, struct fib6_info *ort) >>> { >>> - rt->dst.flags |= fib6_info_dst_flags(ort); >>> + rt->dst.flags |= fib6_info_dst_flags(ort) & ~DST_NOCOUNT; >> >> I think my mistake is setting dst.flags in ip6_rt_init_dst. Flags >> argument is passed to ip6_dst_alloc which is always invoked before >> ip6_rt_copy_init is called which is the only caller of ip6_rt_init_dst. > > ip6_rt_cache_alloc calls ip6_dst_alloc with zero as flags; and only > one flag is copied later (DST_HOST) outside of ip6_rt_init_dst(). > If the flag assignment is completely removed from ip6_rt_init_dst(), > then DST_NOPOLICY flag will be lost. > > Which may be OK, but is more than what this patch tries to solve (do not > copy DST_NOCOUNT flag). After 5+ days mostly offline I just started looking at this problem. Give me some time to chase down a thought I had from my last response.