Skip to contentSkip to conversation

PKT_SCHED: dsmark should ignore ECN bits

PATCH In review Thomas Graf 2 participants 2 messages Dec 27, 2004 – Dec 28, 2004

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

PATCH 1/1 PKT_SCHED: dsmark should ignore ECN bits

Taking ECN bits into account doesn't make sense. The two bits were still unused at the time the code was written so this brings back the old behaviour.

net/sched/sch_dsmark.c +5 -2
@@ -14,6 +14,7 @@
 #include <linux/rtnetlink.h>
 #include <net/pkt_sched.h>
 #include <net/dsfield.h>
+#include <net/inet_ecn.h>
 #include <asm/byteorder.h>
 
 
@@ -198,10 +199,12 @@
 		/* FIXME: Safe with non-linear skbs? --RR */
 		switch (skb->protocol) {
 			case __constant_htons(ETH_P_IP):
-				skb->tc_index = ipv4_get_dsfield(skb->nh.iph);
+				skb->tc_index = ipv4_get_dsfield(skb->nh.iph)
+					& ~INET_ECN_MASK;
 				break;
 			case __constant_htons(ETH_P_IPV6):
-				skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h);
+				skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h)
+					& ~INET_ECN_MASK;
 				break;
 			default:
 				skb->tc_index = 0;
maintainer
#1 lore raw
Quoted 5 lines · On Mon, 27 Dec 2004 20:38:22 +0100 Thomas Graf <[email protected]> wrote:

Taking ECN bits into account doesn't make sense. The two bits were still unused at the time the code was written so this brings back the old behaviour.

Looks good, I put this into my 2.4 tree as well.

Thanks.