[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e08a7554-bd3e-e524-830d-64b76853ace2@gmail.com>
Date: Tue, 2 Nov 2021 21:06:43 -0600
From: David Ahern <dsahern@...il.com>
To: Leonard Crestez <cdleonard@...il.com>,
David Ahern <dsahern@...nel.org>,
Shuah Khan <shuah@...nel.org>,
Dmitry Safonov <0x7f454c46@...il.com>,
Eric Dumazet <edumazet@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
Kuniyuki Iwashima <kuniyu@...zon.co.jp>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Jakub Kicinski <kuba@...nel.org>,
Yuchung Cheng <ycheng@...gle.com>,
Francesco Ruggeri <fruggeri@...sta.com>,
Mat Martineau <mathew.j.martineau@...ux.intel.com>,
Christoph Paasch <cpaasch@...le.com>,
Ivan Delalande <colona@...sta.com>,
Priyaranjan Jha <priyarjha@...gle.com>, netdev@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 21/25] tcp: authopt: Add initial l3index support
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(...)
Powered by blists - more mailing lists