From: Anoop Saldanha Date: Sat, 2 Mar 2013 14:08:49 +0000 (+0530) Subject: fix for #760. X-Git-Tag: suricata-1.4.1~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0febe5a410a020668f07dea14e0bb7398e4d4f2a;p=thirdparty%2Fsuricata.git fix for #760. If udpv4 csum isn't calculated, udpv4-csum detection shouldn't run on the csum. --- diff --git a/src/detect-csum.c b/src/detect-csum.c index 1e06e5801e..8f412c72b0 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -514,7 +514,7 @@ int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, { DetectCsumData *cd = (DetectCsumData *)m->ctx; - if (p->ip4h == NULL || p->udph == NULL || p->proto != IPPROTO_UDP || PKT_IS_PSEUDOPKT(p)) + if (p->ip4h == NULL || p->udph == NULL || p->proto != IPPROTO_UDP || PKT_IS_PSEUDOPKT(p) || p->udph->uh_sum == 0) return 0; if (p->flags & PKT_IGNORE_CHECKSUM) {