rlm_sqlippool

Alan DeKok aland at deployingradius.com
Thu Aug 17 23:43:25 CEST 2006


Peter Nixon <listuser at peternixon.net> wrote:
> Heh. Thanks. It fits in nicely with the rest of my plan to take over the
> world :-)

  Sounds good to me.

> We have the this code in production and it seems to be solid so far. 

  Comments: over-writing data->pool_name, even with a mutex lock, is a
bad idea.  Get rid of the mutex lock, and when decoding 'P', do:

...
  case 'P':
       {
	  const char *x = data->pool_name;
	  VALUE_PAIR *vp = pairfind(request->config_items, PW_POOL_NAME);
	  if (vp) x = data->strvalue;
	  strNcpy(q, x, freespace);
	  q + strlen(q);
       }
...

  That *should* work, once you add "REQUEST *request" to the function
arguments.

  Other than that, I've poked it to build in the CVS head, and
committed it there.  It's untested, though.

  Some comments: add a "user key" field to the table, which is a
unique per-use key.  e.g. MAC address, username, etc.  When
allocating, do a SELECT on the key first, and an entry exists that's
marked unused, allocate it.

  The key will also help for accounting packets, too.

  Alan DeKok.
--
  http://deployingradius.com       - The web site of the book
  http://deployingradius.com/blog/ - The blog



More information about the Freeradius-Devel mailing list