diff --git a/Dlep.cpp b/Dlep.cpp index c7b3a28..9e65430 100644 --- a/Dlep.cpp +++ b/Dlep.cpp @@ -465,6 +465,21 @@ Dlep::start_dlep() session_acceptor = new boost::asio::ip::tcp::acceptor(io_service_, boost::asio::ip::tcp::endpoint(session_address, session_port)); + + // Set the socket's TTL to the session-ttl config parameter + // if it exists. + + try + { + unsigned int ttl; + dlep_client.get_config_parameter("session-ttl", &ttl); + session_acceptor->set_option(boost::asio::ip::unicast::hops(ttl)); + } + catch (LLDLEP::DlepClient::BadParameterName) + { + // Let the default TTL take effect. + } + start_async_accept(); } else // we're the router diff --git a/PeerDiscovery.cpp b/PeerDiscovery.cpp index 24395bc..ac06c10 100644 --- a/PeerDiscovery.cpp +++ b/PeerDiscovery.cpp @@ -593,7 +593,7 @@ PeerDiscovery::send_peer_offer(boost::asio::ip::udp::endpoint to_endpoint) } boost::asio::ip::udp::endpoint send_endpoint(to_endpoint.address(), - udp_port); + to_endpoint.port()); msg << "Sending signal to " << send_endpoint; LOG(DLEP_LOG_INFO, msg); diff --git a/config/modem.xml b/config/modem.xml index 9232108..352e573 100644 --- a/config/modem.xml +++ b/config/modem.xml @@ -8,17 +8,18 @@ as a modem. modem 1 - + eth0 - - + 255 + 255 + 4854 - + 225.0.0.117 60 - + 4854 60 2