mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-22 05:46:30 +03:00
Allow setting IfName to 'none' to run without TUN/TAP
This commit is contained in:
@@ -33,6 +33,9 @@ func (tun *tunDevice) init(core *Core) {
|
||||
func (tun *tunDevice) write() error {
|
||||
for {
|
||||
data := <-tun.recv
|
||||
if tun.iface == nil {
|
||||
continue
|
||||
}
|
||||
if tun.iface.IsTAP() {
|
||||
var frame ethernet.Frame
|
||||
frame.Prepare(
|
||||
@@ -88,5 +91,8 @@ func (tun *tunDevice) read() error {
|
||||
}
|
||||
|
||||
func (tun *tunDevice) close() error {
|
||||
if tun.iface == nil {
|
||||
return nil
|
||||
}
|
||||
return tun.iface.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user