-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed wait for TUN to come up #1157
Fixed wait for TUN to come up #1157
Conversation
BTW, in RiV-mesh they've ditched the waiting for event too. And added a crutch:
|
Maybe I'm blind, but I don't even see any events like TunUp in the sources: |
src/tun/tun_windows.go
Outdated
} | ||
if !waitForTUNUp(iface.Events()) { | ||
return fmt.Errorf("TUN did not come up in time") | ||
tun.log.Printf("Creating TUN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe don't need so many logging lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this line, but I think it is better to leave the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
So, the function waiting for TUN to come up never succeeds:
I've tried the sleep for one second, and it works flawlessly on several PCs.
Another point - sometimes, if the service stop abruptly (in case of some errors) there is an old hidden device in the system, that we need to uninstall, and then create new.