lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Apr 2018 20:55:18 -0400 (EDT)
From:   David Miller <davem@...emloft.net>
To:     borisp@...lanox.com
Cc:     netdev@...r.kernel.org, saeedm@...lanox.com, davejwatson@...com,
        ktkhai@...tuozzo.com, ilyal@...lanox.com, aviadye@...lanox.com
Subject: Re: [PATCH V6 net-next 07/15] net/tls: Add generic NIC offload
 infrastructure

From: Boris Pismenny <borisp@...lanox.com>
Date: Sun, 22 Apr 2018 18:19:49 +0300

> +/* We assume that the socket is already connected */
> +static struct net_device *get_netdev_for_sock(struct sock *sk)
> +{
> +	struct inet_sock *inet = inet_sk(sk);
> +	struct net_device *netdev = NULL;
> +
> +	netdev = dev_get_by_index(sock_net(sk), inet->cork.fl.flowi_oif);
> +
> +	return netdev;
> +}

Please do this more directly by looking at sk->sk_dst_cache and taking
the device from dst->dev if non-NULL.

That avoids the dev_get_by_index() demux work, and also if
sk->sk_dst_cache is non-NULL then the socket is indeed connected.

Thanks.

Powered by blists - more mailing lists