How to access EDNS Option content received from dnsmasq #13891
Answered
by
rgacogne
MangeshBhamre
asked this question in
Q&A
-
Hello team, Here is my code snippet from dnsdist.conf. ecsOption.content is always nil. I wish to access cpe-id and mac-id from EDNS Options. Please help. function getCpeID(dq)
local cpeID
if dq:getEDNSOptions() ~= nil then
local ednsOptions = dq:getEDNSOptions()
local ecsOption = ednsOptions[65073]
if ecsOption then
-- Assuming 'content' is the correct way to access the data you're interested in
errlog("EDNS Option Code: " .. type(ecsOption) .. tostring(ecsOption.content) )
cpeID = tostring(ecsOption.content)
end
end
return cpeID
end |
Beta Was this translation helpful? Give feedback.
Answered by
rgacogne
Mar 11, 2024
Replies: 1 comment 2 replies
-
I'm afraid you are incorrectly using the returned object, please have a look at https://dnsdist.org/reference/dq.html#ednsoptionview-object |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
MangeshBhamre
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid you are incorrectly using the returned object, please have a look at https://dnsdist.org/reference/dq.html#ednsoptionview-object