diff options
author | Christian Pointner <equinox@anytun.org> | 2007-06-21 17:32:14 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2007-06-21 17:32:14 +0000 |
commit | ca78a99ef24f205880bb78ce8d6091be6c27bb1d (patch) | |
tree | c4d53dc692a814c37b8c791af49167f514839894 /anytun.cpp | |
parent | added options parser (diff) |
added remote host auto detection
Diffstat (limited to 'anytun.cpp')
-rw-r--r-- | anytun.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -68,6 +68,9 @@ void* sender(void* p) int len = param->dev->read(pack); pack.resizeBack(len); + if(param->opt->getRemoteAddr() == "") + continue; + // add payload type if(param->dev->getType() == TunDevice::TYPE_TUN) pack.addPayloadType(PAYLOAD_TYPE_TUN); @@ -111,10 +114,14 @@ void* receiver(void* p) pack.removeAuthTag(); if(at != param->a->calc(pack)) continue; + + // autodetect peer + if(param->opt->getRemoteAddr() == "") + param->opt->setRemoteAddrPort(remote_host, remote_port); // compare sender_id and seq with window pack.removeHeader(); - + // decypher the packet param->c->cypher(pack); |