summaryrefslogtreecommitdiff
path: root/print-tcp.c
diff options
context:
space:
mode:
authorguy <guy>2005-10-16 06:05:03 +0000
committerguy <guy>2005-10-16 06:05:03 +0000
commit463199df7a8a5218ada2009d56cc0656a60b3924 (patch)
tree77dd88a2055e9c553378aaf3d78e580b17c9893c /print-tcp.c
parent634d7985341ac3650e1337b166320b851f627fe7 (diff)
downloadtcpdump-463199df7a8a5218ada2009d56cc0656a60b3924.tar.gz
From Noritoshi Demizu: memcmp() returns a value = 0 if the two memory
regions are =, < 0 if the first memory region is < the second, or > 0 if the first memory region is > the second, so to check whether two memory regions are equal, check whether memcmp()'s return value is == 0.
Diffstat (limited to 'print-tcp.c')
-rw-r--r--print-tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print-tcp.c b/print-tcp.c
index 6f5d433d..4fffc7a2 100644
--- a/print-tcp.c
+++ b/print-tcp.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.122 2005-04-21 06:35:52 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.123 2005-10-16 06:05:03 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -799,7 +799,7 @@ tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
MD5_Update(&ctx, tcpmd5secret, strlen(tcpmd5secret));
MD5_Final(sig, &ctx);
- if (memcmp(rcvsig, sig, 16))
+ if (memcmp(rcvsig, sig, TCP_SIGLEN) == 0)
return (SIGNATURE_VALID);
else
return (SIGNATURE_INVALID);