Issue with a new module and radiusd: symbol lookup error
aland at deployingradius.com
Tue Sep 23 16:59:29 CEST 2008
Luca Adamo wrote:
> my goal is to implement a module compliant with the Wimax Forum for what
> concerns authentication and authorization of supplicants. For this
> reason I needed to access the database where I store the various
> root-key (I mean DHCP-RK, and MIP-RK) as well as all the other
> keying-related items needed by the WF St.3. My module so have to
> interact with MySQL, and with OpenSSL (for key-gen) and operate both in
> postauth and in authorize (to handle request coming from unconventional
> NAS such as DHCP-Servers or Home Agents asking for keys).
See recent "git". src/modules/rlm_wimax/rlm_wimax.c, and
raddb/modules/wimax. The dynamic key generation has been done as part
of ongoing WiMAX work.
I'd like to thank the (un-named) sponsors for their efforts in helping
to make this happen. :)
The code has been tested with a number of vendor's equipment, but more
testing would be useful.
> I found it simpler at the beginning to write down a new module (please
> note that we started our development when the current version of
> FreeRADIUS was 2.0.4...i.e. no rlm_wimax module was present) instead of
> getting one of the other working properly. I think that youìre right
> when you say that the code of sql_init_socketpool is missing from my
> module and this can also explain why it works only in postauth.
IMHO, WiMAX key generation belongs in a separate module, and not in
any existing module.
> In my opinion when the sql module is called (for example during
> authentication) it creates the symbols it needs (among them
> sql_init_socketpool). But if I try to call my module before sql (i.e. at
> the beginning of authorize) the symbols are missing and the symbol
> lookup error occurs. Am i right?
Yes. You are relying on it *accidentally* working. There's no need
to do this. Just use the rlm_sqlippool example to create custom
behavior, without re-writing rlm-sql.
> I'll try to follow your guideline and to look at the existent modules.
> My schema is the default one with a bunch of tables used for WiMAX
> dynamic keys. I mean that the original structure is conserved and that
> I'm using the header file and the conf.h file to "load" the queries.
> Anyway if you need the schema I'll mail to you.
See raddb/sql/mysql/wimax* in the recent "git" tree. There are
example files to manage the WiMAX dynamic MIP keys.
> Pasting the sql_init_socketpool() in my module simply shift the "symbol
> lookup error" on the following symbol. It seems I have to paste into my
> module half sql.c and I don't want to do that since you're right when u
> say that it is pointless to rewrite sql.c.
Stop fighting with it. The rlm_sqlippool module *already* leverages
the SQL module, without copying half of that module. And rlm_sqlippool
a LOT simpler than rlm_sql, too.
More information about the Freeradius-Devel