summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-07-08 20:45:25 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2016-07-08 20:45:32 +0200
commitbcce73b296e6b8e439dd480f50518f6c08ad6910 (patch)
treedf20172c709263d1aa877106b35ae214b055c58b /src
parent8a4a28ebedde10ff6345df6f954299d2247aa19f (diff)
timers: do not consider keepalives to be data sent
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/send.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/send.c b/src/send.c
index f43e4a3..1f63fd9 100644
--- a/src/send.c
+++ b/src/send.c
@@ -127,11 +127,13 @@ struct packet_bundle {
static inline void send_off_bundle(struct packet_bundle *bundle, struct wireguard_peer *peer)
{
struct sk_buff *skb, *next;
+ bool is_keepalive;
for (skb = bundle->first; skb; skb = next) {
/* We store the next pointer locally because socket_send_skb_to_peer
* consumes the packet before the top of the loop comes again. */
next = skb->next;
- if (likely(!socket_send_skb_to_peer(peer, skb, 0 /* TODO: Should we copy the DSCP value from the enclosed packet? */)))
+ is_keepalive = skb->len == message_data_len(0);
+ if (likely(!socket_send_skb_to_peer(peer, skb, 0 /* TODO: Should we copy the DSCP value from the enclosed packet? */) && !is_keepalive))
timers_data_sent(peer);
}
}