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.
This commit is contained in:
Cameron Gutman
2024-02-03 14:32:25 -06:00
parent a92d6960a6
commit a754295f42
+2 -2
View File
@@ -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