Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2306852pxa; Mon, 24 Aug 2020 10:27:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpeWZTwhWXENLkDBxKvUtF+l9aZp4o5MRFEtGQEkqZb0H7/2VQFdowubbXqFBU6FXviHY+ X-Received: by 2002:a17:906:e251:: with SMTP id gq17mr6350800ejb.445.1598290026644; Mon, 24 Aug 2020 10:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598290026; cv=none; d=google.com; s=arc-20160816; b=sc0iyeO1v25Kl5waTgpTBfYEVxkS1QxpzV5dARBOh6QfhmUxd429UcAVGrPG3654IJ 5xDX7yB+03Zop7ucrnAIqjGUVM4FrbyETOJM3KNL5afRm+7dx6cEeoxm0u/N1oINKFAx U47hvdMGIu9QLysm/U0s48/vAEJ7GFuzcfya4c7CqXKD/XNeoUFfCRL1vE5qvPaJxGEf Xkev+LudO3kllz/AwuvmluqjqCeOsB6hjVSnhdp1zndekzpPTAU6sbC9UushyqiiEMhK bLCgPbXb5fWBJsKn3f8+kPGF99P9dIHg8jbuEeYaqLmgKVf0MXrmtbvYoK+9q9f2rHCu H2bA== 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=1v6w7Ao5dG/OqCjV3CHX7fGGVTHdSr3igFN8BsboflQ=; b=isbg29dz3eReYTe53QeG5hciNLBr9AOhk8XF5+N4JwFz6RnwtuUzdwv+2bhift9I6C cVrdCaJohl4NGttQRZBnmqsiVjp2EOOScQ2m+mkE17dBokc+5yxWPaVEoUrD9fWLevlj 7V5mYq6q7LtVrMmjAHOX3VeupXFBBUnYm097lw5QX3FdsjkfD2Tyjwu7fGlg5W6+JPJ3 Pr/NUtlmzs7eO+1EvYiPCmhbf5rQ9VmB/BQPlYveLI2I38udqodYbth+zh8rCurqPM5a olhuczM5e4jxCmKWkPhcwRYucPN8R0uj4zUZhix4hDNLHY+Ul2Ia3FpdSEV40uuBcQWt J6JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si7151466ejg.29.2020.08.24.10.26.43; Mon, 24 Aug 2020 10:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727883AbgHXR0I (ORCPT + 99 others); Mon, 24 Aug 2020 13:26:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728203AbgHXRZv (ORCPT ); Mon, 24 Aug 2020 13:25:51 -0400 Received: from shards.monkeyblade.net (shards.monkeyblade.net [IPv6:2620:137:e000::1:9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB95CC061573; Mon, 24 Aug 2020 10:25:48 -0700 (PDT) Received: from localhost (unknown [IPv6:2601:601:9f00:477::3d5]) (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 14DB3128885BD; Mon, 24 Aug 2020 10:09:02 -0700 (PDT) Date: Mon, 24 Aug 2020 10:25:45 -0700 (PDT) Message-Id: <20200824.102545.1450838041398463071.davem@davemloft.net> To: aranea@aixah.de Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] veth: Initialize dev->perm_addr From: David Miller In-Reply-To: <20200824143828.5964-1-aranea@aixah.de> References: <20200824143828.5964-1-aranea@aixah.de> X-Mailer: Mew version 6.8 on Emacs 26.3 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]); Mon, 24 Aug 2020 10:09:02 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mira Ressel Date: Mon, 24 Aug 2020 14:38:26 +0000 > Set the perm_addr of veth devices to whatever MAC has been assigned to > the device. Otherwise, it remains all zero, with the consequence that > ipv6_generate_stable_address() (which is used if the sysctl > net.ipv6.conf.DEV.addr_gen_mode is set to 2 or 3) assigns every veth > interface on a host the same link-local address. > > The new behaviour matches that of several other virtual interface types > (such as gre), and as far as I can tell, perm_addr isn't used by any > other code sites that are relevant to veth. > > Signed-off-by: Mira Ressel ... > @@ -1342,6 +1342,8 @@ static int veth_newlink(struct net *src_net, struct net_device *dev, > if (!ifmp || !tbp[IFLA_ADDRESS]) > eth_hw_addr_random(peer); > > + memcpy(peer->perm_addr, peer->dev_addr, peer->addr_len); Semantically don't you want to copy over the peer->perm_addr? Otherwise this loses the entire point of the permanent address, and what the ipv6 address generation facility expects.