summaryrefslogtreecommitdiffhomepage
path: root/device/send.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-11 18:13:52 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-11 18:13:52 +0200
commit3371f8dac6fe6bbd7522a8316b50f6473012e302 (patch)
tree85900fb0a804af625c1e1f62264e69ee632cb2a8 /device/send.go
parent41fdbf09710b7987b442e8fd8310568f2790c15b (diff)
device: update transfer counters correctly
The rule is to always update them to the full packet size minus UDP/IP encapsulation for all authenticated packet types.
Diffstat (limited to 'device/send.go')
-rw-r--r--device/send.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/device/send.go b/device/send.go
index 2198427..c4aa5b9 100644
--- a/device/send.go
+++ b/device/send.go
@@ -600,7 +600,6 @@ func (peer *Peer) RoutineSequentialSender() {
// send message and return buffer to pool
- length := uint64(len(elem.packet))
err := peer.SendBuffer(elem.packet)
if len(elem.packet) != MessageKeepaliveSize {
peer.timersDataSent()
@@ -611,7 +610,6 @@ func (peer *Peer) RoutineSequentialSender() {
logError.Println(peer, "- Failed to send data packet", err)
continue
}
- atomic.AddUint64(&peer.stats.txBytes, length)
peer.keepKeyFreshSending()
}