summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--anyctr.cpp2
-rw-r--r--networkPrefix.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/anyctr.cpp b/anyctr.cpp
index df699d1..2e4e9c2 100644
--- a/anyctr.cpp
+++ b/anyctr.cpp
@@ -64,6 +64,8 @@ void createConnection(const std::string & remote_host, u_int16_t remote_port, Co
cl.addConnection( connparam, mux );
NetworkAddress addr( ipv4, gOpt.getIfconfigParamRemoteNetmask().c_str() );
NetworkPrefix prefix( addr );
+ // TODO configurierbar machen!!!
+ prefix.setNetworkPrefixLength(32);
gRoutingTable.addRoute( prefix, mux );
std::ostringstream sout;
boost::archive::text_oarchive oa( sout );
diff --git a/networkPrefix.cpp b/networkPrefix.cpp
index ee6d9e9..5070dec 100644
--- a/networkPrefix.cpp
+++ b/networkPrefix.cpp
@@ -49,12 +49,12 @@ void NetworkPrefix::setNetworkPrefixLength(uint8_t length )
{
in_addr v4addr;
v4addr.s_addr=0xFFFFFFFF;
- *this &= (NetworkAddress(v4addr)<<length);
+ *this &= (NetworkAddress(v4addr)<<(32-length));
} else if (network_address_type_==ipv6) {
in6_addr v6addr;
for(int i=0;i<4;i++)
ipv6_address_.s6_addr32[i]=0xFFFFFFFF;
- *this &= (NetworkAddress(v6addr)<<length);
+ *this &= (NetworkAddress(v6addr)<<(128-length));
} else if (network_address_type_==ethernet) {
//TODO
} else {