IsUpOracle g_up;
-std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, const DNSName& query, const DNSName& zone, int zoneid, const ComboAddress& who, uint16_t qtype)
+std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, const DNSName& query, const DNSName& zone, int zoneid, const ComboAddress& who, const Netmask& realWho, uint16_t qtype)
{
std::vector<shared_ptr<DNSRecordContent>> ret;
LuaContext lua;
lua.writeVariable("qname", query.toString());
lua.writeVariable("who", who.toString());
+ lua.writeVariable("realwho", realWho.toString());
lua.writeFunction("ifportup", [](int port, const vector<pair<int, string> >& ips) {
vector<ComboAddress> candidates;
luacall_axfr_filter_t d_axfr_filter;
};
std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, const DNSName& qname,
- const DNSName& zone, int zoneid, const ComboAddress& who, uint16_t qtype);
+ const DNSName& zone, int zoneid, const ComboAddress& who,
+ const Netmask& realwho, uint16_t qtype);
if(rec->d_type != QType::CNAME && rec->d_type != p->qtype.getCode())
continue;
- auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, p->getRemote(), rec->d_type);
+ auto recvec=luaSynth(rec->getCode(), target, sd.qname, sd.domain_id, p->getRemote(), p->getRealRemote(), rec->d_type);
if(!recvec.empty()) {
for(const auto& r : recvec) {
rr.dr.d_type = rec->d_type; // might be CNAME