Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 May 2014 00:19:15 +0800
From:      "bycn82" <bycn82@gmail.com>
To:        "Alexander V. Chernikov" <melifaro@freebsd.org>, "Luigi Rizzo" <luigi@FreeBSD.org>
Cc:        FreeBSD Net <net@FreeBSD.org>
Subject:   a defect in ipfw dummynet
Message-ID:  <000f01cf776b$ea602810$bf207830$@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi Alexander,

=20

Since you guys are working on the =E2=80=9Cnamed table=E2=80=9D feature. =
So I have stopped implementing it using my way. Hence I got some time to =
read more about the existing codes.  This afternoon I just started to =
read the dummynet part, then I have another question to ask. Maybe it is =
not a small defect, Or just because there are some more story which I =
don=E2=80=99t know.  anyway.

=20

For example,

when we run command as below,=20

>ipfw pipe config 1 100kbps

the userspace program need to read the bandwidth value which is =
=E2=80=9C100kbps=E2=80=9D, And I found the code as below,=20

                if ((*end =3D=3D 'B' &&

                                _substrcmp2(end, "Bi", "Bit/s") !=3D 0) =
||

                                _substrcmp2(end, "by", "bytes") =3D=3D =
0)

                                bw *=3D 8;

=20

Sure it works. But I want to ask  whether it can be more readable If we =
list down all the possibilities and directly =E2=80=9Chard code=E2=80=9D =
in the source, At least it can be more accurate.=20

=20

With current logic, we have change to  have below situation.

=20

root@FB10Head:~ # ipfw pipe config 1 bw 1ByeBye                    <- =
the command will be considered as =E2=80=9C1 Byte per second=E2=80=9D

root@FB10Head:~ # ipfw pipe 1 show

00001:   8.000 bit/s     0 ms burst 0=20

q131073  50 sl. 0 flows (1 buckets) sched 65537 weight 0 lmax 0 pri 0 =
droptail

sched 65537 type FIFO flags 0x0 0 buckets 0 active

root@FB10Head:~ #

=20

=20

=20

=20

=20

Best Regards,

Bycn82

=20




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000f01cf776b$ea602810$bf207830$>