Re: pfctl
- From: Vasil Dimov <vd@xxxxxxxxxxx>
- Date: Mon, 27 Nov 2006 14:50:22 +0200
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
- Follow-Ups:
- Re: pfctl
- From: Henning Brauer
- Re: pfctl
- References:
- pfctl
- From: Earl Lapus
- pfctl
- Prev by Date: vn_fullpath question.
- Next by Date: Re: pfctl
- Previous by thread: pfctl
- Next by thread: Re: pfctl
- Index(es):
Relevant Pages
- Re: Scripted series this summer?
... Watching MTV rots your brain (and your morals), ... So it's safe
for Ubiquitous then. ... Yeah, I'd be voting Democrat and getting my news from Michael
Moore ... (rec.arts.tv) - Re: Scripted series this summer?
... Watching MTV rots your brain (and your morals), ... So it's safe
for Ubiquitous then. ... Yeah, I'd be voting Democrat and getting my news from Michael
Moore ... (rec.arts.tv) - Re: Circuit that produces a tingling sensation in the fingers.
... or too strong to be safe. ... > of an ICU, with trained medical personnel
controlling the apparatus, ... There is a big margin between what can be sensed by
the skin and what ... But, of course you need to have a brain to do anything with electricity,
... (sci.electronics.basics) - Re: safe electronic brain stimulator
... can this device be made safe and still be effective? ... > To safely stimulate
my brain, ... (sci.electronics.design) - safe-module and namespaces
... I try to use the safe-module to evaluate user-provided code, but it seems there is
a knot in my brain. ... use Safe; ... (comp.lang.perl.misc)