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

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

 



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