From 9af5ff1175ec98bc70a5a269aaa9740333ec5dc5 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Tue, 20 Dec 2022 21:23:01 +0100 Subject: [PATCH] auth LUA createForward: accept any length of prefix for the hex address --- pdns/lua-record.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index d221ce92be..e231da745b 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -705,7 +705,7 @@ static void setupLuaRecords(LuaContext& lua) } ret.resize(ret.size() - 1); // remove trailing dot after last octet return ret; - } else if(parts[0].length() == 10 && sscanf(parts[0].c_str()+2, "%02x%02x%02x%02x", &x1, &x2, &x3, &x4)==4) { + } else if(parts[0].length() >= 8 && sscanf(parts[0].c_str()+(parts[0].length()-8), "%02x%02x%02x%02x", &x1, &x2, &x3, &x4)==4) { return std::to_string(x1)+"."+std::to_string(x2)+"."+std::to_string(x3)+"."+std::to_string(x4); } } -- 2.47.2