diff options
author | Othmar Gsenger <otti@anytun.org> | 2007-12-09 13:46:35 +0000 |
---|---|---|
committer | Othmar Gsenger <otti@anytun.org> | 2007-12-09 13:46:35 +0000 |
commit | 668c0e854579226be03896176af0d5485a084100 (patch) | |
tree | a0197664b7f4a8cae4a4c696b76f25438839632f | |
parent | code clean up (diff) |
added dynamic ip support
added comments
-rw-r--r-- | anytun.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -227,19 +227,29 @@ void* receiver(void* p) // autodetect peer - // TODO fixme, IP might change!!! // TODO check auth tag first + // this should be done by keymanagement anyway if(param->opt.getRemoteAddr() == "" && param->cl.empty()) { createConnection(remote_host, remote_port, param->cl,param->opt.getSeqWindowSize()); cLog.msg(Log::PRIO_NOTICE) << "autodetected remote host " << remote_host << ":" << remote_port; } + //TODO Add multi connection support here ConnectionParam conn = param->cl.getConnection(); if (!checkPacketAuthTag(pack, c, conn)) continue; + //Allow dynamic IP changes + //TODO add command line option to turn this off + if (remote_host != conn.remote_host_ || remote_port != conn.remote_port_) + { + conn.remote_host_=remote_host; + conn.remote_port_=remote_port; + } + + //Replay Protection if (!checkPacketSeqNr(pack,conn)) continue; pack.removeHeader(); |