// L2TPNS Radius Stuff
-char const *cvs_id_radius = "$Id: radius.c,v 1.15 2004-11-27 20:42:02 bodea Exp $";
+char const *cvs_id_radius = "$Id: radius.c,v 1.17 2004-11-28 02:53:11 bodea Exp $";
#include <time.h>
#include <stdio.h>
extern u32 sessionid;
extern configt *config;
extern int *radfds;
+extern ip_filtert *ip_filters;
static const char *radius_state(int state)
{
// Filter-Id
char *filter = p + 2;
int l = p[1] - 2;
- char *s;
+ char *suffix;
u8 *f = 0;
int i;
LOG(3, 0, s, session[s].tunnel, " Radius reply contains Filter-Id \"%.*s\"\n", l, filter);
- if ((s = memchr(filter, '.', l)))
+ if ((suffix = memchr(filter, '.', l)))
{
- int b = s - filter;
- if (l - b == 3 && !memcmp("in", s+1, 2))
+ int b = suffix - filter;
+ if (l - b == 3 && !memcmp("in", suffix+1, 2))
f = &session[s].filter_in;
- else if (l - b == 4 && !memcmp("out", s+1, 3))
+ else if (l - b == 4 && !memcmp("out", suffix+1, 3))
f = &session[s].filter_out;
l = b;
!strncmp(ip_filters[i].name, filter, l))
*f = i + 1;
- if (!*f)
+ if (*f)
+ ip_filters[*f - 1].used++;
+ else
LOG(3, 0, s, session[s].tunnel, " Unknown filter\n");
}