[NETFILTER]: Avoid unncessary checksum validation in UDP connection tracking
authorKeir Fraser <Keir.Fraser@xl.cam.ac.uk>
Tue, 21 Jun 2005 21:03:23 +0000 (14:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jun 2005 21:03:23 +0000 (14:03 -0700)
Signed-off-by: Keir Fraser <Keir.Fraser@xl.cam.ac.uk>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_conntrack_proto_udp.c

index 5bc28a2..8c1eaba 100644 (file)
@@ -120,6 +120,7 @@ static int udp_error(struct sk_buff *skb, enum ip_conntrack_info *ctinfo,
         * and moreover root might send raw packets.
         * 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, udplen, IPPROTO_UDP,
                                 skb->ip_summed == CHECKSUM_HW ? skb->csum
                                 : skb_checksum(skb, iph->ihl*4, udplen, 0))) {