Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd841326 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: Fix ECN target TCP marking



An incorrect check made it bail out before doing anything.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a5ea169c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -61,10 +61,10 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
	if (!tcph)
		return 0;

	if (!(einfo->operation & IPT_ECN_OP_SET_ECE
	      || tcph->ece == einfo->proto.tcp.ece)
	    && (!(einfo->operation & IPT_ECN_OP_SET_CWR
		  || tcph->cwr == einfo->proto.tcp.cwr)))
	if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) ||
	     tcph->ece == einfo->proto.tcp.ece) &&
	    ((!(einfo->operation & IPT_ECN_OP_SET_CWR) ||
	     tcph->cwr == einfo->proto.tcp.cwr)))
		return 1;

	if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph)))