Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4971983pxb; Tue, 2 Nov 2021 20:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1m9EN8EccfyZCJMZPS3GErvFjhiz0wpflA7PxNtSzBzj75YnJ38nlZHphNfXmlwE2uFso X-Received: by 2002:a05:6e02:1ba5:: with SMTP id n5mr26887030ili.249.1635908861693; Tue, 02 Nov 2021 20:07:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635908861; cv=none; d=google.com; s=arc-20160816; b=KrjfLJt4dYwidKd7CiGHn3fgEqb1yKKW3Mp4FW/w9a8e741B8BnXpeYPtgBynu8+CO m91vFvS9b2tNDm7ZrDy5UeP+PVb9JO8ZXYkFFcVfY/BYqBGHdmuBPZdVr6P36SrjgoCJ 0M1Rsg0UpmmppR+puoGKQwUJAJAu8i6cb1ZtVWUIT6k1jWmRwNPcPCW8udK9TqUEAeKJ +oxy+HnU7VQG0NnPQAD/vuMmWxT59DfRGnLqZsu2YM3B57lI+HyXjuvHSYQ5nkZCEeEO pT6X2poSeyXTCnDNeUgfwQZ0LxN/f4+VdfoebiTKzjnaQRvP9s6dRsGEkN+HR7kyk2hI gysg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=i5D64TfyrAvrxwhd90ZrsbSzk93mZsSmsculp94NFPY=; b=SQLJ7pWwX45TK/1IxNRKGAXENKM70OX7I4JaMGj9OBG/jFyYJHcvQ4qbrkPUrvC6ex Qo4BZp22PWP/W4+5yox/jN0p468OZwZTJTsi6wGyRwOGyp3/DVVXLij0Y3/EbinMiKYA 2Ar4wR5AIWNap5Y9FD5BdHFewFR1en9XEGO6n8YqZn+mUh0OxavC+Py1KXvnPloP5gYQ ql4YLA8j0wfsegD+uGoWdJfvcY+tXA7Gvgg76Jjaj+2VqYs9DuClY1dp0WAkMuiQC2k4 F9Ry+n9GhwBHN6KSJ+lCOOBrFvQwkZhUkmCb3hCHx8MOMGLs+LNPioneqFZ0aH7ocdWi D8rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EEUbPEFn; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si1743127jaj.131.2021.11.02.20.07.04; Tue, 02 Nov 2021 20:07:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EEUbPEFn; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230152AbhKCDJg (ORCPT + 99 others); Tue, 2 Nov 2021 23:09:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbhKCDJW (ORCPT ); Tue, 2 Nov 2021 23:09:22 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C15ABC061203; Tue, 2 Nov 2021 20:06:46 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id v2-20020a05683018c200b0054e3acddd91so1654969ote.8; Tue, 02 Nov 2021 20:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=i5D64TfyrAvrxwhd90ZrsbSzk93mZsSmsculp94NFPY=; b=EEUbPEFnizI3vk7rX/JADCRBBrhLk8LhzL72RLeS01+3x2ATflkg84ry44PnCtYzaG cGieZ6xGoeDhYOzLjri+E20o7prewe0dUtA6KxcqgExyGI0lQPooGrIb0F+UnJtAjfTr wC77D3DuVgPrijp2FjqzdzAAk31fs+KroFPa32jjFx9CShAcFYxaYflyqYX+hOkXG2In e9vSO7Ebj3HKrZGmso3PNnA06xqFeXp/bm4cDgVw38PExmKBlBgGeQgP+1mi9T85L5jI F7JfAolc8Q16yKfnPMmnKfrM6kyvgIjVhqQZv7OwI+/QiSK+O0KwTkwLXvKd0rbdOJuE 3HRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=i5D64TfyrAvrxwhd90ZrsbSzk93mZsSmsculp94NFPY=; b=ecwea65W8/6fWHeiDQKjUV7EkYV+U/Y8HSyFPWoju5SGwe+KgP0XNELlVmpiaip1BU ruQbfxhTiJKoPtmHwAIBYxLFWLaQYvV/Q02KTVgTEUsUTBrrw2vVG+AJ2651AodsBW7I E3JjWrJMlq4Gs8QZIDljwjIGgFcrM7FP6ohTaXEBTwLzBoPhPZ1MUab6ESAUfRykP4nK D6DYtqA5vTWIQX5bh7j2gFNsPzp5FcKYCWKKZ84fL0cJXIX4oSqwANhcIcmLkKVTX5M0 ZD/DiQpJE0Ub7RZg7XME7R3MwIF2KsHFvBA4BLnRJswu49BH2PqbUiOebC+d0NNPwHDL +EdQ== X-Gm-Message-State: AOAM5324u75NXFhC+EcQboYtWL9bwF8Umc5LAgOq4eIToKxgSBONAryL 5vk3JEQ+24NPZbtNnEGaW3U= X-Received: by 2002:a9d:825:: with SMTP id 34mr1137042oty.305.1635908806152; Tue, 02 Nov 2021 20:06:46 -0700 (PDT) Received: from [172.16.0.2] ([8.48.134.30]) by smtp.googlemail.com with ESMTPSA id s26sm228629otq.14.2021.11.02.20.06.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Nov 2021 20:06:45 -0700 (PDT) Message-ID: Date: Tue, 2 Nov 2021 21:06:43 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2 21/25] tcp: authopt: Add initial l3index support Content-Language: en-US To: Leonard Crestez , David Ahern , Shuah Khan , Dmitry Safonov <0x7f454c46@gmail.com>, Eric Dumazet Cc: "David S. Miller" , Herbert Xu , Kuniyuki Iwashima , Hideaki YOSHIFUJI , Jakub Kicinski , Yuchung Cheng , Francesco Ruggeri , Mat Martineau , Christoph Paasch , Ivan Delalande , Priyaranjan Jha , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org References: <4e049d1ade4be3010b4ea63daf2ef3bed4e1892b.1635784253.git.cdleonard@gmail.com> From: David Ahern In-Reply-To: <4e049d1ade4be3010b4ea63daf2ef3bed4e1892b.1635784253.git.cdleonard@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 11/1/21 10:34 AM, Leonard Crestez wrote: > @@ -584,10 +614,24 @@ int tcp_set_authopt_key(struct sock *sk, sockptr_t optval, unsigned int optlen) > return -EINVAL; > err = tcp_authopt_alg_require(alg); > if (err) > return err; > > + /* check ifindex is valid (zero is always valid) */ > + if (opt.flags & TCP_AUTHOPT_KEY_IFINDEX && opt.ifindex) { > + struct net_device *dev; > + > + rcu_read_lock(); > + dev = dev_get_by_index_rcu(sock_net(sk), opt.ifindex); > + if (dev && netif_is_l3_master(dev)) > + l3index = dev->ifindex; > + rcu_read_unlock(); rcu_read_lock()... rcu_read_unlock() can be replaced with netif_index_is_l3_master(...)