radix_insert_compressed (tree,
addr_buf.buf,
sizeof (addr_buf.buf),
- 128 - k, (uintptr_t)value);
+ 32 - k, (uintptr_t)value);
res ++;
}
else if (cur_ai->ai_family == AF_INET6) {
}
/* Move to the last part of the address */
- memmove (addr_buf.buf, addr_buf.buf + 12, 4);
+ memmove (addr_buf.buf + 12, &addr_buf.ina, 4);
memset (addr_buf.buf, 0, 10);
addr_buf.buf[10] = 0xffu;
addr_buf.buf[11] = 0xffu;
radix_insert_compressed (tree, addr_buf.buf, sizeof (addr_buf.buf),
- 128 - k, (uintptr_t)value);
+ 32 - k, (uintptr_t)value);
res ++;
}
else if (af == AF_INET6){
if (radix_map:get_key(rspamd_ip.from_string(sip[i])) ~= expected[i]) then
local rip = rspamd_ip.from_string(sip[i])
local val = radix_map:get_key(rip)
- return true, rspamd_logger.slog('get_key(%s) [%s] -> %s [%s] [expected %s]', rip, type(rip), val, type(val), expected[i])
+ return true, rspamd_logger.slog('plain: get_key(%s) [%s] -> %s [%s] [expected %s]', rip, type(rip), val, type(val), expected[i])
end
if (radix_map:get_key(sip[i]) ~= expected[i]) then
local val = radix_map:get_key(sip[i])
- return true, rspamd_logger.slog('get_key(%s) [%s] -> %s [%s] [expected %s]', sip[i], type(sip[i]), val, type(val), expected[i])
+ return true, rspamd_logger.slog('string: get_key(%s) [%s] -> %s [%s] [expected %s]', sip[i], type(sip[i]), val, type(val), expected[i])
end
end
return true, 'no worry'