mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-24 00:37:49 +00:00
make failed sends a debug log, instead of error
This commit is contained in:
parent
50bd16d524
commit
3b38ed082f
@ -4,6 +4,7 @@ import (
|
||||
"crypto/ed25519"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -290,7 +291,8 @@ func (k *keyStore) writePC(bs []byte) (int, error) {
|
||||
if srcAddr != k.address && srcSubnet != k.subnet {
|
||||
// This happens all the time due to link-local traffic
|
||||
// Don't send back an error, just drop it
|
||||
return 0, nil
|
||||
strErr := fmt.Sprint("incorrect source address: ", net.IP(srcAddr[:]).String())
|
||||
return 0, errors.New(strErr)
|
||||
}
|
||||
buf := make([]byte, 1+len(bs), 65535)
|
||||
buf[0] = typeSessionTraffic
|
||||
|
@ -18,7 +18,7 @@ func (tun *TunAdapter) read() {
|
||||
end := begin + n
|
||||
bs := buf[begin:end]
|
||||
if _, err := tun.core.Write(bs); err != nil {
|
||||
tun.log.Errorln("Unable to send packet:", err)
|
||||
tun.log.Debugln("Unable to send packet:", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user