diff --git a/daemon/core/emulator/coreemu.py b/daemon/core/emulator/coreemu.py index 6712227c..8fa6ffb9 100644 --- a/daemon/core/emulator/coreemu.py +++ b/daemon/core/emulator/coreemu.py @@ -378,7 +378,7 @@ class EmuSession(Session): if node_two: node_two.lock.release() - def update_link(self, node_one_id, node_two_id, link_options, interface_one_id=None, interface_two_id=None): + def update_link(self, node_one_id, node_two_id, interface_one_id=None, interface_two_id=None, link_options=LinkOptions()): """ Update link information between nodes. diff --git a/daemon/core/netns/openvswitch.py b/daemon/core/netns/openvswitch.py index 341ab92a..46ba2f2c 100644 --- a/daemon/core/netns/openvswitch.py +++ b/daemon/core/netns/openvswitch.py @@ -248,10 +248,10 @@ class OvsNet(PyCoreNet): if jitter is not None: netem += ["%sus" % jitter, "25%"] - if loss is not None: + if loss is not None and loss > 0: 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)] if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0: diff --git a/daemon/core/netns/vnet.py b/daemon/core/netns/vnet.py index 545ca648..7a517d08 100644 --- a/daemon/core/netns/vnet.py +++ b/daemon/core/netns/vnet.py @@ -475,9 +475,9 @@ class LxBrNet(PyCoreNet): else: netem += ["%sus" % jitter, "25%"] - if loss is not None: + if loss is not None and loss > 0: 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)] if delay <= 0 and jitter <= 0 and loss <= 0 and duplicate <= 0: # possibly remove netem if it exists and parent queue wasn't removed