From mboxrd@z Thu Jan 1 00:00:00 1970 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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 7C81BC43381 for ; Mon, 25 Feb 2019 16:57:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AF832083D for ; Mon, 25 Feb 2019 16:57:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cumulusnetworks.com header.i=@cumulusnetworks.com header.b="JMfUapPc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728544AbfBYQ5q (ORCPT ); Mon, 25 Feb 2019 11:57:46 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46812 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728272AbfBYQ5p (ORCPT ); Mon, 25 Feb 2019 11:57:45 -0500 Received: by mail-pf1-f195.google.com with SMTP id g6so4747427pfh.13 for ; Mon, 25 Feb 2019 08:57:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cumulusnetworks.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AVXYtxLKxiJf5AwvwbyKAUNMqIgCXMPhqq6W31JbFyY=; b=JMfUapPcV8lKFMflx2REKmOQuCb1Lpkj3KQKccn2bd87jTeG1TacW5R3lg41ItIsSc GrU/jINjxsjWzNKqZcMeIoYFLb/RTUCV6i5uk2xfw2mOdSViisUqQVeSZxx4xQrGamzA QKIrMFfsMve26W6WVelD2r7gzc6YD79DPa+hw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AVXYtxLKxiJf5AwvwbyKAUNMqIgCXMPhqq6W31JbFyY=; b=IJ9B1PXBWGv0QqBl1d14z+iRuNznkxdzpIjebyeKzb7cBiaRVyvDNWCl15CNWJqGUm NMkWrVJqw5Ppsifzpw7zBJz8tQlwI5c6v/UN3WS2jY37xBrRckbMngWfZ+m2yjxiI4z4 /pbi7IHKcZHV/09dwUnv15MkpCt8Jkc0/HHp+xuAqBm1jSyUiIvm+U6CKbGAhYk1Yyzu MRHc+2SDCAwG7e5jCLtvqNAqiHAYNMvS7QPQu3THBCk4YGuWNmOPT5Lw/df3XVSa9+0Z GVBD6h9pMxvGAV88/vIRhVEm5jeYmg4bHc2/vFl6vpCqJWaSAYeaHx2OWdxxsCiI1g8f NoPw== X-Gm-Message-State: AHQUAubUeQAjhrnfE66MMDwgXcYDTk6+XOTJMVsNwJ6KC4uQihoi6Eoe w3gyn0eBt77YILBBnVUck45kLQ== X-Google-Smtp-Source: AHgI3IbrQVTuc4xNsylNi4xnZznRHD0mpUBDp09snQONXV/efdrraVbj+sITSPnh7GTS+AHaXFsqXQ== X-Received: by 2002:a62:6ec3:: with SMTP id j186mr21951303pfc.89.1551113864876; Mon, 25 Feb 2019 08:57:44 -0800 (PST) Received: from ?IPv6:2601:282:800:fd80:e962:5547:1520:25d4? ([2601:282:800:fd80:e962:5547:1520:25d4]) by smtp.googlemail.com with ESMTPSA id z1sm17173817pfi.155.2019.02.25.08.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 08:57:43 -0800 (PST) Subject: Re: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled To: Eric Dumazet , Hangbin Liu Cc: netdev@vger.kernel.org, Stefano Brivio , "David S . Miller" References: <20190225041243.9753-1-liuhangbin@gmail.com> <7c0f5c9c-d918-de27-643d-416509576be4@gmail.com> <20190225081759.GP10051@dhcp-12-139.nay.redhat.com> <1dd57d9d-fed2-67b8-ac28-7ef3681eeed2@gmail.com> From: David Ahern Message-ID: Date: Mon, 25 Feb 2019 09:57:42 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1dd57d9d-fed2-67b8-ac28-7ef3681eeed2@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2/25/19 9:39 AM, Eric Dumazet wrote: > > > On 02/25/2019 12:17 AM, Hangbin Liu wrote: >> On Sun, Feb 24, 2019 at 08:24:51PM -0800, Eric Dumazet wrote: >>> >>> >>> On 02/24/2019 08:12 PM, Hangbin Liu wrote: >>>> ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled >>>> at running time. >>>> >>> >>> >>> Why is it better exactly ? >>> >>> IPv6 can be enabled on the host, but disabled per device >>> >>> /proc/sys/net/ipv6/conf/{name}/disable_ipv6 >> >> Sorry, it looks I didn't make it clear in the commit description. >> This issue only occurs when IPv6 is disabled at boot time as there is >> no IPv6 route entry. Disable ipv6 on specific interface is not affected. >> So check ipv6_mod_enabled() is enough and we don't need to worry about >> the rcu_read_lock or the dev status. >> >> Should I update the commit description? > > Certainly. Are you telling us skb->dev could be NULL here ? > > Because rcu_read_lock() should already be asserted. > Same response as geneve. The existing check is more appropriate and relevant for the code path: is ipv6 enabled on this device versus is ipv6 enabled at all.