Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2006 14:50:22 +0200
From:      Vasil Dimov <vd@FreeBSD.org>
To:        Earl Lapus <earl.lapus@gmail.com>
Cc:        freebsd-hackers@freebsd.org, henning@openbsd.org, mlaier@freebsd.org
Subject:   Re: pfctl
Message-ID:  <20061127125022.GA5690@qlovarnika.bg.datamax>
In-Reply-To: <604f76120611270203n3d065114vdbe8487cc04357e1@mail.gmail.com>
References:  <604f76120611270203n3d065114vdbe8487cc04357e1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061127125022.GA5690>