Skip to contentSkip to conversation

net: use INET_ECN_MASK instead of hardcoded 3

PATCH Applied Maciej Żenczykowski 2 participants 2 messages Oct 21, 2011 – Oct 22, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: use INET_ECN_MASK instead of hardcoded 3

From: Maciej Żenczykowski <[email protected]>

---
 net/ipv4/ip_sockglue.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/ipv4/ip_sockglue.c +3 -2
index f0dc3ad..09ff51b 100644
@@ -33,6 +33,7 @@
 #include <linux/netfilter.h>
 #include <linux/route.h>
 #include <linux/mroute.h>
+#include <net/inet_ecn.h>
 #include <net/route.h>
 #include <net/xfrm.h>
 #include <net/compat.h>
@@ -578,8 +579,8 @@ static int do_ip_setsockopt(struct sock *sk, int level,
 		break;
 	case IP_TOS:	/* This sets both TOS and Precedence */
 		if (sk->sk_type == SOCK_STREAM) {
-			val &= ~3;
-			val |= inet->tos & 3;
+			val &= ~INET_ECN_MASK;
+			val |= inet->tos & INET_ECN_MASK;
 		}
 		if (inet->tos != val) {
 			inet->tos = val;
Signature · 1 line
1.7.3.1