diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-07-08 20:45:25 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-07-08 20:45:32 +0200 |
commit | f85f2f4bdf4e024aa641b263124b98cf7021b064 (patch) | |
tree | e88fb8542642b9ed3a5c093561dffd2bbc45038d /src/send.c | |
parent | timers: rename *authorized* functions to *authenticated* (diff) | |
download | wireguard-monolithic-historical-f85f2f4bdf4e024aa641b263124b98cf7021b064.tar.xz wireguard-monolithic-historical-f85f2f4bdf4e024aa641b263124b98cf7021b064.zip |
timers: do not consider keepalives to be data sent
Diffstat (limited to 'src/send.c')
-rw-r--r-- | src/send.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); } } |