Re: pfctl



On Mon, Nov 27, 2006 at 06:03:25PM +0800, Earl Lapus wrote:
hi,

I was browsing through some code and stumbled upon this:

...
if ((opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 0) ||
(opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 0) ||
(opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 0)) {
warnx("m1 must be zero for convex curve: %s", pa->qname);
return (-1);
}
...


would it be safe to change it to:
...
if (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 0) {
warnx("m1 must be zero for convex curve: %s", pa->qname);
return (-1);
}
...

-OR- is there something between those lines that I'm missing.

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 mlaier Exp $

704 if ((opts->rtsc_m1 > 0 && opts->rtsc_m2 == 0) ||
705 (opts->lssc_m1 > 0 && opts->lssc_m2 == 0) ||
706 (opts->ulsc_m1 > 0 && opts->ulsc_m2 == 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 != 0) ||
712 (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 0) ||
713 (opts->rtsc_m1 < opts->rtsc_m2 && opts->rtsc_m1 != 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.

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

Attachment: pgpHFxh50TSU3.pgp
Description: PGP signature



Relevant Pages