How to set the return value of gettag function #14804
-
In this page,I understand the gettag function can fill the DNSQuestion.requestorId field, But in the logs obtained through the protobufServer function, the fields of DeviceId and DeviceName are N/A. What is the reason for this? It may be that I set them incorrectly. Can you provide me with a simple example of gettag? function gettag(remote, ednssubnet, localip, qname, qtype, ednsoptions, tcp, proxyprotocolvalues)
local device_id = ""
local device_name = ""
if ednsoptions ~= nil then
if ednsoptions[CONFIG.device_code] ~= nil then
device_id = ednsoptions[CONFIG.device_code]:getContent()
end
if ednsoptions[CONFIG.apikey_code] ~= nil then
device_name = ednsoptions[CONFIG.apikey_code]:getContent()
end
end
return 0, {}, {}, device_id, device_name, {}
end |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Do you have gettag-needs-edns-options set? |
Beta Was this translation helpful? Give feedback.
-
This script works for me:
Your script has a type error: the requestor id was missing, it comes before the device id. So the {} ended up being used as a string. With your
(Though older recursors might hide this errror) |
Beta Was this translation helpful? Give feedback.
This script works for me: