|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Choosing the source IP address for an LDAP connection
Hi,
I must run an LDAP client program (using OpenLDAP 2.2.6) on a multi-homed host, i.e. one with several network interfaces/IP addresses. For network security reasons, the connection to the LDAP server must be established through a specific source IP address. Much as I have browsed through the OpenLDAP documentation, I have been unable to find a way to choose the source IP address when setting up the LDAP connection to the server The result is that my program just uses any source IP address, which means nothing works if the chosen IP happens not to be the "right" one.I've Googled myself to death looking for the way to do it with no success so far. Does anyone know how I may select the source IP address when setting up an LDAP client connection using OpenLDAP 2.2.6? Thanks a lot, Briareos |
|
#2
|
|||
|
|||
|
In OpenLDAP 2.4 there is a function that should do the trick:
Code:
int ldap_init_fd(fd, proto, uri, ldp)
ber_socket_t fd;
int proto;
char *uri;
LDAP **ldp;
You establish the TCP connection beforehand, binding it to the local IP address of your choosing, then use the resulting socket to build the LDAP connection over it. Compared to the function I was using Code:
int ldap_initialize(ldp, uri)
LDAP **ldp;
char *uri;
ldap_init_fd() is a bit of a nuisance because you have to parse the LDAP URI and perform the name resolution yourself but that's OK with me. The problem is that, as far as I can tell, neither ldap_init_fd() or nor an equivalent function are available in OpenLDAP 2.2.6, which is the version I must work with. Any ideas? |
![]() |
| Viewing: Dev Shed Forums > Databases > LDAP Programming > Choosing the source IP address for an LDAP connection |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|