diff -r 62eac57c1b56 ospf/debug_io.hh --- a/ospf/debug_io.hh Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/debug_io.hh Thu Nov 13 19:38:15 2008 +0000 @@ -79,7 +79,7 @@ */ bool send(const string& interface, const string& vif, A dst, A src, - uint8_t* data, uint32_t len) + int ttl, uint8_t* data, uint32_t len) { pp("SEND", 0, interface, vif, dst, src, data, len); @@ -89,6 +89,7 @@ if (!_forward_cb.is_empty()) _forward_cb->dispatch(interface, vif, dst, src, data, len); return true; + UNUSED(ttl); } /** diff -r 62eac57c1b56 ospf/io.hh --- a/ospf/io.hh Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/io.hh Thu Nov 13 19:38:15 2008 +0000 @@ -48,7 +48,7 @@ */ virtual bool send(const string& interface, const string& vif, A dst, A src, - uint8_t* data, uint32_t len) = 0; + int ttl, uint8_t* data, uint32_t len) = 0; /** * Send router alerts in IP packets? diff -r 62eac57c1b56 ospf/ospf.cc --- a/ospf/ospf.cc Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/ospf.cc Thu Nov 13 19:38:15 2008 +0000 @@ -296,12 +296,13 @@ bool Ospf::transmit(const string& interface, const string& vif, A dst, A src, - uint8_t* data, uint32_t len) + int ttl, uint8_t* data, uint32_t len) { - XLOG_TRACE(trace()._packets, "Interface %s Vif %s data %p len %u\n", - interface.c_str(), vif.c_str(), data, len); - debug_msg("Interface %s Vif %s data %p len %u\n", - interface.c_str(), vif.c_str(), data, len); + XLOG_TRACE(trace()._packets, + "Interface %s Vif %s ttl %d data %p len %u\n", + interface.c_str(), vif.c_str(), ttl, data, len); + debug_msg("Interface %s Vif %s ttl %d data %p len %u\n", + interface.c_str(), vif.c_str(), ttl, data, len); // If the transport is IPv6 then the checksum has to include the // pseudo header. In the IPv4 case this function is a noop. @@ -330,7 +331,7 @@ } #endif - return _io->send(interface, vif, dst, src, data, len); + return _io->send(interface, vif, dst, src, ttl, data, len); } template diff -r 62eac57c1b56 ospf/ospf.hh --- a/ospf/ospf.hh Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/ospf.hh Thu Nov 13 19:38:15 2008 +0000 @@ -468,7 +468,7 @@ * Used to send traffic on the IO interface. */ bool transmit(const string& interface, const string& vif, - A dst, A src, uint8_t* data, uint32_t len); + A dst, A src, int ttl, uint8_t* data, uint32_t len); /** * The callback method that is called when data arrives on the IO diff -r 62eac57c1b56 ospf/peer_manager.cc --- a/ospf/peer_manager.cc Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/peer_manager.cc Thu Nov 13 19:38:15 2008 +0000 @@ -52,6 +52,9 @@ #include "peer.hh" #include "peer_manager.hh" +#ifndef VLINK_DEF_TTL +#define VLINK_DEF_TTL 64 // Default TTL for virtual link packets. +#endif template PeerManager::~PeerManager() @@ -874,11 +877,12 @@ string interface; string vif; if (_vlink.get_physical_interface_vif(src, dst, interface, vif)) - return _ospf.transmit(interface, vif, dst, src, data, len); + return _ospf.transmit(interface, vif, dst, src, + VLINK_DEF_TTL, data, len); // We didn't find a match fall through. } - return _ospf.transmit(interface, vif, dst, src, data, len); + return _ospf.transmit(interface, vif, dst, src, -1, data, len); } template diff -r 62eac57c1b56 ospf/xrl_io.cc --- a/ospf/xrl_io.cc Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/xrl_io.cc Thu Nov 13 19:38:15 2008 +0000 @@ -88,7 +88,7 @@ bool XrlIO::send(const string& interface, const string& vif, IPv4 dst, IPv4 src, - uint8_t* data, uint32_t len) + int ttl, uint8_t* data, uint32_t len) { bool success; @@ -110,8 +110,8 @@ src, dst, get_ip_protocol_number(), - -1, // XXX: let the FEA set it - -1, // XXX: let the FEA set it + ttl, + -1, // XXX: let the FEA set TOS get_ip_router_alert(), true, // ip_internet_control payload, @@ -124,7 +124,7 @@ bool XrlIO::send(const string& interface, const string& vif, IPv6 dst, IPv6 src, - uint8_t* data, uint32_t len) + int ttl, uint8_t* data, uint32_t len) { bool success; @@ -147,8 +147,8 @@ src, dst, get_ip_protocol_number(), - dst.is_multicast() ? 1 : -1, // XXX: let the FEA set it - -1, // XXX: let the FEA set it + dst.is_multicast() ? 1 : ttl, + -1, // XXX: let the FEA set TOS get_ip_router_alert(), true, // ip_internet_control ext_headers_type, diff -r 62eac57c1b56 ospf/xrl_io.hh --- a/ospf/xrl_io.hh Thu Nov 13 18:14:45 2008 +0000 +++ b/ospf/xrl_io.hh Thu Nov 13 19:38:15 2008 +0000 @@ -226,7 +226,7 @@ */ bool send(const string& interface, const string& vif, A dst, A src, - uint8_t* data, uint32_t len); + int ttl, uint8_t* data, uint32_t len); /** * Enable the interface/vif to receive frames.