Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4555678ybl; Tue, 20 Aug 2019 13:59:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjGEIomCnMHX5ChHjalhu7Vb/SUv2NSLDxey+1QroITNOx8DFyLnbIGnJGkMrEL1U4msI1 X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr30760517plt.60.1566334748453; Tue, 20 Aug 2019 13:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566334748; cv=none; d=google.com; s=arc-20160816; b=nRCDJQ83FwTcRBgHpDECwwBDoEaw4YTkO3Fr1+bxy8FSRR27HNmJXVVzDroIQ8ACP7 BaAVVE78NrBp9Q2BK4tQswECMsUDGC2kd2dcmaEV+4fT1dD/9qmzEvml0qS6cD6bPicb jbAQw8OFEfoNyVjRZJky/JTxVzh/X7DvWtNYqE9iJcB6GmrZ42ifucmqVO8J0P9Dwc49 3W4g9J6JF0Zle13Wg9nVqe4UCXHehAQ5BbVrLSPXZmjmX6iYJx1iSNrJjbGmnwqZipLA 9NynEMtkLjMP8XcpsnDu8xrv89N2z1Bevt3f8x4JJccOgZRXYea+MUBPRlwIMtIrQojl eyhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=yxwd8iUKtgswTVL4oI7hYgGP4M0Y2o8fRicdFK+m5Vo=; b=Lsygn/LJXBt+y2pj4FUGK1nvXIH0JP5HBi5RV0hB3pP8+kDIwY9ns0yK9fxMRLdkhD ASNWqTACujWv3TtBa1Kzk3N8xtapcrIohQM5iSjcfqcE/cKwiJorTs3NaBxkrCB6m2fl mYpXgbrqdOigVF4en3HBX+6g6f0z5tvPnhdGRtD2bD7pz3OHisTeUJSSS9J6dbvZpsei gETNlJUK+tq0qf1TAdk3CpSs0s7KC2FZARfmsLt751eVeGjGyC+sEef1GIAaBaZ+NZgY WqSc7cKV0q8wtGIPYVzgN5iB0JwzQ1hhCfylPHeoRzNr5l+0NaADihJAS/2bcvfceQlF kXtw== 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 az3si13040176plb.419.2019.08.20.13.58.52; Tue, 20 Aug 2019 13:59:08 -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 S1730817AbfHTU6E (ORCPT + 99 others); Tue, 20 Aug 2019 16:58:04 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:51012 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729833AbfHTU6E (ORCPT ); Tue, 20 Aug 2019 16:58:04 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C2E66148190A1; Tue, 20 Aug 2019 13:58:03 -0700 (PDT) Date: Tue, 20 Aug 2019 13:58:03 -0700 (PDT) Message-Id: <20190820.135803.846099092737191145.davem@davemloft.net> To: liudongxu3@huawei.com Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: Fix detection for IPv4 duplicate address. From: David Miller In-Reply-To: <20190820151905.13148-1-liudongxu3@huawei.com> References: <20190820151905.13148-1-liudongxu3@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Tue, 20 Aug 2019 13:58:04 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dongxu Liu Date: Tue, 20 Aug 2019 23:19:05 +0800 > @@ -800,8 +800,11 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) > iptunnel_metadata_reply(skb_metadata_dst(skb), > GFP_ATOMIC); > > - /* Special case: IPv4 duplicate address detection packet (RFC2131) */ > - if (sip == 0) { > +/* Special case: IPv4 duplicate address detection packet (RFC2131). > + * Linux usually sends zero to detect duplication, and windows may > + * send a same ip (not zero, sip equal to tip) to do this detection. > + */ > + if (sip == 0 || sip == tip) { Regardless of whether this is a valid change or not, you've unindented the comment which is completely inappropriate.