From 37d249273c9dd69b2728728f51b1f158b2da8588 Mon Sep 17 00:00:00 2001 From: Quentin De Coninck Date: Wed, 1 Jul 2020 16:32:41 +0200 Subject: [PATCH] netem consider "loss 0" as an invalid percentage... --- core/topo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/topo.py b/core/topo.py index 22a2aac..f24666e 100644 --- a/core/topo.py +++ b/core/topo.py @@ -278,7 +278,7 @@ class BottleneckLink(object): logging.info(shaping_cmd) self.topo.command_to(self.bs1, shaping_cmd) netem_cmd = self.link_characteristics.build_netem_cmd(bs2_interface_names[-1], - "loss {}".format(self.link_characteristics.loss)) + "loss {}".format(self.link_characteristics.loss) if self.link_characteristics.loss > 0 else "") logging.info(netem_cmd) self.topo.command_to(self.bs2, netem_cmd) @@ -290,7 +290,7 @@ class BottleneckLink(object): logging.info(shaping_cmd) self.topo.command_to(self.bs2, shaping_cmd) netem_cmd = self.link_characteristics.build_netem_cmd(bs1_interface_names[0], - "loss {}".format(self.link_characteristics.loss)) + "loss {}".format(self.link_characteristics.loss) if self.link_characteristics.loss > 0 else "") logging.info(netem_cmd) self.topo.command_to(self.bs1, netem_cmd)