Issue 8654 - Option for LDAP client to bind to a local address.
Summary: Option for LDAP client to bind to a local address.
Status: VERIFIED DUPLICATE of issue 8847
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.44
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
: 8930 (view as issue list)
Depends on:
Blocks:
 
Reported: 2017-05-15 21:22 UTC by daniel.le@exfo.com
Modified: 2020-03-26 19:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description daniel.le@exfo.com 2017-05-15 21:22:02 UTC
Full_Name: Daniel Le
Version: 2.4.44
OS: Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (107.0.5.66)


Enhancement request to modify the ldap_set_option function to add support for a
multihomed client to bind to a specific local network address, similarly to
"telnet -b <client-local-address>" option or Microsoft LDAP client API function
ldap_set_option(LDAP_OPT_SOCKET_BIND_ADDRESSES).

Thank you.
Comment 1 Howard Chu 2017-05-15 21:37:13 UTC
Daniel.Le@Exfo.com wrote:
> Full_Name: Daniel Le
> Version: 2.4.44
> OS: Linux
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (107.0.5.66)
>
>
> Enhancement request to modify the ldap_set_option function to add support for a
> multihomed client to bind to a specific local network address, similarly to
> "telnet -b <client-local-address>" option or Microsoft LDAP client API function
> ldap_set_option(LDAP_OPT_SOCKET_BIND_ADDRESSES).

It might be helpful if you would link to the documentation for this option, so 
someone can write something compatible.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 2 daniel.le@exfo.com 2017-05-16 00:53:19 UTC
For reference:
https://msdn.microsoft.com/en-us/library/aa367019(v=vs.85).aspx

LDAP_OPT_SOCKET_BIND_ADDRESSES
0x44

Sets or retrieves a pointer to a TCHAR string containing a list of space-separated addresses to be used by socket bind. For a multihomed machine, use this option to set a particular network interface address to be used for socket bind. Socket bind will be performed before socket connect for the server address. See socket bind for more details.

You should provide both IPv4 and IPv6 local addresses, if available, because both IPv4 and IPv6 server addresses can be used for socket connect. Socket bind will fail if there is an address family mismatch. On the Domain Controller, for the default Server (HostName=NULL), loopback addresses will be used for socket connect. Set loopback addresses (for both IPv4 and IPv6) for this option to work.

This option can only be set before a connection is established. That is, just after ldap_init.

-------------------------------
I am not sure what "a list of space-separated addresses" exactly means. Perhaps one IPv4 IP address and one IPv6 address if both are available. My use case is either a local IPv4 or IPv6 address.

Daniel
Comment 3 Michael Ströder 2017-05-16 07:23:46 UTC
daniel.le@exfo.com wrote:
> I am not sure what "a list of space-separated addresses" exactly means. Per=
> haps one IPv4 IP address and one IPv6 address if both are available. My use=
>  case is either a local IPv4 or IPv6 address.

Hmm, a dual-stack machine is the most likely use-case. This also raises the question of
the IP address list os ordered and the caller can therefore give a preference for IPv4 or
IPv6 (e.g. like postfix is doing it for out-going SMTP conns).

Ciao, Michael.

Comment 4 Quanah Gibson-Mount 2017-05-16 15:03:24 UTC
--On Tuesday, May 16, 2017 1:53 AM +0000 daniel.le@exfo.com wrote:


As noted in my reply on -technical, you need to subscribe to the 
openldap-devel list, and have this discussion there, before starting work.

Thanks!

--Quanah

--

Quanah Gibson-Mount
Product Architect
Symas Corporation
Packaged, certified, and supported LDAP solutions powered by OpenLDAP:
<http://www.symas.com>


Comment 5 Quanah Gibson-Mount 2017-09-06 23:48:12 UTC
changed notes
Comment 6 Quanah Gibson-Mount 2017-09-12 18:32:55 UTC
changed notes
Comment 7 OpenLDAP project 2018-11-17 00:17:37 UTC
has patch;openldap-scratch
IPR missing

See also ITS#8847, ITS#8930
Comment 8 Quanah Gibson-Mount 2018-11-17 00:17:37 UTC
changed notes
Comment 9 Quanah Gibson-Mount 2020-03-23 18:26:02 UTC
*** Issue 8930 has been marked as a duplicate of this issue. ***
Comment 10 Quanah Gibson-Mount 2020-03-26 19:01:25 UTC
Missing IPR, 8847 has IPR and more recent work.

*** This issue has been marked as a duplicate of issue 8847 ***