diff --git a/src/Interface.h b/src/Interface.h index 2983d58..0a0d08d 100644 --- a/src/Interface.h +++ b/src/Interface.h @@ -82,6 +82,9 @@ namespace RNS { std::list _announce_queue; bool _is_connected_to_shared_instance = false; bool _is_local_shared_instance = false; + + public: + virtual bool needs_transport_headers() const { return _is_connected_to_shared_instance; } //Bytes _hash; HInterface _parent_interface; //Transport& _owner; @@ -155,6 +158,7 @@ namespace RNS { inline void stop() { assert(_impl); return _impl->stop(); } inline void loop() { assert(_impl); return _impl->loop(); } inline const Bytes get_hash() const { assert(_impl); return _impl->get_hash(); } + inline bool needs_transport_headers() const { assert(_impl); return _impl->needs_transport_headers(); } void process_announce_queue(); // CBA ACCUMULATES diff --git a/src/Transport.cpp b/src/Transport.cpp index 2b718a7..d7adf1d 100644 --- a/src/Transport.cpp +++ b/src/Transport.cpp @@ -823,7 +823,7 @@ Transport::DestinationEntry empty_destination_entry; // are "behind" a shared instance, we need to get that instance // to transport it onto the network. //elif Transport.destination_table[packet.destination_hash][2] == 1 and Transport.owner.is_connected_to_shared_instance: - else if (destination_entry._hops == 1 && _owner.is_connected_to_shared_instance()) { + else if (destination_entry._hops == 1 && (_owner.is_connected_to_shared_instance() || outbound_interface.needs_transport_headers())) { TRACE("Transport::outbound: Sending packet for directly connected interface to shared instance..."); if (packet.header_type() == Type::Packet::HEADER_1) { // Insert packet into transport