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: <CAMB2axPA6hEHJ_xm-aperc3kb221kK4RpL848pgY_sL+8RBFHA@mail.gmail.com>
Date: Sun, 28 Jul 2024 15:10:18 -0700
From: Amery Hung <ameryhung@...il.com>
To: Arseniy Krasnov <avkrasnov@...utedevices.com>
Cc: 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, 
	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, xiyou.wangcong@...il.com
Subject: Re: [RFC PATCH net-next v6 02/14] af_vsock: refactor transport lookup code

On Wed, Jul 24, 2024 at 11:41 PM Arseniy Krasnov
<avkrasnov@...utedevices.com> wrote:
>
> 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;

Looks good to me. Will change it in the next version.

Thanks,
Amery

> +
> +       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