diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-29 15:14:33 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-04-29 15:14:33 +0200 |
commit | 1364413cee696ff60f4dd1e3ac1eb281ac7a4e8f (patch) | |
tree | e29faeca957ef381d4c2ccbda67dce90fe3e3e01 /bbot/tftp.cxx | |
parent | db938098044fc5fb76fcdfbec2a28d232028aa51 (diff) |
Use fixed TFTP ports for robustness
This way we can cleanup old iptables entries in case or crash/termination
Diffstat (limited to 'bbot/tftp.cxx')
-rw-r--r-- | bbot/tftp.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bbot/tftp.cxx b/bbot/tftp.cxx index 3304356..862a0e4 100644 --- a/bbot/tftp.cxx +++ b/bbot/tftp.cxx @@ -19,7 +19,7 @@ using namespace butl; namespace bbot { tftp_server:: - tftp_server (const string& map) + tftp_server (const string& map, uint16_t port) { int fd (socket (AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0)); @@ -34,7 +34,7 @@ namespace bbot memset (&addr, 0, sizeof (addr)); addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl (INADDR_ANY); - addr.sin_port = htons (0); + addr.sin_port = htons (port); // Not to confuse with std::bind(). // |