Re: [PATCH] librdmacm: Add command line option to specify server

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

 



On Mon, Mar 12, 2018 at 05:39:07PM +0000, Hefty, Sean wrote:
> > Just read man page and realized that you are correct, when 'node'
> > argument is given the AI_PASSIVE is ignored.
> > I am confused, why can't i have them both? i.e be *passive* side of
> > the connection *while* still bind to specific source address.
> 
> The behavior matches getaddrinfo():
> 
>        If the AI_PASSIVE flag is specified in hints.ai_flags, and node is
>        NULL, then the returned socket addresses will be suitable for
>        bind(2)ing a socket that will accept(2) connections.  The returned
>        socket address will contain the "wildcard address" (INADDR_ANY for
>        IPv4 addresses, IN6ADDR_ANY_INIT for IPv6 address).  The wildcard
>        address is used by applications (typically servers) that intend to
>        accept connections on any of the host's network addresses.  If node
>        is not NULL, then the AI_PASSIVE flag is ignored.
> 
> You can call getaddrinfo() without the passive flag and simply use the returned address as input into bind, provided that you know the address is local.

Yeah perfect, it goes hand by hand with my testings. So actually AI_PASSIVE
can be skipped in local server case, right?

Leon,
Since RAI_PASSIVE is used not only for getaddrinfo i would leave it's
settings as it is unless you have an objection.

What do you think?

> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux