]> granicus.if.org Git - pdns/commitdiff
initialise server-id after all parsing is done, instead of half way through. Fixes...
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 10 Jun 2013 12:20:37 +0000 (14:20 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Mon, 10 Jun 2013 12:20:46 +0000 (14:20 +0200)
pdns/receiver.cc

index 826bdd5d42a1e4c968f495801986bf83d1dcbafc..99b94f7b8024384e4fca5b18cd91a795191f4449 100644 (file)
@@ -524,12 +524,6 @@ int main(int argc, char **argv)
         daemonize();
     }
 
-    if(::arg()["server-id"].empty()) {
-      char tmp[128];
-      gethostname(tmp, sizeof(tmp)-1);
-      ::arg().set("server-id")=tmp;
-    }
-
     if(isGuarded(argv)) {
       L<<Logger::Warning<<"This is a guarded instance of pdns"<<endl;
       dl=new DynListener; // listens on stdin 
@@ -567,6 +561,13 @@ int main(int argc, char **argv)
     if(!::arg().mustDo("no-config"))
       ::arg().file(configname.c_str());
     ::arg().parse(argc,argv);
+
+    if(::arg()["server-id"].empty()) {
+      char tmp[128];
+      gethostname(tmp, sizeof(tmp)-1);
+      ::arg().set("server-id")=tmp;
+    }
+
     UeberBackend::go();
     N=new UDPNameserver; // this fails when we are not root, throws exception