diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-03 11:30:11 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-03 11:30:11 +0200 |
| commit | 7ff1a129dbf3151b9c067544449f9e69a4bc80a2 (patch) | |
| tree | 12e99ae114f02f8f6ba723dbdb38ade46398497d | |
| parent | a597b6b91eee353bbf6a8776a7889c2f9f70d6d9 (diff) | |
Ensure sender node is not the receiver on wired communications
| -rw-r--r-- | esds/simulator.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/esds/simulator.py b/esds/simulator.py index 30534de..cdc85d3 100644 --- a/esds/simulator.py +++ b/esds/simulator.py @@ -331,6 +331,9 @@ class Simulator: if interface not in self.nodes[dst]["interfaces"]: self.log("Cannot create communication from node "+str(src)+ " to "+str(dst)+", interface "+interface+" not available on node "+str(dst)) exit(1) + elif src==dst: + self.log("Cannot create communication from node "+str(src)+ " to "+str(dst)+" on interface "+interface+", receiver node cannot be the sender") + exit(1) self.log("Send "+str(datasize)+" bytes to n"+str(dst)+" on "+interface,node=nsrc) if not self.nodes[dst]["turned_on"] and receiver_required: return(False) |
