From: beware Date: Sat, 10 Dec 2011 16:36:12 +0000 (+0000) Subject: in dnssync, recreate sockets to fix problems when setting/changing custom nameserver X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/096e05689a95dc55ef9f554978c5ea3f263bc919?hp=250fdcdbf77f0296f31391eb3a8b87de195aad92 in dnssync, recreate sockets to fix problems when setting/changing custom nameserver git-svn-id: file:///svnroot/lcore/trunk@110 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/dnssync.pas b/dnssync.pas index 1a506d5..9a0c2c1 100644 --- a/dnssync.pas +++ b/dnssync.pas @@ -140,7 +140,11 @@ var begin //init both sockets smultaneously, always, so they get succesive fd's - if fd[0] > 0 then exit; + + {recreate sockets every time, reusing them will fail (hang) if the nameserver is changed + also changing the nameserver can't possibly work} + {if fd[0] > 0 then exit;} + for a := 0 to numsock-1 do if (fd[a] > 0) then closesocket(fd[a]); biniptemp := getcurrentsystemnameserverbin(id); //must get the DNS server here so we know to init v4 or v6