From patchwork Sat Oct 3 14:10:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adel Belhouane X-Patchwork-Id: 267639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6810C41604 for ; Sat, 3 Oct 2020 14:10:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6BE59206F8 for ; Sat, 3 Oct 2020 14:10:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725816AbgJCOKl (ORCPT ); Sat, 3 Oct 2020 10:10:41 -0400 Received: from smtp6-g21.free.fr ([212.27.42.6]:5462 "EHLO smtp6-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725781AbgJCOKl (ORCPT ); Sat, 3 Oct 2020 10:10:41 -0400 Received: from [IPv6:2a01:e34:ec0c:ae81:8d77:4856:46b:2117] (unknown [IPv6:2a01:e34:ec0c:ae80:8d77:4856:46b:2117]) by smtp6-g21.free.fr (Postfix) with ESMTPS id 29C3A780336; Sat, 3 Oct 2020 14:10:06 +0000 (UTC) Subject: [PATCH] iproute2: ip addr: Fix noprefixroute and autojoin for IPv4 From: Adel Belhouane To: netdev@vger.kernel.org Cc: Adel Belhouane Message-ID: <1869e1c3-cf1e-a851-77ac-5482c694f5b3@free.fr> Date: Sat, 3 Oct 2020 16:10:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 Content-Language: fr Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org These were reported as IPv6-only and ignored: # ip address add 192.0.2.2/24 dev dummy5 noprefixroute Warning: noprefixroute option can be set only for IPv6 addresses # ip address add 224.1.1.10/24 dev dummy5 autojoin Warning: autojoin option can be set only for IPv6 addresses This enables them back for IPv4. Fixes: 9d59c86e575b5 ("iproute2: ip addr: Organize flag properties structurally") Signed-off-by: Adel Belhouane --- ip/ipaddress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ip/ipaddress.c b/ip/ipaddress.c index ccf67d1dd55c..2b4cb48a485e 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -1249,8 +1249,8 @@ static const struct ifa_flag_data_t { { .name = "tentative", .mask = IFA_F_TENTATIVE, .readonly = true, .v6only = true}, { .name = "permanent", .mask = IFA_F_PERMANENT, .readonly = true, .v6only = true}, { .name = "mngtmpaddr", .mask = IFA_F_MANAGETEMPADDR, .readonly = false, .v6only = true}, - { .name = "noprefixroute", .mask = IFA_F_NOPREFIXROUTE, .readonly = false, .v6only = true}, - { .name = "autojoin", .mask = IFA_F_MCAUTOJOIN, .readonly = false, .v6only = true}, + { .name = "noprefixroute", .mask = IFA_F_NOPREFIXROUTE, .readonly = false, .v6only = false}, + { .name = "autojoin", .mask = IFA_F_MCAUTOJOIN, .readonly = false, .v6only = false}, { .name = "stable-privacy", .mask = IFA_F_STABLE_PRIVACY, .readonly = true, .v6only = true}, };