aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet_info.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-02-28 20:30:06 +0000
committerGuy Harris <guy@alum.mit.edu>2003-02-28 20:30:06 +0000
commit5e665db815a2428cd948d082c6f6548e2aa04680 (patch)
tree204e1c1528ca71731244b2e056c94ee6435db2da /epan/packet_info.h
parent8959d1b66d038b2d698036280ee0e415f440efa7 (diff)
Assume all AT_NONE addresses are the same, as they have no address data
to compare; based on a change from Laurent Meyer. svn path=/trunk/; revision=7222
Diffstat (limited to 'epan/packet_info.h')
-rw-r--r--epan/packet_info.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/epan/packet_info.h b/epan/packet_info.h
index 56b154e2e9..1b30a81741 100644
--- a/epan/packet_info.h
+++ b/epan/packet_info.h
@@ -1,7 +1,7 @@
/* packet_info.h
* Definitions for packet info structures and routines
*
- * $Id: packet_info.h,v 1.30 2003/02/27 03:56:48 guy Exp $
+ * $Id: packet_info.h,v 1.31 2003/02/28 20:30:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -71,11 +71,21 @@ typedef struct _address {
/*
* Given two addresses, return "true" if they're equal, "false" otherwise.
+ * Addresses are equal only if they have the same type; if the type is
+ * AT_NONE, they are then equal, otherwise they must have the same
+ * amount of data and the data must be the same.
*/
-#define ADDRESSES_EQUAL(addr1, addr2) \
- ((addr1)->type == (addr2)->type && \
- (addr1)->len == (addr2)->len && \
- memcmp((addr1)->data, (addr2)->data, (addr1)->len) == 0)
+#define ADDRESSES_EQUAL(addr1, addr2) \
+ ( \
+ (addr1)->type == (addr2)->type && \
+ ( \
+ (addr1)->type == AT_NONE || \
+ ( \
+ (addr1)->len == (addr2)->len && \
+ memcmp((addr1)->data, (addr2)->data, (addr1)->len) == 0 \
+ ) \
+ ) \
+ )
/*
* Copy an address, allocating a new buffer for the address data.