From patchwork Thu Apr 9 06:56:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 221319 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=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 7B2C2C2D0EA for ; Thu, 9 Apr 2020 06:56:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4926A206F7 for ; Thu, 9 Apr 2020 06:56:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="if5DE+qh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726052AbgDIG4d (ORCPT ); Thu, 9 Apr 2020 02:56:33 -0400 Received: from mail-qv1-f67.google.com ([209.85.219.67]:42442 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbgDIG4c (ORCPT ); Thu, 9 Apr 2020 02:56:32 -0400 Received: by mail-qv1-f67.google.com with SMTP id ca9so4993525qvb.9 for ; Wed, 08 Apr 2020 23:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GrAlTd7ha3CV6gCFirjFgEM//iNaaleQDGz96CqZCss=; b=if5DE+qhWDF/+FcO4RP+7ZBup5a3bI2RYi+2Mo4xO68dhDgy8ATe9M3MiN1gnCgAuO tzY+GsVqA9aYg2Cduxa0qMiiRwrQnkCuu7niIST9ywAxHyTJkKJQTTMbsxOJQ+jG7LNr QmFhGYiS/d9EMGr2VlS8pDCkeAeZ9c+6cmlAWPbyCWrxI6EuQRt8VsD+PLFnKESWBBfp iuAcAHvW6Zi94T6lhDcslaQrUWpfv7NCZynix2wKelO6W0UejNm9ZN67f5k0kqZpZ1fq DUWr+T2aP9Ol+46n+wCO5wIMWuSbf73WmvQ+TlmE1yHWoYpbvrd6WREdhOK/F6Z9xVjy dEzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GrAlTd7ha3CV6gCFirjFgEM//iNaaleQDGz96CqZCss=; b=S6/A14OtWzo1GCGSV9RLKbC4HCvUJKipOQAAxxK95N7rcQyuVn12bYV/ujuuon/1Qf F4Gr9FaFXhwtfZcqYZW3WMiQwlAcIPil1Nrs0FmoWWIWBNHpHyIeT7dChqxIF4Y9PoHv lgUinOHDlzQeA0Cjt1bOiW9yljAsUZJhSMEviyN9zAjvTm/1rO/de2SMYxL+KIMYrFEQ L8ZbInu0VtWU/mXL/cSZ2xaKGetevu+fn3mHJuZCZhGrL442547Prz9H/R46HCuzGn6o 5WGhzsB8WHOui/fgv9lE/eMABA6rDIt87lyAM10lg2t/Plfq7s+zSErtBWVJaT+mnvht K9lA== X-Gm-Message-State: AGi0PuaAx6SOnuS4MlaGcHjj/Gx2XAnp+Y8A21+UEsOjjxpJ2ZFOIV8o Tm/v0odNX2hsQVaex2p7EWKFcRjeNjs= X-Google-Smtp-Source: APiQypIljmtfy1cTS2vP4rtwT7x8tsTujNVw3GDevrfa8O4X4hfGoJfilMGTDTX2OvMj0/M7vf2ctQ== X-Received: by 2002:a0c:b503:: with SMTP id d3mr11357852qve.176.1586415390232; Wed, 08 Apr 2020 23:56:30 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id l62sm20789825qte.52.2020.04.08.23.56.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2020 23:56:29 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: "David S . Miller" , Daniel Borkmann , YOSHIFUJI Hideaki , Hangbin Liu Subject: [PATCH net] net/ipv6: allow token to be set when accept_ra disabled Date: Thu, 9 Apr 2020 14:56:04 +0800 Message-Id: <20200409065604.817-1-liuhangbin@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The token setting should not depend on whether accept_ra is enabled or disabled. The user could set the token at any time. Enable or disable accept_ra only affects when the token address take effective. On the other hand, we didn't remove the token setting when disable accept_ra. So let's just remove the accept_ra checking when user want to set token address. Fixes: f53adae4eae5 ("net: ipv6: add tokenized interface identifier support") Signed-off-by: Hangbin Liu --- net/ipv6/addrconf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 24e319dfb510..4e63330f63e5 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -5689,8 +5689,6 @@ static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token) return -EINVAL; if (dev->flags & (IFF_LOOPBACK | IFF_NOARP)) return -EINVAL; - if (!ipv6_accept_ra(idev)) - return -EINVAL; if (idev->cnf.rtr_solicits == 0) return -EINVAL;