// L2TPNS Radius Stuff
-char const *cvs_id_radius = "$Id: radius.c,v 1.11 2004-11-05 04:55:27 bodea Exp $";
+char const *cvs_id_radius = "$Id: radius.c,v 1.13 2004-11-25 02:45:27 bodea Exp $";
#include <time.h>
#include <stdio.h>
extern struct configt *config;
extern int *radfds;
-const char *radius_state(int state)
+static const char *radius_state(int state)
{
static char *tmp = NULL;
int i;
for (i = 0; i < config->num_radfds; i++)
{
int flags;
- if (!radfds[i]) radfds[i] = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ radfds[i] = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
flags = fcntl(radfds[i], F_GETFL, 0);
fcntl(radfds[i], F_SETFL, flags | O_NONBLOCK);
}
{
// CHAP
u8 *p = makeppp(b, sizeof(b), 0, 0, t, s, PPPCHAP);
- if (!p) {
- return; // Abort!
- }
+ if (!p) return; // Abort!
+
{
struct param_post_auth packet = { &tunnel[t], &session[s], session[s].user, (*buf == 2), PPPCHAP };
run_plugins(PLUGIN_POST_AUTH, &packet);
{
// PAP
u8 *p = makeppp(b, sizeof(b), 0, 0, t, s, PPPPAP);
- if (!p)
- return; // Abort!
+ if (!p) return; // Abort!
{
struct param_post_auth packet = { &tunnel[t], &session[s], session[s].user, (*buf == 2), PPPPAP };
break;
}
}
-
-void radius_clean()
-{
- int i;
-
- LOG(1, 0, 0, 0, "Cleaning radius session array\n");
-
- for (i = 1; i < MAXRADIUS; i++)
- {
- if (radius[i].retry == 0
- || !session[radius[i].session].opened
- || session[radius[i].session].die
- || session[radius[i].session].tunnel == 0)
- radiusclear(i, radius[i].session);
- }
-}