* Lua IP address structure
*/
struct rspamd_lua_ip {
- rspamd_inet_addr_t addr;
- gboolean is_valid;
+ rspamd_inet_addr_t *addr;
};
/**
ud = luaL_checkudata (L, 2, "rspamd{ip}");
if (ud != NULL) {
addr = *((struct rspamd_lua_ip **)ud);
- if (!addr->is_valid) {
+ if (addr->addr == NULL) {
msg_err ("rspamd{ip} is not valid");
addr = NULL;
}
}
if (addr != NULL) {
- if (radix_find_compressed_addr (radix, &addr->addr)
+ if (radix_find_compressed_addr (radix, addr->addr)
!= RADIX_NO_VALUE) {
ret = TRUE;
}
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
- rspamd_lua_ip_push (L, &task->from_addr);
+ rspamd_lua_ip_push (L, task->from_addr);
}
else {
lua_pushnil (L);
struct rspamd_task *task = lua_check_task (L, 1);
if (task) {
- rspamd_lua_ip_push (L, &task->client_addr);
+ rspamd_lua_ip_push (L, task->client_addr);
}
else {
lua_pushnil (L);