mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-16 00:26:58 +02:00
SendVia: don't emit a zero-length packet when prepareSendVia fails
This commit is contained in:
@@ -522,6 +522,11 @@ func (f *Interface) SendVia(via *HostInfo,
|
|||||||
nocopy bool,
|
nocopy bool,
|
||||||
) {
|
) {
|
||||||
toSend, err := f.prepareSendVia(via, relay, ad, nb, out, nocopy)
|
toSend, err := f.prepareSendVia(via, relay, ad, nb, out, nocopy)
|
||||||
|
if err != nil {
|
||||||
|
// already logged by prepareSendVia
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
err = f.writers[0].WriteTo(toSend, via.GetRemote())
|
err = f.writers[0].WriteTo(toSend, via.GetRemote())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
via.logger(f.l).Info("Failed to WriteTo in sendVia", "error", err)
|
via.logger(f.l).Info("Failed to WriteTo in sendVia", "error", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user