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,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 862ABC43381 for ; Tue, 26 Feb 2019 04:36:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4713D2146F for ; Tue, 26 Feb 2019 04:36:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sqf4yrlN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726122AbfBZEg2 (ORCPT ); Mon, 25 Feb 2019 23:36:28 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46806 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbfBZEg2 (ORCPT ); Mon, 25 Feb 2019 23:36:28 -0500 Received: by mail-pg1-f193.google.com with SMTP id 196so5560478pgf.13 for ; Mon, 25 Feb 2019 20:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RxM73gwekbj2yGWojZlY6mWRogjSMC4MXSqZIR2RfEg=; b=sqf4yrlN/Xtrdyel4ht/PXL6pEq/3uiCGBiflW0CscLL3jcfHVJXW4lXgbe92hcRq2 kZj8VxIhKRr+AtfibWRn48skRESSbC1ZoOsTzZ43BBJ9rPE89eiplS0w3ZEBVyw5JOxh 2RAI6Wdu+p1cVinL0dtZTFnOncl52Spx+qHopHvVGguKBJBzHacGaU8vj+0ELx4VesdP kGd61zHIy8BQreVKQpDSq9GhnrRIhRjIqOhYmtog9zjfj1qAD44zmJ7P3I8H9Rfhvg2D QfS3rmxPqSeM8YIuo6rJXP+1ywtNMqG9CKqqOWr0VNNMn54sPT1sIi6SPL6BidXVTgEU 9HoA== 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=RxM73gwekbj2yGWojZlY6mWRogjSMC4MXSqZIR2RfEg=; b=HYyti1+solN8lQB5rSm9qgnfqAT/uq7y56OXOYy4282TnSn8p3W6pV7xrPUvojmVr9 H5l6NngNL30T3JfMxjcwPbVCYuE7tsf1x2WCQ5B/2eGQUjQ4nrOZPtyHH/Qwf8N1cA4l aB5+MxfSnhULAltCjF+IgzUSsummGXF/6CjhOkVS8N0c22HrkU787Ty2606TRVL8i+mQ HvCJ08oekGs8Md36EWPYgGHbV38VzJ7Ye/fBek/+46qBn33G9MBY8jeZ0J9xS5qcPGyb pcywaC3fpknc4WNf2teN+QgfB0XWhqkYAk1qAeBOp4HFvmi7XvtokE0YwyKtyBMmV8BA UspA== X-Gm-Message-State: AHQUAuYtrW+cWby+h3+UoCkROiL/ceDb2HziNgDL2BYPKqJHdhxD8el+ 3VUXxsOQLn1Y9fwE0QlP1rQ= X-Google-Smtp-Source: AHgI3IbjYrK9oq3M5xmdy8fnoY4wyFptBWllEuIIRw+Zu93skDZh5UCFmXBw/sLabWNRQFX4pKnBPA== X-Received: by 2002:a65:62ce:: with SMTP id m14mr3458721pgv.101.1551155787286; Mon, 25 Feb 2019 20:36:27 -0800 (PST) Received: from [192.168.86.235] (c-73-241-150-70.hsd1.ca.comcast.net. [73.241.150.70]) by smtp.gmail.com with ESMTPSA id x123sm15781037pfx.94.2019.02.25.20.36.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 20:36:26 -0800 (PST) Subject: Re: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled To: Hangbin Liu , David Ahern 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> <20190226015533.GR10051@dhcp-12-139.nay.redhat.com> <20190226040759.GU10051@dhcp-12-139.nay.redhat.com> From: Eric Dumazet Message-ID: Date: Mon, 25 Feb 2019 20:36:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190226040759.GU10051@dhcp-12-139.nay.redhat.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 02/25/2019 08:08 PM, Hangbin Liu wrote: > Hi David, > On Mon, Feb 25, 2019 at 07:15:26PM -0700, David Ahern wrote: >> On 2/25/19 6:55 PM, Hangbin Liu wrote: >>> Just as I said, this issue only occurs when IPv6 is disabled at boot time >>> as there is no IPv6 route entry. Disable ipv6 on specific interface should >>> not be affected(IPv6 route/fib has inited). So I think use ipv6_mod_enabled() >>> would be more suitable in this scenario. Did I miss something? >> >> From a readability perspective the code path depends on whether ipv6 is >> enabled on the device. I think it is better to leave that as it is. > > When I posted 173656accaf5 ("sit: check if IPv6 enabled before calling > ip6_err_gen_icmpv6_unreach()"), my purpose is to check if IPv6 disabled > at boot time. I didn't know we have ipv6_mod_enabled() at that time, so I > just used __in6_dev_get() as a trick way/work around. > > A few days later I saw your commit e434863718d4 ("net: vrf: Fix crash when > IPv6 is disabled at boot time") and I thought this would be a more clear way > to tell people that we are checking if IPv6 disabled at boot time. So I posted > these two follow up fixes. > > I don't know why you thought check IPv6 is enbled on the device is better. > Because it's more strict? Maybe I missed something here. But if you feel it > is better to leave as it it, then let's keep it. > I do not get it. We really do not care if IPv6 is enabled on some device on the host. Here the correct test is checking if IPv6 is enabled for _this_ device. It is not about fixing a crash (it is already fixed), but not having to call ip6_err_gen_icmpv6_unreach() knowing it will fail anyway. So the current code is better. Thank you.