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]
Message-ID: <8d7dc8cb-0211-8e20-2391-c16d266b8be6@salutedevices.com>
Date: Thu, 25 Jul 2024 09:29:10 +0300
From: Arseniy Krasnov <avkrasnov@...utedevices.com>
To: <stefanha@...hat.com>, <sgarzare@...hat.com>, <mst@...hat.com>,
	<jasowang@...hat.com>, <xuanzhuo@...ux.alibaba.com>, <davem@...emloft.net>,
	<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
	<kys@...rosoft.com>, <haiyangz@...rosoft.com>, <wei.liu@...nel.org>,
	<decui@...rosoft.com>, <bryantan@...are.com>, <vdasa@...are.com>,
	<pv-drivers@...are.com>
CC: <dan.carpenter@...aro.org>, <simon.horman@...igine.com>,
	<oxffffaa@...il.com>, <kvm@...r.kernel.org>,
	<virtualization@...ts.linux-foundation.org>, <netdev@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-hyperv@...r.kernel.org>,
	<bpf@...r.kernel.org>, <bobby.eshleman@...edance.com>,
	<jiang.wang@...edance.com>, <amery.hung@...edance.com>,
	<ameryhung@...il.com>, <xiyou.wangcong@...il.com>
Subject: [RFC PATCH net-next v6 02/14] af_vsock: refactor transport lookup
 code

Hi

+static const struct vsock_transport *
+vsock_connectible_lookup_transport(unsigned int cid, __u8 flags)
                                                      ^^^ may be just 'u8' ?
+{
+	const struct vsock_transport *transport;
                                       ^^^ do we really need this variable now?
                                       May be shorter like:
                                       if (A)
                                           return transport_local;
                                       else if (B)
                                           return transport_g2h;
                                       else
                                           return transport_h2g;
+
+	if (vsock_use_local_transport(cid))
+		transport = transport_local;
+	else if (cid <= VMADDR_CID_HOST || !transport_h2g ||
+		 (flags & VMADDR_FLAG_TO_HOST))
+		transport = transport_g2h;
+	else
+		transport = transport_h2g;
+
+	return transport;
+}
+

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ