summaryrefslogtreecommitdiffhomepage
path: root/tun
AgeCommit message (Collapse)Author
2019-02-20wintun: Add TUN device lockingSimon Rozman
In case reading from TUN device detected TUN device was closed, it closed the file handle and set tunFile to nil. The tunFile is automatically reopened on retry, but... If another packet comes in the WireGuard calls Write() method. With tunFile set to nil, this will cause access violation. Therefore, locking was introduced. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-20wintun: Move exchange buffer in separate struct on heapSimon Rozman
This allows buffer alignment and keeps it together with its meta-data. Furthermore, the write buffer has been reduced - as long as we flush after _every_ write, we don't need a 1MiB write buffer. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-19wintun: Switch to dynamic packet sizesSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-18Change package pathJason A. Donenfeld
2019-02-08wintun: Auto-calculate TUN exchange buffer sizeSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-08wintun: Simplify Read method()Simon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-08wintun: Make constants private and adopt Go recommended caseSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-08wintun: Check for user close in read loop regardless the loadSimon Rozman
Do the WaitForSingleObject() always to provide high-load responsiveness. Reorder events so TUN_SIGNAL_CLOSE has priority over TUN_SIGNAL_DATA_AVAIL, to provide high-load responsiveness at all. Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-08wintun: Adjust tunRWQueue.left member to match Wintun driverSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge _SP_DRVINFO_DETAIL_DATA and DrvInfoDetailDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge SP_DRVINFO_DATA and DrvInfoDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_REMOVEDEVICE_PARAMS to RemoveDeviceParamsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_CLASSINSTALL_HEADER to ClassInstallHeaderSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge _SP_DEVINSTALL_PARAMS and DevInstallParamsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Merge _SP_DEVINFO_LIST_DETAIL_DATA and DevInfoListDetailDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07setupapi: Rename SP_DEVINFO_DATA to DevInfoDataSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Detect if a foreign interface with the same name existsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Clean excessive setupapi.DevInfo.GetDeviceInfoListDetail() callSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Explain rationale behind case-insensitive interface namesSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: Implement TODO in TestSetupDiGetDeviceRegistryProperty()Simon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-07wintun: add FlushInterface stubJason A. Donenfeld
2019-02-07wintun: Compare values of GUID, not pointers, when removingJason A. Donenfeld
2019-02-07wintun: Introduce new package for obscuring Windows bitsJason A. Donenfeld
2019-02-07tun_windows: StyleJason A. Donenfeld
2019-02-06tun_windows: Introduce preliminary TUN interface creationSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-06tun_windows: Stop checking minimum size of received TUN packetsSimon Rozman
Signed-off-by: Simon Rozman <simon@rozman.si>
2019-02-05Fix up errors and pathsJason A. Donenfeld
2019-02-05Import windows scafoldingJason A. Donenfeld
2019-02-05Update copyrightJason A. Donenfeld
2018-12-06tun: remove nonblock hack for linuxJason A. Donenfeld
This is no longer necessary and actually breaks things Reported-by: Chris Branch <cbranch@cloudflare.com>
2018-11-06Use darwin tun on iosJason A. Donenfeld
2018-10-17tun: only call .Fd() onceJason A. Donenfeld
Doing so tends to make the tunnel blocking, so we only retrieve it once before we call SetNonblock, and then cache the result.
2018-09-16global: fix up copyright headersJason A. Donenfeld
2018-07-30Fix duplicate copyright lineJason A. Donenfeld
2018-06-09Do not build tun device on iosJason A. Donenfeld
2018-05-27Disable broadcast mode on *BSDJason A. Donenfeld
Keeping it on makes IPv6 problematic and confuses routing daemons.
2018-05-24Catch EINTRJason A. Donenfeld
2018-05-23Adopt GOPATHJason A. Donenfeld
GOPATH is annoying, but the Go community pushing me to adopt it is even more annoying.
2018-05-23Move tun to subpackageJason A. Donenfeld