Okey, this is new and better version. Now we handle wait up to hardcoded (for now) value. After wait (IP stack reconf or timeout) we launch 'tinc-up' script. To handle initial TAP device traffic, script is now launched in separate thread. This version works 100% for me under Win2003. ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 16:55:01 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091653050.19164 at cube> I added Web Browser so everyone can peek at commit without cloning whole repo: http://borg.uu3.net/cgit/cgit.cgi/OEM/tinc/log/?h=tap_wait ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 14:27:17 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091400130.16372 at cube> Hello. Yet again I fight with tinc-up script on windows. Long time ago I added hastly commit to fix it: f61fd437ca36ff03cd669726894a09ae4e128427 Unfortunately, its not enough.. So I decided to change aproach. Here it is: git://borg.uu3.net/OEM/tinc.git branch: tap_wait Im using iphlpapi to wait for windows IP stack to settle with newly initialized device. After that, when tinc-up is called, you can for example add extra routing. Without this, any route command will simply fail. There is at least one problem. Tinc will hang when user will use always connected TAP configuration. Work around for that is to get info about media always connected and just do not wait. I could not find a easy way to do so tought. Please do NOT merge it. While it works it needs futher discussion how to handle that issue under windows. Regards, Borg _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel
Okey, after more testing its not working 100% Seems when tinc start when windows is booting, the windows IP stack does a lot of other things and so NotifyAddrChange() returns earlier for other interfaces probably. Seems fixing that is much harder that I expected. More research is needed to correctly fix that. ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Tue, 11 Oct 2016 20:48:00 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610112044420.28949 at cube> Okey, this is new and better version. Now we handle wait up to hardcoded (for now) value. After wait (IP stack reconf or timeout) we launch 'tinc-up' script. To handle initial TAP device traffic, script is now launched in separate thread. This version works 100% for me under Win2003. ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 16:55:01 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091653050.19164 at cube> I added Web Browser so everyone can peek at commit without cloning whole repo: http://borg.uu3.net/cgit/cgit.cgi/OEM/tinc/log/?h=tap_wait ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 14:27:17 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091400130.16372 at cube> Hello. Yet again I fight with tinc-up script on windows. Long time ago I added hastly commit to fix it: f61fd437ca36ff03cd669726894a09ae4e128427 Unfortunately, its not enough.. So I decided to change aproach. Here it is: git://borg.uu3.net/OEM/tinc.git branch: tap_wait Im using iphlpapi to wait for windows IP stack to settle with newly initialized device. After that, when tinc-up is called, you can for example add extra routing. Without this, any route command will simply fail. There is at least one problem. Tinc will hang when user will use always connected TAP configuration. Work around for that is to get info about media always connected and just do not wait. I could not find a easy way to do so tought. Please do NOT merge it. While it works it needs futher discussion how to handle that issue under windows. Regards, Borg _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel
Okey, after more extensive R&D and testing I came up with 2 final solutions: 1) external tool: wipchg 2) internal tincd: wait_device(int secs) Both solution works 100% time (tested on Win2003). I publish them here, so interested parties can do they own testing. 1) ftp://borg.uu3.net/home/borg/tmp/wipchg.tgz You need Mingw compiler to build this. 2) http://borg.uu3.net/cgit/cgit.cgi/OEM/tinc/log/?h=tap_wait Regards, Borg ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Thu, 13 Oct 2016 00:20:05 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610130018020.22461 at cube> Okey, after more testing its not working 100% Seems when tinc start when windows is booting, the windows IP stack does a lot of other things and so NotifyAddrChange() returns earlier for other interfaces probably. Seems fixing that is much harder that I expected. More research is needed to correctly fix that. ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Tue, 11 Oct 2016 20:48:00 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610112044420.28949 at cube> Okey, this is new and better version. Now we handle wait up to hardcoded (for now) value. After wait (IP stack reconf or timeout) we launch 'tinc-up' script. To handle initial TAP device traffic, script is now launched in separate thread. This version works 100% for me under Win2003. ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Re: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 16:55:01 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091653050.19164 at cube> I added Web Browser so everyone can peek at commit without cloning whole repo: http://borg.uu3.net/cgit/cgit.cgi/OEM/tinc/log/?h=tap_wait ---------- Original message ---------- From: borg at uu3.net To: tinc-devel at tinc-vpn.org Subject: Win32: problem with tinc-up script Date: Sun, 9 Oct 2016 14:27:17 +0200 (CEST) Message-ID: <Pine.LNX.4.64.1610091400130.16372 at cube> Hello. Yet again I fight with tinc-up script on windows. Long time ago I added hastly commit to fix it: f61fd437ca36ff03cd669726894a09ae4e128427 Unfortunately, its not enough.. So I decided to change aproach. Here it is: git://borg.uu3.net/OEM/tinc.git branch: tap_wait Im using iphlpapi to wait for windows IP stack to settle with newly initialized device. After that, when tinc-up is called, you can for example add extra routing. Without this, any route command will simply fail. There is at least one problem. Tinc will hang when user will use always connected TAP configuration. Work around for that is to get info about media always connected and just do not wait. I could not find a easy way to do so tought. Please do NOT merge it. While it works it needs futher discussion how to handle that issue under windows. Regards, Borg _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel _______________________________________________ tinc-devel mailing list tinc-devel at tinc-vpn.org https://www.tinc-vpn.org/cgi-bin/mailman/listinfo/tinc-devel