diff options
author | brian <brian@FreeBSD.org> | 1997-11-12 21:04:21 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-12 21:04:21 +0000 |
commit | 68d89b19d4172e0605feb73e4248bc41aec9a5f9 (patch) | |
tree | d0610be3f69921901c3e87d1f1c04141d992ba94 /usr.sbin/ppp | |
parent | 1a846301b5cf6c9523ffe5070b7ce4ce4b217580 (diff) | |
download | FreeBSD-src-68d89b19d4172e0605feb73e4248bc41aec9a5f9.zip FreeBSD-src-68d89b19d4172e0605feb73e4248bc41aec9a5f9.tar.gz |
Understand networks in the filter rules. We don't
insist on x.x.x.0/24 - x.x.x.x/24 is ok too.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r-- | usr.sbin/ppp/ip.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c index c1c9484..0fcddf9 100644 --- a/usr.sbin/ppp/ip.c +++ b/usr.sbin/ppp/ip.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: ip.c,v 1.27 1997/10/26 12:42:10 brian Exp $ + * $Id: ip.c,v 1.28 1997/11/12 19:48:45 brian Exp $ * * TODO: * o Return ICMP message for filterd packet @@ -164,8 +164,10 @@ FilterCheck(struct ip * pip, int direction) return (A_PERMIT); } LogPrintf(LogDEBUG, "rule = %d\n", n); - if ((pip->ip_src.s_addr & fp->smask.s_addr) == fp->saddr.s_addr - && (pip->ip_dst.s_addr & fp->dmask.s_addr) == fp->daddr.s_addr) { + if ((pip->ip_src.s_addr & fp->smask.s_addr) == + (fp->saddr.s_addr & fp->smask.s_addr) && + (pip->ip_dst.s_addr & fp->dmask.s_addr) == + (fp->daddr.s_addr & fp->dmask.s_addr)) { if (fp->proto) { if (!gotinfo) { ptop = (char *) pip + (pip->ip_hl << 2); |