summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2007-12-09 13:46:35 +0000
committerOthmar Gsenger <otti@anytun.org>2007-12-09 13:46:35 +0000
commit668c0e854579226be03896176af0d5485a084100 (patch)
treea0197664b7f4a8cae4a4c696b76f25438839632f
parentcode clean up (diff)
added dynamic ip support
added comments
-rw-r--r--anytun.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/anytun.cpp b/anytun.cpp
index 6c103b4..c3e3be2 100644
--- a/anytun.cpp
+++ b/anytun.cpp
@@ -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();