summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk_cache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
index fde6e2e0974..e95406565e4 100644
--- a/src/util/disk_cache.c
+++ b/src/util/disk_cache.c
@@ -1170,7 +1170,7 @@ void
disk_cache_put_key(struct disk_cache *cache, const cache_key key)
{
const uint32_t *key_chunk = (const uint32_t *) key;
- int i = *key_chunk & CACHE_INDEX_KEY_MASK;
+ int i = CPU_TO_LE32(*key_chunk) & CACHE_INDEX_KEY_MASK;
unsigned char *entry;
entry = &cache->stored_keys[i * CACHE_KEY_SIZE];
@@ -1189,7 +1189,7 @@ bool
disk_cache_has_key(struct disk_cache *cache, const cache_key key)
{
const uint32_t *key_chunk = (const uint32_t *) key;
- int i = *key_chunk & CACHE_INDEX_KEY_MASK;
+ int i = CPU_TO_LE32(*key_chunk) & CACHE_INDEX_KEY_MASK;
unsigned char *entry;
entry = &cache->stored_keys[i * CACHE_KEY_SIZE];