diff options
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r-- | src/anytun.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp index ba1a6ab..bdb7a5d 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -94,15 +94,18 @@ void createConnection(const PacketSourceEndpoint & remote_end, ConnectionList & ConnectionParam connparam ( (*kd), (*seq), seq_nr_, remote_end); cl.addConnection(connparam,mux); -#ifndef NOROUTING - NetworkAddress addr(ipv4,gOpt.getIfconfigParamRemoteNetmask().c_str()); - NetworkPrefix prefix(addr,32); - gRoutingTable.addRoute(prefix,mux); -#endif SyncCommand sc (cl,mux); queue.push(sc); - SyncCommand sc2 (prefix); - queue.push(sc2); +#ifndef NOROUTING + if (gOpt.getIfconfigParamRemoteNetmask() != "") + { + NetworkAddress addr(gOpt.getIfconfigParamRemoteNetmask()); + NetworkPrefix prefix(addr,32); + gRoutingTable.addRoute(prefix,mux); + SyncCommand sc2 (prefix); + queue.push(sc2); + } +#endif } bool checkPacketSeqNr(EncryptedPacket& pack,ConnectionParam& conn) |