]> git.proxmox.com Git - mirror_iproute2.git/commit - tc/q_netem.c
tc/netem: loss gemodel options fixes
authorJay Vosburgh <jay.vosburgh@canonical.com>
Sat, 10 May 2014 20:34:58 +0000 (13:34 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 4 Aug 2014 17:15:10 +0000 (10:15 -0700)
commit3757185b29bba37943107ce49c21553054023f44
tree3bf16044eaaead5b6322a3d6f664c630006c7d43
parentaeb14eb0b2649ae6048b9cc0a10152079035ee92
tc/netem: loss gemodel options fixes

First, the default value for 1-k is documented as being 0, but is
currently being set to 1. (100%).  This causes all packets to be dropped
in the good state if 1-k is not explicitly specified.  Fix this by setting
the default to 0.

Second, the 1-h option is parsed correctly, however, the kernel is
expecting "h", not 1-h.  Fix this by inverting the "1-h" percentage before
sending to and after receiving from the kernel.  This does change the
behavior, but makes it consistent with the netem documentation and the
literature on the Gilbert-Elliot model, which refer to "1-h" and "1-k,"
not "h" or "k" directly.

Last, fix a minor formatting issue for the options reporting.

Signed-off-by: Jay Vosburgh <jay.vosburgh@canonical.com>
tc/q_netem.c