From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 27 12:52:54 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2EF0816A412; Mon, 27 Nov 2006 12:52:54 +0000 (UTC) (envelope-from vd@datamax.bg) Received: from jengal.datamax.bg (jengal.datamax.bg [82.103.104.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68B6C43D75; Mon, 27 Nov 2006 12:49:23 +0000 (GMT) (envelope-from vd@datamax.bg) Received: from qlovarnika.bg.datamax (qlovarnika.bg.datamax [192.168.10.2]) by jengal.datamax.bg (Postfix) with SMTP id 7A0C3B833; Mon, 27 Nov 2006 14:50:22 +0200 (EET) Received: (nullmailer pid 5731 invoked by uid 1002); Mon, 27 Nov 2006 12:50:22 -0000 Date: Mon, 27 Nov 2006 14:50:22 +0200 From: Vasil Dimov To: Earl Lapus Message-ID: <20061127125022.GA5690@qlovarnika.bg.datamax> References: <604f76120611270203n3d065114vdbe8487cc04357e1@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <604f76120611270203n3d065114vdbe8487cc04357e1@mail.gmail.com> Cc: freebsd-hackers@freebsd.org, henning@openbsd.org, mlaier@freebsd.org Subject: Re: pfctl X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vd@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2006 12:52:54 -0000 --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 27, 2006 at 06:03:25PM +0800, Earl Lapus wrote: > hi, >=20 > I was browsing through some code and stumbled upon this: >=20 > ... > if ((opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0) || > (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0) || > (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0)) { > warnx("m1 must be zero for convex curve: %s", pa->qname); > return (-1); > } > ... >=20 >=20 > would it be safe to change it to: > ... > if (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0) { > warnx("m1 must be zero for convex curve: %s", pa->qname); > return (-1); > } > ... >=20 > -OR- is there something between those lines that I'm missing. >=20 > The piece of code that I'm referring to is found in > /usr/src/contrtib/pf/pfctl/pfctl_altq.c /usr/src/contrib/pf/pfctl/pfctl_altq.c $OpenBSD: pfctl_altq.c,v 1.86 2005/02/28 14:04:51 henning Exp $ $FreeBSD: src/contrib/pf/pfctl/pfctl_altq.c,v 1.7 2005/05/03 16:55:20 mlaie= r Exp $ 704 if ((opts->rtsc_m1 > 0 && opts->rtsc_m2 =3D=3D 0) || 705 (opts->lssc_m1 > 0 && opts->lssc_m2 =3D=3D 0) || 706 (opts->ulsc_m1 > 0 && opts->ulsc_m2 =3D=3D 0)) { 707 warnx("m2 is zero for %s", pa->qname); 708 return (-1); 709 } 710 711 if ((opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0) || 712 (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0) || 713 (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 !=3D 0)) { 714 warnx("m1 must be zero for convex curve: %s", pa->qname= ); 715 return (-1); 716 } Seems like a bug to me. Maybe rtsc should be changed to lssc and ulsc respectively on 712 and 713 line. --=20 Vasil Dimov gro.DSBeerF@dv % I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this. -- Emo Phillips --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- iD8DBQFFat8OFw6SP/bBpCARAlOtAKC/yYklb5tvgY58YHKXvNONy8KvVQCgjviS VETDB27RCb4KRZu5ki0FWzs= =QMRc -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--