projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add filtering
[l2tpns.git]
/
radius.c
diff --git
a/radius.c
b/radius.c
index
df3d40b
..
63aeec1
100644
(file)
--- a/
radius.c
+++ b/
radius.c
@@
-1,6
+1,6
@@
// L2TPNS Radius Stuff
// L2TPNS Radius Stuff
-char const *cvs_id_radius = "$Id: radius.c,v 1.1
5 2004-11-27 20:42:02
bodea Exp $";
+char const *cvs_id_radius = "$Id: radius.c,v 1.1
7 2004-11-28 02:53:11
bodea Exp $";
#include <time.h>
#include <stdio.h>
#include <time.h>
#include <stdio.h>
@@
-24,6
+24,7
@@
extern tunnelt *tunnel;
extern u32 sessionid;
extern configt *config;
extern int *radfds;
extern u32 sessionid;
extern configt *config;
extern int *radfds;
+extern ip_filtert *ip_filters;
static const char *radius_state(int state)
{
static const char *radius_state(int state)
{
@@
-545,17
+546,17
@@
void processrad(u8 *buf, int len, char socket_index)
// Filter-Id
char *filter = p + 2;
int l = p[1] - 2;
// Filter-Id
char *filter = p + 2;
int l = p[1] - 2;
- char *s;
+ char *s
uffix
;
u8 *f = 0;
int i;
LOG(3, 0, s, session[s].tunnel, " Radius reply contains Filter-Id \"%.*s\"\n", l, filter);
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 ((s
uffix
= memchr(filter, '.', l)))
{
{
- int b = s - filter;
- if (l - b == 3 && !memcmp("in", s+1, 2))
+ int b = s
uffix
- filter;
+ if (l - b == 3 && !memcmp("in", s
uffix
+1, 2))
f = &session[s].filter_in;
f = &session[s].filter_in;
- else if (l - b == 4 && !memcmp("out", s+1, 3))
+ else if (l - b == 4 && !memcmp("out", s
uffix
+1, 3))
f = &session[s].filter_out;
l = b;
f = &session[s].filter_out;
l = b;
@@
-572,7
+573,9
@@
void processrad(u8 *buf, int len, char socket_index)
!strncmp(ip_filters[i].name, filter, l))
*f = i + 1;
!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");
}
LOG(3, 0, s, session[s].tunnel, " Unknown filter\n");
}