Age | Commit message (Collapse) | Author |
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
This structure is required for calling DIF_PROPERTYCHANGE installer
class.
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
More staticcheck fixes:
$ staticcheck ./... | grep S1023
device/noise-helpers.go:45:2: redundant return statement (S1023)
device/noise-helpers.go:54:2: redundant return statement (S1023)
device/noise-helpers.go:64:2: redundant return statement (S1023)
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
Simplification found by staticcheck:
$ staticcheck ./... | grep S1012
device/cookie.go:90:5: should use time.Since instead of time.Now().Sub (S1012)
device/cookie.go:127:5: should use time.Since instead of time.Now().Sub (S1012)
device/cookie.go:242:5: should use time.Since instead of time.Now().Sub (S1012)
device/noise-protocol.go:304:13: should use time.Since instead of time.Now().Sub (S1012)
device/receive.go:82:46: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:132:5: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:139:5: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:235:59: should use time.Since instead of time.Now().Sub (S1012)
device/send.go:393:9: should use time.Since instead of time.Now().Sub (S1012)
ratelimiter/ratelimiter.go:79:10: should use time.Since instead of time.Now().Sub (S1012)
ratelimiter/ratelimiter.go:87:10: should use time.Since instead of time.Now().Sub (S1012)
Change applied using:
$ find . -type f -name "*.go" -exec sed -i "s/Now().Sub(/Since(/g" {} \;
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
It's possible that for whatever reason, we keep returning EOF, resulting
in repeated close/open/write operations, except with empty packets.
|
|
|
|
|
|
Signed-off-by: Matt Layher <mdlayher@gmail.com>
|
|
|
|
|
|
|
|
|
|
- Make foreign interface found error numeric to ease condition
detection.
- Update GetInterface() documentation.
- Make tun.CreateTUN() quit when foreign interface found before
attempting to create a Wintun interface with a duplicate name.
Creation is futile.
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
|
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
|
|
- Make getStringValueRetry() reusable for reading any value type. This
merges code from GetIntegerValueWait().
- expandString() >> toString() and extend to support REG_MULTI_SZ
(to return first value of REG_MULTI_SZ). Furthermore, doing our own
UTF-16 to UTF-8 conversion works around a bug in windows/registry's
GetStringValue() non-zero terminated string handling.
- Provide toInteger() analogous to toString()
- GetStringValueWait() tolerates and reads REG_MULTI_SZ too now. It
returns REG_MULTI_SZ[0], making GetFirstStringValueWait() redundant.
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
It's actually pretty hard to guess where it is.
|
|
|
|
By using RegNotifyChangeKeyValue(). Also disable dead gateway detection.
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
|
|
|
|
The only time we're trying to counteract the race condition is when
we're creating a driver. When we're simply looking up all drivers, it
doesn't make sense to retry.
|
|
This sucks. Can we please find a deterministic way of doing this
instead?
|
|
|
|
There are numerous race conditions. But even this will crash it:
while true; do ifconfig tun0 create; ifconfig tun0 destroy; done
It seems like LLv6 is related, which we're not using anyway, so
explicitly disable it on the interface.
|
|
Signed-off-by: Simon Rozman <simon@rozman.si>
|
|
|
|
Otherwise the race detector "complains".
|
|
|
|
|