diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-07-08 20:34:32 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2016-07-10 03:46:56 +0200 |
commit | 2e1bceea1388e2bd57b4ef17fb21190a8755d71e (patch) | |
tree | 4ed954d5f2877adbe474e82c7564e6b612f86796 /src/socket.c | |
parent | 4a5231e2ba26f8567faffe2fac83fe8cabf52160 (diff) |
persistent keepalive: use authenticated keepalives
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/socket.c b/src/socket.c index 5b7bbf8..ac19a47 100644 --- a/src/socket.c +++ b/src/socket.c @@ -4,7 +4,6 @@ #include "socket.h" #include "packets.h" #include "messages.h" -#include "timers.h" #include <linux/net.h> #include <linux/if_vlan.h> @@ -251,10 +250,8 @@ int socket_send_skb_to_peer(struct wireguard_peer *peer, struct sk_buff *skb, u8 read_lock_bh(&peer->endpoint_lock); ret = send(dev, skb, dst, &peer->endpoint_flow.fl4, &peer->endpoint_flow.fl6, &peer->endpoint_addr, rcu_dereference(peer->device->sock4), rcu_dereference(peer->device->sock6), dscp); - if (!ret) { - timers_any_packet_sent(peer); + if (!ret) peer->tx_bytes += skb_len; - } read_unlock_bh(&peer->endpoint_lock); rcu_read_unlock(); @@ -268,8 +265,7 @@ int socket_send_buffer_to_peer(struct wireguard_peer *peer, void *buffer, size_t if (!skb) return -ENOMEM; skb_reserve(skb, SKB_HEADER_LEN); - if (likely(buffer)) - memcpy(skb_put(skb, len), buffer, len); + memcpy(skb_put(skb, len), buffer, len); return socket_send_skb_to_peer(peer, skb, dscp); } |