Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp189753pxv; Thu, 24 Jun 2021 05:59:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzQoz0sP01rnCG6SPrGZ3ffjcnDWM7VXP7vNaw1txkw0eL56YosdkDSNwXQ48BVMcCKqAJ X-Received: by 2002:a17:906:7184:: with SMTP id h4mr5239747ejk.140.1624539545505; Thu, 24 Jun 2021 05:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624539545; cv=none; d=google.com; s=arc-20160816; b=aoKb9xxSgC8vPU6uFhsEpZUv0E2h6Cw8dUg6QHss9gG+DQrT9vemOY+08xl7VB7jA4 u4hTKRVp+seUe5/R5D24WK2sYOBZAZ/bZ+udHy+Q0us7mkpd5qTh0i7x8STtWKUZNsRa wXlxlfPV25F7QZI6Qv1s/eKVZYXRhucgcOUJdSeH//qcyrmPl2PgpTijD9t7tSAmrdbH gbg9SQy+zug8mQ/xC3iI8WGBIQ8i6tugT02UMrcD4TPMCWDvth2PLdfYnhC2S1scy+r7 vqDvMKtX7+3SlBmspM1tpTdCVzlUzVofGmrpirWDmQW/o2F1EPxu7gtcYZk+KVKIrwy7 Z48A== 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=MCa72yMdHXGjGihv0hcDwVjOwX3qoCsp/TCZUGiyEnk=; b=gXgr58zoLp7IaN8PjKuZelV39C1JDPKhExl0Ih5xvuv5duzaIVJRi8pdET94VOlPWk LDS2PpFhefEQi+BLMQLqj5rzmoWuRnQug+zbxAzUnr9oLgtlkdXOTxRSbGPClTG1L81s WGpo8xRF6JC3FpCCBdhiUsySk7FR3VKBOt/8UxsG4rKmljGME8ndhJMT/XCKJpalv3XR TM/K0WpEZRrsWd2F1L1INcfCXsNqN16pcuPTey6zjJ6mrH7JF0igUCDWu5YAMadBO+bv A63NHnUI7IBfeOp9WE7R3KTVTuzP7MjIwTMIlZnX5pApik4RKMKwo/nqirkFKDeAElsC VxFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@6wind.com header.s=google header.b=TIExZny+; 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 n4si2718343edv.536.2021.06.24.05.58.42; Thu, 24 Jun 2021 05:59:05 -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=TIExZny+; 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 S231809AbhFXNAG (ORCPT + 99 others); Thu, 24 Jun 2021 09:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbhFXNAF (ORCPT ); Thu, 24 Jun 2021 09:00:05 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0578AC061574 for ; Thu, 24 Jun 2021 05:57:44 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id w13so3906413wmc.3 for ; Thu, 24 Jun 2021 05:57:44 -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=MCa72yMdHXGjGihv0hcDwVjOwX3qoCsp/TCZUGiyEnk=; b=TIExZny+xagkJdssKAd3jS8wGhSkUlYDI5hsq2ZM+iJi2C/QQEP8SJyuCI1hur7nTJ 4Ls14QrMhP5QWHAn9pwfhrdRP+UNTrIoccNS0xnrmWe6e37QoavbDf9Y72E/0jWpXt7g 5NsS2hgZ8o+pel7fYqYU2NIMW8DB99s717K+YUyuDLiqhSBklQMm7POxsJnRxy4ioKmd gz9UdhbKhJWVsGmnf8DHoC+A93Yz7kD9IOibXAywOOSCmHsuxUBD77Uq+SvlgsKylv12 97Vh3XoApp1YQrL/+etXNsaZizYmq4GH3b5OrILojDmXhEtBssflY9Grt4XMsNKRyqjF DNng== 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=MCa72yMdHXGjGihv0hcDwVjOwX3qoCsp/TCZUGiyEnk=; b=iy94O6kIp5MI2RvfGOYGlUn+tqrHFYmfB79uMV//TW/MzfPrmYyPrL0NE2nUPmRG7E 6yh122hFz7irqsqsfWsz4e3/yPB2anjLnya6QTH/77kgpqrmuQqE0LkAmA6GY8BCMP0T bGI4WaRF9h1yOAVetF5d+OjWTJ5rUlT81k05eY+kRvRJF4RCQCHNxOMtSkpO1ZXEqx5X k7uKFARoVWXC3FmhE+SoGadFV3tSFTgB5mh+WIgMlrg0p1EZotRS0t7aRMNyqeNXcJLV /tMfSKTzHPQdr4Z7oLdrSnN3281WjZ0JxFLqdjR8pZXxvGiPwvYeuwroMo8C1uUsN2Xd 9kRw== X-Gm-Message-State: AOAM532rKyRPzw3k2FD5i559aGiypAlXLsZpgquGKT4PNsyfYL+MC65r BVjSy7e3Jn+uBIWtIT10EMJvF2jJ+HzrWw== X-Received: by 2002:a05:600c:2907:: with SMTP id i7mr4149323wmd.139.1624539463471; Thu, 24 Jun 2021 05:57:43 -0700 (PDT) Received: from ?IPv6:2a01:e0a:410:bb00:108a:5c8a:bec4:9763? ([2a01:e0a:410:bb00:108a:5c8a:bec4:9763]) by smtp.gmail.com with ESMTPSA id m67sm9115639wmm.17.2021.06.24.05.57.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 05:57:42 -0700 (PDT) Reply-To: nicolas.dichtel@6wind.com Subject: Re: Issues during assigning addresses on point to point interfaces To: =?UTF-8?Q?Marek_Beh=c3=ban?= , =?UTF-8?Q?Pali_Roh=c3=a1r?= Cc: 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> From: Nicolas Dichtel Organization: 6WIND Message-ID: Date: Thu, 24 Jun 2021 14:57:41 +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: <20210624124545.2b170258@dellmb> 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 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. Regards, Nicolas