From 16bd9af3a454d037a13bb548ce4f9778d12dba96 Mon Sep 17 00:00:00 2001 From: eric Date: Sat, 16 Nov 2019 07:06:08 +0800 Subject: [PATCH] Fix QoS --- src/udprelay.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/udprelay.c b/src/udprelay.c index 4eec87f6..c5f23f54 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -496,7 +496,7 @@ create_server_socket(const char *host, const char *port) } #ifdef IP_TOS // Set QoS flag - int tos = 46; + int tos = 46 << 2; int proto = rp->ai_family == AF_INET6 ? IPPROTO_IP : IPPROTO_IPV6; setsockopt(server_sock, proto, IP_TOS, &tos, sizeof(tos)); #endif @@ -658,7 +658,7 @@ resolv_cb(struct sockaddr *addr, void *data) #endif #ifdef IP_TOS // Set QoS flag - int tos = 46; + int tos = 46 << 2; int proto = addr->sa_family == AF_INET6 ? IPPROTO_IP : IPPROTO_IPV6; setsockopt(remotefd, proto, IP_TOS, &tos, sizeof(tos)); #endif @@ -846,7 +846,7 @@ remote_recv_cb(EV_P_ ev_io *w, int revents) } #ifdef IP_TOS // Set QoS flag - int tos = 46; + int tos = 46 << 2; int proto = remote_ctx->src_addr.ss_family == AF_INET6 ? IPPROTO_IP : IPPROTO_IPV6; setsockopt(src_fd, proto, IP_TOS, &tos, sizeof(tos)); #endif @@ -1179,7 +1179,7 @@ server_recv_cb(EV_P_ ev_io *w, int revents) #endif #ifdef IP_TOS // Set QoS flag - int tos = 46; + int tos = 46 << 2; setsockopt(remotefd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)); #endif #ifdef SET_INTERFACE @@ -1268,7 +1268,7 @@ server_recv_cb(EV_P_ ev_io *w, int revents) #endif #ifdef IP_TOS // Set QoS flag - int tos = 46; + int tos = 46 << 2; int proto = dst_addr.ss_family == AF_INET6 ? IPPROTO_IP : IPPROTO_IPV6; setsockopt(remotefd, proto, IP_TOS, &tos, sizeof(tos)); #endif