aboutsummaryrefslogtreecommitdiffstats
path: root/lavalab-gen.py
diff options
context:
space:
mode:
authorHarald Seiler <hws@denx.de>2020-05-14 10:37:05 +0200
committerHarald Seiler <hws@denx.de>2020-05-20 10:03:08 +0200
commitce9c2a594d64b403495f8824fe16dfc952a99531 (patch)
treedd8a73d805c15b6f52194680344775034c957c7c /lavalab-gen.py
parent9596a7d56f8e4b6653ae1735075b3fc95b268fe9 (diff)
Make docker bind the TFTP server to the correct interface
With UDP, docker sometimes can't route UDP packets to the correct address because the source address gets mangled [1]. This happens indeterministically because by default the kernel uses some heuristics to decide which interface to use. But in some rare circumstances, those can fail and a wrong source address is used. This can be worked around by explicitly binding to a concrete interface instead of 0.0.0.0. [1]: https://github.com/moby/libnetwork/issues/1729 Signed-off-by: Harald Seiler <hws@denx.de>
Diffstat (limited to 'lavalab-gen.py')
-rwxr-xr-xlavalab-gen.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 96d25c1..19f76c0 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -558,7 +558,10 @@ def main():
if "use_tftp" in worker:
use_tftp = worker["use_tftp"]
if use_tftp:
- dockcomp["services"][name]["ports"].append("69:69/udp")
+ if "dispatcher_ip" in worker:
+ dockcomp["services"][name]["ports"].append(worker["dispatcher_ip"] + ":69:69/udp")
+ else:
+ dockcomp["services"][name]["ports"].append("69:69/udp")
use_docker = False
if "use_docker" in worker:
use_docker = worker["use_docker"]