+ tdb_header_hash(tdb, &magic1_hash, &magic2_hash);
+
+ if ((tdb->header.magic1_hash == 0) && (tdb->header.magic2_hash == 0)) {
+ /* older TDB without magic hash references */
+ } else if ((tdb->header.magic1_hash != magic1_hash) ||
+ (tdb->header.magic2_hash != magic2_hash)) {
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: "
+ "%s was not created with the %s hash function we are using\n"
+ "magic1_hash[0x%08X %s 0x%08X] "
+ "magic2_hash[0x%08X %s 0x%08X]\n",
+ name, hash_alg,
+ tdb->header.magic1_hash,
+ (tdb->header.magic1_hash == magic1_hash) ? "==" : "!=",
+ magic1_hash,
+ tdb->header.magic2_hash,
+ (tdb->header.magic2_hash == magic2_hash) ? "==" : "!=",
+ magic2_hash));
+ errno = EINVAL;
+ goto fail;
+ }
+