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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 DAEA0C433E0 for ; Fri, 29 Jan 2021 03:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2D4564DFB for ; Fri, 29 Jan 2021 03:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231726AbhA2DLU (ORCPT ); Thu, 28 Jan 2021 22:11:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhA2DLT (ORCPT ); Thu, 28 Jan 2021 22:11:19 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9540C061573 for ; Thu, 28 Jan 2021 19:10:38 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id i30so7365854ota.6 for ; Thu, 28 Jan 2021 19:10:38 -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=J4u7OEtr/C5VuNEGMxuXWVaPcFTBGWfPeuL+ZnTgwg8=; b=APmfq7adguHAOEf7uRGvclEO+xQleGXgOrEGstJQ8wb4efhU6nWPDSSnaSQ56O86Do jroaQo4igme3hRmRYo8diPL1MKy9NiOVUREOn4K+RpJ/GM5Lo3LqU2w17//Dmo/fo8J6 ODwE++oMmMRBE5v0Rt6TTQEb5hd6yqgNkzj8f2t01abBDYUmeMOlUhO7kOTcMEF+/CMo IvfRbEuLG0X8NIrpAj6Bz3eGmB8JoqvrUhw9ZTTXVt/WtBjN/Q2fvIGmasTUCZbwK/3Q HBgaI51x/75QetXsBxLAoj/mA8h3kawwZehG1ViHZBPHVOAz4rng5eI0NZ9yBzXazFKx b95Q== 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=J4u7OEtr/C5VuNEGMxuXWVaPcFTBGWfPeuL+ZnTgwg8=; b=V1FtuiLL+sb1EKpTBUWgMRea6f9KArru7fkIG1Hzu2hiOToV+2WcARjDWtcgloiz+q i729fIO2lMyq6DkqXSYt5t9OAm913BiJVbtJwcgaEqDYJxgbWipjdw5aBi2Ok2ivRlx2 7eAijB7dNP9f6jfKXm/TvFHhEPcpaV5L0Qg+ZPQ+4faRRMNW626r4CsigCipd0RmenvU fsm4BuZEF5l48K+lvpjflb7cmz5VrHTlsVxv/yAxjDEbSYIF16bAbZZV4fFa9d9ayRds 0QVs3jjqQ8mWCE7tqOLs6m/5vealxEmdRg88fya9ibrBHVhIWPwg+gik0SarkB83lp3R tP3Q== X-Gm-Message-State: AOAM532ofhCAjg9zgFpAEOwuyaB6/MsF0TT1bGJ2um3Jf4oJO6FBfxe+ bCV4Xs+VgwpzLFIMSK4/FNI= X-Google-Smtp-Source: ABdhPJxNiePUmzxjjHRPRW1aZP+DxKoNbLplmbKsN2GgoYU51vmoHmwPrQDRNhqrcRT+qgG29PRsng== X-Received: by 2002:a9d:62c8:: with SMTP id z8mr1698359otk.65.1611889838467; Thu, 28 Jan 2021 19:10:38 -0800 (PST) Received: from Davids-MacBook-Pro.local ([8.48.134.50]) by smtp.googlemail.com with ESMTPSA id r5sm1717135otd.24.2021.01.28.19.10.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jan 2021 19:10:37 -0800 (PST) Subject: Re: [PATCH net-next 04/12] nexthop: Assert the invariant that a NH group is of only one type To: Petr Machata , netdev@vger.kernel.org Cc: David Ahern , "David S. Miller" , Jakub Kicinski , Ido Schimmel References: From: David Ahern Message-ID: <474a4286-2ced-55ff-66a8-0f67bf5dee40@gmail.com> Date: Thu, 28 Jan 2021 20:10:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 1/28/21 5:49 AM, Petr Machata wrote: > Most of the code that deals with nexthop groups relies on the fact that the > group is of exactly one well-known type. Currently there is only one type, > "mpath", but as more next-hop group types come, it becomes desirable to > have a central place where the setting is validated. Introduce such place > into nexthop_create_group(), such that the check is done before the code > that relies on that invariant is invoked. > > Signed-off-by: Petr Machata > Reviewed-by: Ido Schimmel > --- > net/ipv4/nexthop.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > Reviewed-by: David Ahern