add filtering

This commit is contained in:
Brendan O'Dea 2004-11-28 20:09:52 +00:00
parent 6d5c3ecb4d
commit 80308e8838
6 changed files with 130 additions and 16 deletions

6
ppp.c
View file

@ -1,6 +1,6 @@
// L2TPNS PPP Stuff
char const *cvs_id_ppp = "$Id: ppp.c,v 1.31 2004-11-27 05:19:53 bodea Exp $";
char const *cvs_id_ppp = "$Id: ppp.c,v 1.32 2004-11-28 20:10:04 bodea Exp $";
#include <stdio.h>
#include <string.h>
@ -719,6 +719,10 @@ void processipin(tunnelidt t, sessionidt s, u8 *p, u16 l)
return;
}
// run access-list if any
if (session[s].filter_in && !ip_filter(p, l, session[s].filter_in - 1))
return;
// Add on the tun header
p -= 4;
*(u32 *)p = htonl(0x00000800);