in dnssync, recreate sockets to fix problems when setting/changing custom nameserver
authorbeware <beware@bircd.org>
Sat, 10 Dec 2011 16:36:12 +0000 (16:36 +0000)
committerbeware <beware@bircd.org>
Sat, 10 Dec 2011 16:36:12 +0000 (16:36 +0000)
git-svn-id: file:///svnroot/lcore/trunk@110 b1de8a11-f9be-4011-bde0-cc7ace90066a

dnssync.pas

index 1a506d5a93a92676ae1e39695f53554613f2c89b..9a0c2c1cc4cd88bfb9d7ae874f26291865339afc 100644 (file)
@@ -140,7 +140,11 @@ var
 \r
 begin\r
   //init both sockets smultaneously, always, so they get succesive fd's\r
 \r
 begin\r
   //init both sockets smultaneously, always, so they get succesive fd's\r
-  if fd[0] > 0 then exit;\r
+\r
+  {recreate sockets every time, reusing them will fail (hang) if the nameserver is changed\r
+  also changing the nameserver can't possibly work}\r
+  {if fd[0] > 0 then exit;}\r
+  for a := 0 to numsock-1 do if (fd[a] > 0) then closesocket(fd[a]);\r
 \r
   biniptemp := getcurrentsystemnameserverbin(id);\r
   //must get the DNS server here so we know to init v4 or v6\r
 \r
   biniptemp := getcurrentsystemnameserverbin(id);\r
   //must get the DNS server here so we know to init v4 or v6\r