Hello all (TGiF!):
Not yet assimilated the rlm_ippool pseudo-code Paul posted (I haven't
spent much time with it either), but I solved a little flaw in rlm_ippool.
While dumping the contents of the files (so to trace "the strange case
of disappearing IPs"), I noticed that no caller ids were stored.
I did a little patch that fixes it. While it's not very useful
(except for MPP detection, but the latter is proved not to be
working smoothly), at least gives more info about session log.
Jonathan.
--
Jonathan Ruano <kobalt at pobox dot com>
diff -urN org.freeradius-0.8.1/src/modules/rlm_ippool/rlm_ippool.c
new.freeradius-0.8.1/src/modules/rlm_ippool/rlm_ippool.c
--- org.freeradius-0.8.1/src/modules/rlm_ippool/rlm_ippool.c 2002-10-11
15:26:20.000000000 +0200
+++ new.freeradius-0.8.1/src/modules/rlm_ippool/rlm_ippool.c 2003-06-20
17:37:49.000000000 +0200
@@ -67,6 +67,7 @@
#define ALL_ONES 4294967295
#define MAX_NAS_NAME_SIZE 64
+#define MAX_CLI_SIZE 32
static const char rcsid[] = "$Id: rlm_ippool.c,v 1.12 2002/10/11 13:26:20 kkalev Exp
$";
@@ -94,7 +95,7 @@
typedef struct ippool_info {
uint32_t ipaddr;
char active;
- char cli[32];
+ char cli[MAX_CLI_SIZE];
} ippool_info;
typedef struct ippool_key {
@@ -571,6 +572,11 @@
*/
if (key_datum.dptr){
entry.active = 1;
+
+ memset(entry.cli,0,MAX_CLI_SIZE);
+ if (cli != NULL)
+ strncpy( entry.cli, cli, MAX_CLI_SIZE - 1);
+
data_datum.dptr = (ippool_info *) &entry;
data_datum.dsize = sizeof(ippool_info);