From owner-freebsd-bugs Sun Feb 19 18:29:20 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id SAA24291 for bugs-outgoing; Sun, 19 Feb 1995 18:29:20 -0800 Received: from post.demon.co.uk (post.demon.co.uk [158.152.1.72]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id SAA24282 for ; Sun, 19 Feb 1995 18:29:15 -0800 Received: from pencotts.demon.co.uk by post.demon.co.uk id aa01529; 20 Feb 95 0:23 GMT Received: (from root@localhost) by pencotts.demon.co.uk (8.6.9/8.6.6) id AAA05771 for bugs@freebsd.org; Mon, 20 Feb 1995 00:21:52 GMT From: Andrew.Gordon@net-tel.co.uk X400-Received: by mta "eldorado" in "/PRMD=net-tel/ADMD=gold 400/C=gb/"; Relayed; Mon, 20 Feb 95 0:20:59 +0000 X400-Received: by mta "net-tel cambridge" in "/PRMD=net-tel/ADMD=gold 400/C=gb/"; Relayed; Mon, 20 Feb 95 0:20:56 +0000 X400-Received: by "/PRMD=NET-TEL/ADMD=Gold 400/C=GB/"; Relayed; Mon, 20 Feb 95 0:20:56 +0000 X400-MTS-Identifier: ["/PRMD=NET-TEL/ADMD=Gold 400/C=GB/";hst:298-950220002056-7FAC] X400-Content-Type: P2-1984 (2) X400-Originator: Andrew.Gordon@net-tel.co.uk Original-Encoded-Information-Types: IA5-Text X400-Recipients: bugs@freebsd.org Date: Mon, 20 Feb 95 0:20:56 +0000 Content-Identifier: Bug in ppp packe Message-Id: <"MAC-950220002210-359B*/G=Andrew/S=Gordon/O=Net-Tel Computer Systems Ltd/PRMD=Net-Tel/ADMD=Gold 400/C=GB/"@MHS> To: bugs@FreeBSD.org Subject: Bug in ppp packet filter (and fix!) Sender: bugs-owner@FreeBSD.org Precedence: bulk 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].