Re: [RESEND PATCH liburing v1 00/12] Introducing t_bind_ephemeral_port() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 2, 2022 at 8:18 AM Ammar Faizi wrote:
> ## Solution:
> Setting @addr->sin_port to zero on a bind() syscall lets the kernel
> choose a port number that is not in use. The caller then can know the
> port number to be bound by invoking a getsockname() syscall after
> bind() succeeds.
>
> Wrap this procedure in a new function called t_bind_ephemeral_port().
> The selected port will be returned into @addr->sin_port, the caller
> can use it later to connect() or whatever they need.

with variable placement fix, for all patches:

Reviewed-by: Alviro Iskandar Setiawan <alviro.iskandar@xxxxxxxxxxx>
Tested-by: Alviro Iskandar Setiawan <alviro.iskandar@xxxxxxxxxxx>

(tested on 5.19)

tq

-- Viro



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux