From de86f38022cc3a96c545c349309b38d98d22391d Mon Sep 17 00:00:00 2001 From: bert hubert Date: Tue, 20 Jan 2015 10:20:03 +0100 Subject: [PATCH] lua iputils ipset was accidentally port number sensitive. it is not an ipportset. --- pdns/lua-iputils.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pdns/lua-iputils.cc b/pdns/lua-iputils.cc index 261a780c6..980c0aabe 100644 --- a/pdns/lua-iputils.cc +++ b/pdns/lua-iputils.cc @@ -84,9 +84,11 @@ static const struct luaL_Reg iputils_ca_methods[]={ ///////////////////////////// +typedef set ourset_t; + static int l_ipset_index(lua_State* L) { - set*ourset = (set*)luaL_checkudata(L, 1, "iputils.ipset"); + ourset_t *ourset = (ourset_t*)luaL_checkudata(L, 1, "iputils.ipset"); ComboAddress* ca1 = (ComboAddress*)luaL_checkudata(L, 2, "iputils.ca"); if(ourset->count(*ca1)) { lua_pushboolean(L, 1); @@ -98,7 +100,7 @@ static int l_ipset_index(lua_State* L) static int l_ipset_newindex(lua_State* L) { - set*ourset = (set*)luaL_checkudata(L, 1, "iputils.ipset"); + ourset_t*ourset = (ourset_t*)luaL_checkudata(L, 1, "iputils.ipset"); ComboAddress* ca1 = (ComboAddress*)luaL_checkudata(L, 2, "iputils.ca"); ourset->insert(*ca1); return 0; @@ -106,7 +108,7 @@ static int l_ipset_newindex(lua_State* L) static int l_newipset(lua_State* L) { - new(lua_newuserdata(L, sizeof(set))) set(); + new(lua_newuserdata(L, sizeof(ourset_t))) ourset_t(); luaL_getmetatable(L, "iputils.ipset"); lua_setmetatable(L, -2); return 1; @@ -114,8 +116,8 @@ static int l_newipset(lua_State* L) static int l_ipset_gc(lua_State* L) { - set*ourset = (set*)luaL_checkudata(L, 1, "iputils.ipset"); - ourset->~set(); + ourset_t*ourset = (ourset_t*)luaL_checkudata(L, 1, "iputils.ipset"); + ourset->~ourset_t(); return 0; } -- 2.40.0