Fixes use of freeradiusclient library for radius modules. Setting right path. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1170
-- Commit Summary --
* radius : Fixes freeradiusclient library
-- File Changes --
M src/modules/misc_radius/radius.h (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1170.patch https://github.com/kamailio/kamailio/pull/1170.diff
i hope my commit message is enough for explanation
You are dropping backwards portability. Any particular reason for that?
Hello, Because there is confict between Makefile.radius . Makefile.radius need to setting freeradius value to use.
If I got it right, you interchanged the freeradius client with radiusclient-ng, but the condition at the top is negated, respectively `#ifndef USE_FREERADIUS`. With the patch it seems that when USE_FREERADIUS is defined, the radiusclient-ng is going to be used -- that's not right.
Have you encountered any issue and this patch is fixing it?
Hello @miconda , there is conflict with Makefile.radius . this file selects freeradiusclient without settting freeradius, but makefile.radius needs to FREERADIUS for using freeradiusclient.h . so compiling couldnt find .h file, gives error. Could you check it again , please.
ERROR : `In file included from acc_radius_mod.c:44: ../misc_radius/radius.h:38:31: warning: radiusclient-ng.h: No such file or directory `
Thanks.
` INCLUDES+=-I$(LOCALBASE)/include
ifeq ($(FREERADIUS),1)
# - freeradius-client library DEFS+= -DUSE_FREERADIUS RADIUSCLIENT_LIB=freeradius-client
else ifeq ($(RADCLI),1)
# - radcli library DEFS+= -DUSE_RADCLI RADIUSCLIENT_LIB=radcli
else # - radiusclient-ng v5 or v4 library ifneq ($(radiusclient_ng), 4)
# radiusclient-ng 5+ # DEFS+=-DRADIUSCLIENT_NG_5P RADIUSCLIENT_LIB=radiusclient-ng
else
DEFS+=-DRADIUSCLIENT_NG_4 RADIUSCLIENT_LIB=radiusclient
endif endif
endif
LIBS=-L$(LOCALBASE)/lib -l$(RADIUSCLIENT_LIB) `
The default is to use radiusclient-ng library. To use freeradius-client, then you have to set FREERADIUS=1 in the make command. Am I missing something? Have you set FREERADIUS=1 and doesn't work?
Hello @miconda , I am sorry for my english isnt enough for explain it. if i set "export FREERADIUS=1" Makefile.radius selecting "freeradius-client.h" but radius.h selects radiusclient-ng.h . if i dont set FREERADIUS Makefile.radius selects "radiusclient-ng.h" but radius.h selects ""freeradius-client.h" Here is results,
` export FREERADIUS=1 make all make -C src/ all make[1]: Entering directory `/usr/src/kamailio-5.0.2/src' make[3]: `libsrdb2.so.1.0' is up to date. make[3]: `libsrdb1.so.1.0' is up to date. CC (gcc) [M acc_radius.so] acc_radius_mod.o In file included from acc_radius_mod.c:44: ../misc_radius/radius.h:43:30: warning: radiusclient-ng.h: No such file or directory acc_radius_mod.c: In function ‘init_acc_rad’:
` ` make clean make -C src/ clean make[1]: Entering directory `/usr/src/kamailio-5.0.2/src' make[2]: *** No rule to make target `clean'. Stop. make --no-print-directory -C lib clean Making clean in binrpc Making clean in cds Making clean in ims Making clean in presence Making clean in print Making clean in shm_regex Making clean in srdb1 Making clean in srdb2 Making clean in srutils Making clean in trie Making clean in xcap make[1]: Leaving directory `/usr/src/kamailio-5.0.2/src' make include_modules="db_mysql acc_radius auth_radius misc_radius carrierroute utils " cfg make -C src/ cfg target architecture <x86_64>, host architecture <x86_64> make[1]: Entering directory `/usr/src/kamailio-5.0.2/src' making config... rm -f modules.lst make --no-print-directory modules.lst saving modules list... make[1]: Leaving directory `/usr/src/kamailio-5.0.2/src' make all make -C src/ all make[1]: Entering directory `/usr/src/kamailio-5.0.2/src' CC (gcc) [kamailio] main.o .... LD (gcc) [M db_mysql.so] db_mysql.so CC (gcc) [M acc_radius.so] acc_radius_mod.o In file included from acc_radius_mod.c:44: ../misc_radius/radius.h:43:30: warning: radiusclient-ng.h: No such file or directory acc_radius_mod.c: In function ‘init_acc_rad’:
`
Something has to been done wrong in your system. I tried and works as expected here. Also debian and rpm packaging are using same mechanism and the packages build fine.
Are you sure you don't have other changes done there or something else setting FREERADIUS to 0?
Try to add FREERADIUS=1 to src/Makefile.radius and see if goes ok.
Hello, after cloning from git , i didnt get any error. i will test again with version 5. thanks for support.
Closed #1170.