]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix parameter validation with XSK
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 2 Mar 2023 14:04:57 +0000 (15:04 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 23 Jan 2024 11:54:14 +0000 (12:54 +0100)
pdns/dnsdist-lua.cc

index ac6e6e84e8d5ce4f62dc7cbcd55281c9bc7d5c99..3338ceea3120ed64d37d06fc3bb4ee54d1ad64e2 100644 (file)
@@ -752,8 +752,6 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
 
     parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections, enableProxyProtocol);
 
-    checkAllParametersConsumed("setLocal", vars);
-
     try {
       ComboAddress loc(addr, 53);
       for (auto it = g_frontends.begin(); it != g_frontends.end();) {
@@ -792,6 +790,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
 #endif /* HAVE_XSK */
       g_frontends.push_back(std::move(udpCS));
       g_frontends.push_back(std::move(tcpCS));
+
+      checkAllParametersConsumed("setLocal", vars);
     }
     catch (const std::exception& e) {
       g_outputBuffer = "Error: " + string(e.what()) + "\n";
@@ -816,7 +816,6 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     bool enableProxyProtocol = true;
 
     parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections, enableProxyProtocol);
-    checkAllParametersConsumed("addLocal", vars);
 
     try {
       ComboAddress loc(addr, 53);
@@ -845,6 +844,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
 #endif /* HAVE_XSK */
       g_frontends.push_back(std::move(udpCS));
       g_frontends.push_back(std::move(tcpCS));
+
+      checkAllParametersConsumed("addLocal", vars);
     }
     catch (std::exception& e) {
       g_outputBuffer = "Error: " + string(e.what()) + "\n";