Quellcode durchsuchen

[NETFILTER]: Don't checksum CHECKSUM_UNNECESSARY skbs in TCP connection tracking

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy vor 20 Jahren
Ursprung
Commit
31da185d81
1 geänderte Dateien mit 1 neuen und 0 gelöschten Zeilen
  1. 1 0
      net/ipv4/netfilter/ip_conntrack_proto_tcp.c

+ 1 - 0
net/ipv4/netfilter/ip_conntrack_proto_tcp.c

@@ -819,6 +819,7 @@ static int tcp_error(struct sk_buff *skb,
 	 */
 	/* FIXME: Source route IP option packets --RR */
 	if (hooknum == NF_IP_PRE_ROUTING
+	    && skb->ip_summed != CHECKSUM_UNNECESSARY
 	    && csum_tcpudp_magic(iph->saddr, iph->daddr, tcplen, IPPROTO_TCP,
 			         skb->ip_summed == CHECKSUM_HW ? skb->csum
 			      	 : skb_checksum(skb, iph->ihl*4, tcplen, 0))) {