Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp941510pxv; Fri, 25 Jun 2021 01:42:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQPKP5ALLtUGgIR+epr/Yb1fc62sWwqn+XpRycg76N9T2ZI5d3MLpCIpKKqMdWQ5Mx/hGM X-Received: by 2002:a5d:9445:: with SMTP id x5mr7975388ior.2.1624610558865; Fri, 25 Jun 2021 01:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624610558; cv=none; d=google.com; s=arc-20160816; b=cI+7E+QhlCNIMJXWzeSXVNKPUFKZCeed4t+z2qjqw2W9OC8Rak+X/ChhPCbv+b80Pj w5ASwT02pfCi6E5Wvd/EYU+DRRa2IZysHsIqESOsrX+qt9Mo1gy1qP0TrBILJnQkoQa4 48svKd2uq2DYDd5t2kjkFUet270CE87+KosDHczlRCqMY8rVHc9tAwunJCVi1PIqxDrE 1NsbN1Zk0EeS2GM80uRHYIy5To9y22e/HKxSAkUXrdBLvN+413yPjsh0CvTki9yc5QsF iKZ0+81kXh+oexe/VSNb2eYibNFx7dg/nnZr6BUIL9d3yEaE0gQdJ/zshN4UlQDX6rsD u1gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bwwfzSU/cuQBBeT7onqelFp0hmnRrWCANThWnHWZ7hA=; b=sQU/mSlo564a8G3xt3nV6/2BiPsUTtI34yNX0d5dOol84llRvCJqhevcJ6yecTfnSD MRfL6wnLhft4CkrCcsMdApoLso7Spf7ryOaW05gVItH8tqGx+7Z6PKShXw+u0rt4GYRS 4yVDCYKtzjT0Vmc2/k9tTpRQIrtE7/Frx1UXtz4n355XIN7A8qNo+9CRY6kZEINgS/D8 y65LFLNBxEvQ6/6UXAs7oMvpgBQNJotKuoTM3kMTwvLNdEpOKQUWVDtbiXV7mT7qWUxN dH1wRtsrEP0z+LZgH2fpnEGNRhlmeLfh36PhVqBxd03TOR8wS1Cfx9EygzBitkLdcRdh vYmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QjYPdUy6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si6370647ilg.90.2021.06.25.01.42.27; Fri, 25 Jun 2021 01:42:38 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QjYPdUy6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbhFYIm6 (ORCPT + 99 others); Fri, 25 Jun 2021 04:42:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:53956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbhFYImy (ORCPT ); Fri, 25 Jun 2021 04:42:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 12E656141C; Fri, 25 Jun 2021 08:40:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624610434; bh=n6h3R95LqX+8GLA4EZmuxl5Sr6QOvpWtabNxKYHYWQU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QjYPdUy6RjL8uaS0wlohRpfshi1T8fyA0waHU8ARaRCzf5n+8PTWOg+svHkChWdsR L/GriZrF+J+lr+CVOya7j05PhWuaCe4usXMzV9MUs89DhOT/FNW4cYbQ1sCzfW83yP pC90kjuADyZHCRBtjlYVr0ubGRexDl/tlsb6An3PmS/kYVGdgKCpmO7Mv7VnMcNU0/ DEX4ASGlOfhNMleXwV/381vBGJNR5c+CqWoMrxpqLaMbbl5ZU2f6I4qzNYshc6LQtg bKk1Swzbke/4nOQndh7e+9xIdjp2+G5jzhkU2twT5yvbNd/7Ly0lJTMcz60h1xlows FF6hrLLXTD25g== Received: by pali.im (Postfix) id B749260E; Fri, 25 Jun 2021 10:40:31 +0200 (CEST) Date: Fri, 25 Jun 2021 10:40:31 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Nicolas Dichtel Cc: Marek =?utf-8?B?QmVow7pu?= , netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , linux-kernel@vger.kernel.org, Andrew Lunn , Russell King , Stephen Hemminger , Phil Sutter Subject: Re: Issues during assigning addresses on point to point interfaces Message-ID: <20210625084031.c33yovvximtabmf4@pali> References: <20210606151008.7dwx5ukrlvxt4t3k@pali> <20210624124545.2b170258@dellmb> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 24 June 2021 14:57:41 Nicolas Dichtel wrote: > Le 24/06/2021 à 12:45, Marek Behún a écrit : > > On Sun, 6 Jun 2021 17:10:08 +0200 > > Pali Rohár wrote: > > > >> Hello! > >> > >> Seems that there is a bug during assigning IP addresses on point to > >> point interfaces. > >> > >> Assigning just one local address works fine: > >> > >> ip address add fe80::6 dev ppp1 --> inet6 fe80::6/128 scope link > >> > >> Assigning both local and remote peer address also works fine: > >> > >> ip address add fe80::7 peer fe80::8 dev ppp1 ---> inet6 fe80::7 > >> peer fe80::8/128 scope link > >> > >> But trying to assign just remote peer address does not work. Moreover > >> "ip address" call does not fail, it returns zero but instead of > >> setting remote peer address, it sets local address: > >> > >> ip address add peer fe80::5 dev ppp1 --> inet6 fe80::5/128 scope > >> link > >> > > > > Adding some other people to Cc in order to get their opinions. > > > > It seems this bug is there from the beginning, from commit > > caeaba79009c2 ("ipv6: add support of peer address") > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=caeaba79009c2 > > > > Maybe some older user-space utilities use IFA_ADDRESS instead of > > IFA_LOCAL, and this was done in order to be compatible with them? > If I remember well, there was an issue in the uAPI. > IFA_LOCAL is supposed to be the address of the interface and IFA_ADDRESS is > supposed to be the endpoint of a point-to-point interface. > However, in case of IPv6, it was not the case. In netlink messages generated by > the kernel, IFA_ADDRESS was used instead of IFA_LOCAL. > The patch tried to keep the backward compatibility and the symmetry between msg > from userland and notification from the kernel. Hello Nicolas! See my original email where I put also rtnetlink packets (how strace see them). Seems that there is a bug in handling them (or bug in iproute2) as setting just peer (remote) IPv6 address is ignored: https://lore.kernel.org/netdev/20210606151008.7dwx5ukrlvxt4t3k@pali/ Do you have any idea if this is affected by that "issue in the uAPI"? And what is the way how to fix it?