pfctl

Earl Lapus earl.lapus at gmail.com
Tue Nov 28 05:37:22 UTC 2006


hi all, another quick question...

I read that realtime must always be convex. That explains the checking.
However, linkshare and upperlimit can be either concave or convex.

If linkshare(lssc_xx) can be concave then we should allow lssc_m1 to be
less than lssc_m2 even if lssc_m1 is greater than zero. And this also applies
to upperlimit (ulsc_xx). Is this correct?



On 11/27/06, Henning Brauer <henning at openbsd.org> wrote:
> * Vasil Dimov <vd at FreeBSD.org> [2006-11-27 15:13]:
> > > 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);
> > > }
>
> > Seems like a bug to me. Maybe rtsc should be changed to lssc and ulsc
> > respectively on 712 and 713 line.
>
> indeed.
> 1.24         (henning  17-Dec-02):      if ((opts->rtsc_m1 > 0 && opts->rtsc_m2 == 0) ||
> 1.24         (henning  17-Dec-02):          (opts->lssc_m1 > 0 && opts->lssc_m2 == 0) ||
> 1.24         (henning  17-Dec-02):          (opts->ulsc_m1 > 0 && opts->ulsc_m2 == 0)) {
>
> almost 4 years, and nobody noticed ;(
>
> Index: pfctl_altq.c
> ===================================================================
> RCS file: /cvs/src/sbin/pfctl/pfctl_altq.c,v
> retrieving revision 1.90
> diff -u -p -r1.90 pfctl_altq.c
> --- pfctl_altq.c        10 Nov 2006 06:07:11 -0000      1.90
> +++ pfctl_altq.c        27 Nov 2006 14:19:45 -0000
> @@ -680,8 +680,8 @@ eval_pfqueue_hfsc(struct pfctl *pf, stru
>         }
>
>         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)) {
> +           (opts->lssc_m1 < opts->lssc_m2 && opts->lssc_m1 != 0) ||
> +           (opts->ulsc_m1 < opts->ulsc_m2 && opts->ulsc_m1 != 0)) {
>                 warnx("m1 must be zero for convex curve: %s", pa->qname);
>                 return (-1);
>         }
>
>
>
>


-- 
There are seven words in this sentence.


More information about the freebsd-hackers mailing list