From a754295f4283b408f3dd1aa634823174f88fd086 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 3 Feb 2024 14:32:25 -0600 Subject: [PATCH] Enable ECN/L4S on UNIX Since this is enabled as a QoS option, it will benefit from the opportunistic disablement code when ECN-intolerant networks are encountered. --- unix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unix.c b/unix.c index 508c35d6..eb1538b1 100644 --- a/unix.c +++ b/unix.c @@ -458,12 +458,12 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value) #endif #ifdef IP_TOS // UNIX - IPv4 - value = value ? 46 << 2 : 0; // DSCP: Expedited Forwarding + value = value ? (46 << 2 | 0x01) : 0; // DSCP: Expedited Forwarding + ECT(1) (L4S) result = setsockopt (socket, IPPROTO_IP, IP_TOS, (char *) & value, sizeof (int)); #endif #ifdef IPV6_TCLASS // UNIX - IPv6 - value = value ? 46 << 2: 0; // DSCP: Expedited Forwarding + value = value ? (46 << 2 | 0x01): 0; // DSCP: Expedited Forwarding + ECT(1) (L4S) result = setsockopt (socket, IPPROTO_IPV6, IPV6_TCLASS, (char *) & value, sizeof (int)); #endif #ifdef SO_PRIORITY