fix netem 0% loss and duplicate issue
This commit is contained in:
parent
67a78828c3
commit
aa6b83f29b
2 changed files with 4 additions and 4 deletions
|
@ -248,10 +248,10 @@ class OvsNet(PyCoreNet):
|
||||||
if jitter is not None:
|
if jitter is not None:
|
||||||
netem += ["%sus" % jitter, "25%"]
|
netem += ["%sus" % jitter, "25%"]
|
||||||
|
|
||||||
if loss is not None:
|
if loss is not None and loss > 0:
|
||||||
netem += ["loss", "%s%%" % min(loss, 100)]
|
netem += ["loss", "%s%%" % min(loss, 100)]
|
||||||
|
|
||||||
if duplicate is not None:
|
if duplicate is not None and duplicate > 0:
|
||||||
netem += ["duplicate", "%s%%" % min(duplicate, 100)]
|
netem += ["duplicate", "%s%%" % min(duplicate, 100)]
|
||||||
|
|
||||||
if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0:
|
if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0:
|
||||||
|
|
|
@ -475,9 +475,9 @@ class LxBrNet(PyCoreNet):
|
||||||
else:
|
else:
|
||||||
netem += ["%sus" % jitter, "25%"]
|
netem += ["%sus" % jitter, "25%"]
|
||||||
|
|
||||||
if loss is not None:
|
if loss is not None and loss > 0:
|
||||||
netem += ["loss", "%s%%" % min(loss, 100)]
|
netem += ["loss", "%s%%" % min(loss, 100)]
|
||||||
if duplicate is not None:
|
if duplicate is not None and duplicate > 0:
|
||||||
netem += ["duplicate", "%s%%" % min(duplicate, 100)]
|
netem += ["duplicate", "%s%%" % min(duplicate, 100)]
|
||||||
if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0:
|
if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0:
|
||||||
# possibly remove netem if it exists and parent queue wasn't removed
|
# possibly remove netem if it exists and parent queue wasn't removed
|
||||||
|
|
Loading…
Add table
Reference in a new issue