epee: skip IPv4 TOS option for non-IPv4 peers

This commit is contained in:
iuyua9
2026-05-14 17:40:26 +08:00
committed by iuyua9
parent 12c8ccf57f
commit 2a6f64d8fa
@@ -960,6 +960,7 @@ namespace net_utils
ec_t ec; ec_t ec;
#if !defined(_WIN32) || !defined(__i686) #if !defined(_WIN32) || !defined(__i686)
if (real_remote->get_type_id() == ipv4_network_address::get_type_id()) {
connection_basic::socket_.next_layer().set_option( connection_basic::socket_.next_layer().set_option(
boost::asio::detail::socket_option::integer<IPPROTO_IP, IP_TOS>{ boost::asio::detail::socket_option::integer<IPPROTO_IP, IP_TOS>{
connection_basic::get_tos_flag() connection_basic::get_tos_flag()
@@ -968,6 +969,7 @@ namespace net_utils
); );
if (ec.value()) if (ec.value())
return false; return false;
}
#endif #endif
connection_basic::socket_.next_layer().set_option( connection_basic::socket_.next_layer().set_option(
boost::asio::ip::tcp::no_delay{false}, boost::asio::ip::tcp::no_delay{false},