Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1227822pxv; Fri, 25 Jun 2021 08:09:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7fR6QtSQNaJ/YQP75k4C89196QZIkOgtFarhk6EvbxUspjJ6GtaFZ8XEabvKSp0tNCbmK X-Received: by 2002:a05:6402:198:: with SMTP id r24mr15493622edv.93.1624633795531; Fri, 25 Jun 2021 08:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624633795; cv=none; d=google.com; s=arc-20160816; b=auAyilRIQy1DBsJglIuUE4jELODfe8Titu5Qn0GFWg5d52TraSmvetg5naGCPpgOEQ YxpOJVm5HkxlR64xytLM7p75/OsagK5K9xuvvmZz42ES1Z3Bs3pEApL3Ii3gLwe4cmAd o5VIzCAnhB65YlohWCK6mArFZQN1asTcjN8MiRNS/DizqbVa2yuPbBAZzM8xS0EAOklZ up/prtcdWl5NpYdz24MACGrTpyb0Q94BYut6cVeF660ZwAY7r4Up+11ORRzRR55eorAm sJT0VTaV1AnvaASi/5bAU71+tyjP3oVCaJmLMbYPbLvBkgI722d12Qxby6rQBiUyNNob bVDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:reply-to:dkim-signature; bh=AFFwYFTP3Uiktk5LoVFc2lRWhraIysj4KMrrrDOrInc=; b=HQg2C4ks7DKD6qW5M2TxAghzaeMBxzSKLe7icW3pRY0rKH96Wm1jZ5I4OPO9q24Oaa +hqhbEkF2YGiZCU8ajMArJWbabXOk5EKws/Cs5h5e/crXsw8Eu4Ne6VY8aNZOdXxpTMO IP5URKAVZIcha+R3qM9XkviF6FWg38JuZFCoomfGsOpTXhe3glo6V6xbiiNC2uA+rlVd /5pVtODkL9ge66yANWs7UdzBRRmHq42RfOGhvo6GgJaW1R34oepwJTsXzydYOFNDVT+c ekwgp+QMRTiNPY8190B+rnCnt9DYCAOaLvoPc5bPrKp76j+JEi1rHdlKBxS28URm9N99 wdhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind.com header.s=google header.b=P1s3LcZ3; 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=6wind.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si6615673ejn.683.2021.06.25.08.09.31; Fri, 25 Jun 2021 08:09:55 -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=@6wind.com header.s=google header.b=P1s3LcZ3; 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=6wind.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231857AbhFYPIq (ORCPT + 99 others); Fri, 25 Jun 2021 11:08:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbhFYPIp (ORCPT ); Fri, 25 Jun 2021 11:08:45 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0592AC061766 for ; Fri, 25 Jun 2021 08:06:24 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id k30-20020a05600c1c9eb02901d4d33c5ca0so627230wms.3 for ; Fri, 25 Jun 2021 08:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AFFwYFTP3Uiktk5LoVFc2lRWhraIysj4KMrrrDOrInc=; b=P1s3LcZ35xxohi3PKxblm3ZXKDXGGzDkcnlPU5geHtyQ4hXcPoOeiYDJZMJgTteGob mVAGgmCZP6Wb8GEe8O/G7+XQf1cbopGoMqS/27hrsWVxzdfVLNBc0mxDIp7JXQZTpDNF T7pPuiZ2NI2ghkry1y3AsLmeAwLBRsXMxOHn3uJawHZebQkdrTJfwmE/S9rDN8cLnuIx sy5slRGXoyfa4dmI+TNj+qzPUNvKl1hhDzZZYi1qGbjuMJ1hBd2mzRynEOrKwg9RrG7N atTcCICJY7+sThyXF3Vn+gFZMieJjXIUHUs7LBI5m87cmmRHYq4emCcx4Chgwm2lrpNO sgUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=AFFwYFTP3Uiktk5LoVFc2lRWhraIysj4KMrrrDOrInc=; b=LTH6URZZpH8gkbRwV0djM5ev35DG+b/pHv3H02vnT3F9/wbVkUNcmFPjnd7vs9jjt3 3j/TWvoby/O10W/tebr2TPKrGxPnUO261PkIyWi9XF0uFuzhEgCW/rRG1q4SGldmKbHl 6W+p2ff1GxjI+H+/v9iT4llNJAuf8Tfb+YA/RQmb81XDfa25iEqwOEXurPA6xsMGqJ/x hdZbU1yzA4W1EBhjqhZtkHKz5ZZK1er5eNX9WZRSCt3gUnT1y2qwJytVv9o16BH+lfgQ GXFyHpMtp2NwvybGDfdJYqqQiO+vm6+Zx/kRjh53fWPyroWaBHQNCUI5xdXTeZwHsQhC Hwqw== X-Gm-Message-State: AOAM533lTYNL3BtFkL9L12S1lqb6nwQwxaP30Ou1EBOBg/LKiX4NZbDh QO1Nds5QCZeYd2Y4OWCAt8HvMQ== X-Received: by 2002:a7b:cc99:: with SMTP id p25mr11192117wma.19.1624633582544; Fri, 25 Jun 2021 08:06:22 -0700 (PDT) Received: from ?IPv6:2a01:e0a:410:bb00:78f3:e334:978:3783? ([2a01:e0a:410:bb00:78f3:e334:978:3783]) by smtp.gmail.com with ESMTPSA id o2sm6326711wrp.53.2021.06.25.08.06.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jun 2021 08:06:22 -0700 (PDT) Reply-To: nicolas.dichtel@6wind.com Subject: Re: Issues during assigning addresses on point to point interfaces To: =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: =?UTF-8?Q?Marek_Beh=c3=ban?= , 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 References: <20210606151008.7dwx5ukrlvxt4t3k@pali> <20210624124545.2b170258@dellmb> <20210625084031.c33yovvximtabmf4@pali> From: Nicolas Dichtel Organization: 6WIND Message-ID: Date: Fri, 25 Jun 2021 17:06:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210625084031.c33yovvximtabmf4@pali> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 25/06/2021 à 10:40, Pali Rohár a écrit : > 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? What about forcing IFA_LOCAL address to :: in your case?