Date: Mon, 20 Feb 95 0:20:56 +0000 From: Andrew.Gordon@net-tel.co.uk To: bugs@FreeBSD.org Subject: Bug in ppp packet filter (and fix!) Message-ID: <"MAC-950220002210-359B*/G=Andrew/S=Gordon/O=Net-Tel Computer Systems Ltd/PRMD=Net-Tel/ADMD=Gold 400/C=GB/"@MHS>
next in thread | raw e-mail | index | archive | help
Bug in: /usr/sbin/ppp
Version: SNAP-950210, and source of about 2 days ago
Detail: The 'set ifilter'/'set ofilter' commands accept a syntax containing
IP addresses and/or protocol+port, but in the case where both are
supplied, it happily accepts the command but ignores the proto+port
It also attempts to handle the case where the second IP address
is omitted, but this doesn't work.
Fix:
In src/usr.sbin/ppp/filter.c:
*** filter.c.old Sun Feb 19 22:37:05 1995
--- filter.c Sun Feb 19 22:44:11 1995
***************
*** 317,321 ****
}
! fp->proto = proto = ParseProto(argc, argv);
if (proto == P_NONE) {
if (ParseAddr(argc, argv, &fp->saddr, &fp->smask, &fp->swidth)) {
--- 317,321 ----
}
! proto = ParseProto(argc, argv);
if (proto == P_NONE) {
if (ParseAddr(argc, argv, &fp->saddr, &fp->smask, &fp->swidth)) {
***************
*** 327,333 ****
}
proto = ParseProto(argc, argv);
! if (proto) {
! argc--; argv++;
! }
}
} else {
--- 327,333 ----
}
proto = ParseProto(argc, argv);
! }
! if (proto) {
! argc--; argv++;
}
} else {
***************
*** 340,343 ****
--- 340,344 ----
val = 1;
+ fp->proto = proto;
switch (proto) {
***************
*** 353,357 ****
}
[The key change is the extra line fp->proto = proto; - the rest is just
cleaning up].
