When compiling against openldap 2.6.0 kamailio's private ldap_connect() clashes
with openldap's own. curl dealt with a similar issue earlier (see [1]).

Simply rename the function to avoid the issue.

In file included from ldap_api_fn.c:37:
ldap_connect.h:34:12: error: conflicting types for 'ldap_connect'; have 'int(char *)'
   34 | extern int ldap_connect(char *_ld_name);
      |            ^~~~~~~~~~~~
In file included from ldap_api_fn.c:33:
/home/sk/tmp/sdk/openwrt-sdk-ath79-generic_gcc-11.2.0_musl.Linux-x86_64/staging_dir/target-mips_24kc_musl/usr/include/ldap.h:1555:1: note: previous declaration of 'ldap_connect' with type 'int(LDAP *)' {aka 'int(struct ldap *)'}
 1555 | ldap_connect( LDAP *ld );
      | ^~~~~~~~~~~~
make[5]: *** [../../Makefile.rules:100: ldap_api_fn.o] Error 1
make[4]: *** [Makefile:511: modules] Error 1

[1] curl/curl@8bdde6b

Signed-off-by: Sebastian Kemper sebastian_ml@gmx.net

Pre-Submission Checklist

Type Of Change

Checklist:

Description

Hi all,

Small compile fix. I saw kamailio is failing to build on OpenWrt build bots since a recent openldap bump from 2.4.58 to 2.6.0.

I linked a curl commit in the commit message, they also renamed some of their functions, although they did rename all their ldap_* functions to oldap_. I didn't dare do that in kamailio :) Renaming a single function was enough to make it compile again.

Maybe you want to do something different to address this issue, I don't know.

I didn't runtest this.

Kind regards,
Seb


You can view, comment on, or merge this pull request online at:

  https://github.com/kamailio/kamailio/pull/2975

Commit Summary

File Changes

(3 files)

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.