Commit 2c67e9ac authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by David S. Miller

net: use INET_ECN_MASK instead of hardcoded 3

Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cf533ea5
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/netfilter.h> #include <linux/netfilter.h>
#include <linux/route.h> #include <linux/route.h>
#include <linux/mroute.h> #include <linux/mroute.h>
#include <net/inet_ecn.h>
#include <net/route.h> #include <net/route.h>
#include <net/xfrm.h> #include <net/xfrm.h>
#include <net/compat.h> #include <net/compat.h>
...@@ -578,8 +579,8 @@ static int do_ip_setsockopt(struct sock *sk, int level, ...@@ -578,8 +579,8 @@ static int do_ip_setsockopt(struct sock *sk, int level,
break; break;
case IP_TOS: /* This sets both TOS and Precedence */ case IP_TOS: /* This sets both TOS and Precedence */
if (sk->sk_type == SOCK_STREAM) { if (sk->sk_type == SOCK_STREAM) {
val &= ~3; val &= ~INET_ECN_MASK;
val |= inet->tos & 3; val |= inet->tos & INET_ECN_MASK;
} }
if (inet->tos != val) { if (inet->tos != val) {
inet->tos = val; inet->tos = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment