From ce9c2a594d64b403495f8824fe16dfc952a99531 Mon Sep 17 00:00:00 2001 From: Harald Seiler Date: Thu, 14 May 2020 10:37:05 +0200 Subject: 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 --- lavalab-gen.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lavalab-gen.py') 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"] -- cgit 1.2.3-korg