aboutsummaryrefslogtreecommitdiff
path: root/bbot/agent.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-04-29 15:14:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-04-29 15:14:33 +0200
commit1364413cee696ff60f4dd1e3ac1eb281ac7a4e8f (patch)
treee29faeca957ef381d4c2ccbda67dce90fe3e3e01 /bbot/agent.cxx
parentdb938098044fc5fb76fcdfbec2a28d232028aa51 (diff)
Use fixed TFTP ports for robustness
This way we can cleanup old iptables entries in case or crash/termination
Diffstat (limited to 'bbot/agent.cxx')
-rw-r--r--bbot/agent.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/bbot/agent.cxx b/bbot/agent.cxx
index a40e9e9..7e0021a 100644
--- a/bbot/agent.cxx
+++ b/bbot/agent.cxx
@@ -43,9 +43,9 @@ namespace bbot
const string bs_prot ("1");
- string tc_name;
- size_t tc_num;
- string tc_id;
+ string tc_name;
+ uint16_t tc_num;
+ string tc_id;
string hname;
uid_t uid;
@@ -122,7 +122,8 @@ bootstrap_machine (const dir_path& md,
try_rmfile (mf);
tftp_server tftpd ("Gr ^/?(.+)$ /toolchains/" + tc_name + "/\\1\n" +
- "Pr ^/?(.+)$ /bootstrap/" + tc_name + "/\\1\n");
+ "Pr ^/?(.+)$ /bootstrap/" + tc_name + "/\\1\n",
+ ops.tftp_port () + tc_num);
l3 ([&]{trace << "tftp server on port " << tftpd.port ();});
@@ -582,7 +583,8 @@ try
// Start the TFTP server.
//
tftp_server tftpd ("Gr ^/?(.+)$ /build/" + tc_name + "/get/\\1\n" +
- "Pr ^/?(.+)$ /build/" + tc_name + "/put/\\1\n");
+ "Pr ^/?(.+)$ /build/" + tc_name + "/put/\\1\n",
+ ops.tftp_port () + tc_num);
l3 ([&]{trace << "tftp server on port " << tftpd.port ();});