]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Map qclass from ret correctly to Lua
authorFusl <root@hallowe.lt>
Sat, 25 Jan 2014 19:11:36 +0000 (20:11 +0100)
committerFusl <root@hallowe.lt>
Sat, 25 Jan 2014 19:11:36 +0000 (20:11 +0100)
pdns/lua-pdns.cc

index 780825044fae53d8c4e491942bbffa14c2d39904..41e96e42b9c3052649afa06be5a5574173b152e7 100644 (file)
@@ -108,6 +108,9 @@ void pushResourceRecordsTable(lua_State* lua, const vector<DNSResourceRecord>& r
     lua_pushnumber(lua, rr.d_place);
     lua_setfield(lua, -2, "place");
     
+    lua_pushnumber(lua, rr.qclass);
+    lua_setfield(lua, -2, "qclass");
+    
     lua_settable(lua, -3); // pushes the table we just built into the master table at position pushed above
   }
 }
@@ -196,6 +199,12 @@ void popResourceRecordsTable(lua_State *lua, const string &query, vector<DNSReso
         rr.d_place = DNSResourceRecord::ADDITIONAL;
     }
 
+    if(!getFromTable(lua, "qclass", tmpnum))
+      rr.qclass = QClass::IN;
+    else {
+      rr.qclass = tmpnum;
+    }
+
     /* removes 'value'; keeps 'key' for next iteration */
     lua_pop(lua, 1); // table