diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-07-15 00:29:41 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-07-15 07:31:03 +0000 |
commit | ced207150542f59f395fc4052d8a7cdfba67effa (patch) | |
tree | 743bee5c03f852b0db0235e96a82f428d5da3444 /wiretap | |
parent | 81642901fe973edc80883774dde7c09d6f3e4389 (diff) |
Fix the snapshot length part of the "same interface?" check.
Fix a typo - compare for unequal snapshot lengths, not equal snapshot
lengths.
Also, move the debug messages about checks right above the checks.
Change-Id: If6f5e125f05f3788b63e9f75d98f55e27830870b
Reviewed-on: https://code.wireshark.org/review/16470
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/merge.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/wiretap/merge.c b/wiretap/merge.c index ea3f9a6dd5..7df0f2ba7b 100644 --- a/wiretap/merge.c +++ b/wiretap/merge.c @@ -440,24 +440,34 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2) merge_debug("merge::is_duplicate_idb() called"); merge_debug("idb1_mand->wtap_encap == idb2_mand->wtap_encap: %s", (idb1_mand->wtap_encap == idb2_mand->wtap_encap) ? "TRUE":"FALSE"); - merge_debug("idb1_mand->time_units_per_second == idb2_mand->time_units_per_second: %s", - (idb1_mand->time_units_per_second == idb2_mand->time_units_per_second) ? "TRUE":"FALSE"); - merge_debug("idb1_mand->tsprecision == idb2_mand->tsprecision: %s", - (idb1_mand->tsprecision == idb2_mand->tsprecision) ? "TRUE":"FALSE"); + if (idb1_mand->wtap_encap != idb2_mand->wtap_encap) { + /* Clearly not the same interface. */ + merge_debug("merge::is_duplicate_idb() returning FALSE"); + return FALSE; + } + merge_debug("idb1_mand->link_type == idb2_mand->link_type: %s", (idb1_mand->link_type == idb2_mand->link_type) ? "TRUE":"FALSE"); - merge_debug("idb1_mand->snap_len == idb2_mand->snap_len: %s", - (idb1_mand->snap_len == idb2_mand->snap_len) ? "TRUE":"FALSE"); - - if (idb1_mand->wtap_encap != idb2_mand->wtap_encap || - idb1_mand->link_type != idb2_mand->link_type) { + if (idb1_mand->link_type != idb2_mand->link_type) { /* Clearly not the same interface. */ merge_debug("merge::is_duplicate_idb() returning FALSE"); return FALSE; } - if (idb1_mand->time_units_per_second != idb2_mand->time_units_per_second || - idb1_mand->tsprecision != idb2_mand->tsprecision) { + merge_debug("idb1_mand->time_units_per_second == idb2_mand->time_units_per_second: %s", + (idb1_mand->time_units_per_second == idb2_mand->time_units_per_second) ? "TRUE":"FALSE"); + if (idb1_mand->time_units_per_second != idb2_mand->time_units_per_second) { + /* + * Probably not the same interface, and we can't combine them + * in any case. + */ + merge_debug("merge::is_duplicate_idb() returning FALSE"); + return FALSE; + } + + merge_debug("idb1_mand->tsprecision == idb2_mand->tsprecision: %s", + (idb1_mand->tsprecision == idb2_mand->tsprecision) ? "TRUE":"FALSE"); + if (idb1_mand->tsprecision != idb2_mand->tsprecision) { /* * Probably not the same interface, and we can't combine them * in any case. @@ -467,7 +477,9 @@ is_duplicate_idb(const wtap_block_t idb1, const wtap_block_t idb2) } /* XXX: should snaplen not be compared? */ - if (idb1_mand->snap_len == idb2_mand->snap_len) { + merge_debug("idb1_mand->snap_len == idb2_mand->snap_len: %s", + (idb1_mand->snap_len == idb2_mand->snap_len) ? "TRUE":"FALSE"); + if (idb1_mand->snap_len != idb2_mand->snap_len) { merge_debug("merge::is_duplicate_idb() returning FALSE"); return FALSE; } |