Received: by 10.192.165.156 with SMTP id m28csp1143465imm; Wed, 11 Apr 2018 13:14:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx48U6ckQF10G9I8zYTITQrcdduiBTyc3iYq0hBGY+f5LDVI6qEcEsDQzlFzQRjdpiHMGgbIs X-Received: by 10.99.64.131 with SMTP id n125mr4439483pga.303.1523477688793; Wed, 11 Apr 2018 13:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523477688; cv=none; d=google.com; s=arc-20160816; b=h/s3WlhLTffUQpPmrlhcgGi3tCXVuXhVo6RHkgfjiXeQWiOQI892LXEfLX7htAgeMg 4HBEPrOlhsLAYE8a2dNiWiDzICzjlA1I0QspGwSsVGCDLj3QCXA7Y3Pw8ryXNzkI+OFo 0CTNf8ZFh5u2mOqSV9Wc596Rdw3ut+Gb0OXY07LQp7dMnzaccwIIZbPO/IitnHpsueQr URzZFUOpxzc8xD8sQHIpbKJegn3ER/6+YWraAMJ+j1AHyxlCaWtL3rmU+WuqBC3KiHAi dFkal6iErzq2wNL0lKt9Z2ciBvg/23lqoyEjvbxOeEii4HnVHDMjMMqTEKqnfPczP7t4 hTUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vHsXb2E8838s0dOSv0qzdQGPZ3NZxfVph3VxqMrc3SM=; b=StO25IhkYGCd38du7oZKghPxq3FC61psTZCJejvOPJsAYFlsHhP4oETnJtrvkJ1u1W 4GSWK0uix6v33tSba0jAFp2qCHOYkf++9kWpB2vCGU6DFEixpTxZcmFDfYeqcehgjoML 7i9/AvnMIRK+Jgx1dAAVyTEjy7azEmiLMU4pYL4lO6YzAT9r9/7w3c6pYVmjRxIW4loN IY5B4dK3DWjoCfMmPuhkf44CIY5k9JAxcxfvgGRGB7GOY456Zeqdz3A3OYv2GHgoY4KG rx80tJFmeKJCRrcwktpfOyTHgveLfo+vR+v/24bBkVFSAEnVZvo+ngAzvk13VU1qhlZr acTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si1591552plp.682.2018.04.11.13.14.12; Wed, 11 Apr 2018 13:14:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933601AbeDKSyy (ORCPT + 99 others); Wed, 11 Apr 2018 14:54:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34708 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933556AbeDKSyt (ORCPT ); Wed, 11 Apr 2018 14:54:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 21DB2C03; Wed, 11 Apr 2018 18:54:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mahesh Bandewar , David Ahern , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 053/310] ipv6: avoid dad-failures for addresses with NODAD Date: Wed, 11 Apr 2018 20:33:12 +0200 Message-Id: <20180411183624.528582653@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mahesh Bandewar [ Upstream commit 66eb9f86e50547ec2a8ff7a75997066a74ef584b ] Every address gets added with TENTATIVE flag even for the addresses with IFA_F_NODAD flag and dad-work is scheduled for them. During this DAD process we realize it's an address with NODAD and complete the process without sending any probe. However the TENTATIVE flags stays on the address for sometime enough to cause misinterpretation when we receive a NS. While processing NS, if the address has TENTATIVE flag, we mark it DADFAILED and endup with an address that was originally configured as NODAD with DADFAILED. We can't avoid scheduling dad_work for addresses with NODAD but we can avoid adding TENTATIVE flag to avoid this racy situation. Signed-off-by: Mahesh Bandewar Acked-by: David Ahern Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- net/ipv6/addrconf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -988,7 +988,10 @@ ipv6_add_addr(struct inet6_dev *idev, co INIT_HLIST_NODE(&ifa->addr_lst); ifa->scope = scope; ifa->prefix_len = pfxlen; - ifa->flags = flags | IFA_F_TENTATIVE; + ifa->flags = flags; + /* No need to add the TENTATIVE flag for addresses with NODAD */ + if (!(flags & IFA_F_NODAD)) + ifa->flags |= IFA_F_TENTATIVE; ifa->valid_lft = valid_lft; ifa->prefered_lft = prefered_lft; ifa->cstamp = ifa->tstamp = jiffies;