summaryrefslogtreecommitdiffhomepage
path: root/src/socket.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-19 04:41:13 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-31 17:22:49 +0100
commit0c7763e0e5b1bd6c6aa4087f70fb903a8cdf7c23 (patch)
tree621ae676953e338a9b3f3a6b1953c80638352c9f /src/socket.c
parent1365a28eb2cc1ec0a48c4ed909d23e8db512d329 (diff)
stats: more robust accounting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 8d0e9ca..913ad0a 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -173,6 +173,7 @@ int socket_send_buffer_to_peer(struct wireguard_peer *peer, void *buffer, size_t
return -ENOMEM;
skb_reserve(skb, SKB_HEADER_LEN);
+ skb_set_inner_network_header(skb, 0);
memcpy(skb_put(skb, len), buffer, len);
return socket_send_skb_to_peer(peer, skb, ds);
}
@@ -193,6 +194,7 @@ int socket_send_buffer_as_reply_to_skb(struct wireguard_device *wg, struct sk_bu
if (unlikely(!skb))
return -ENOMEM;
skb_reserve(skb, SKB_HEADER_LEN);
+ skb_set_inner_network_header(skb, 0);
memcpy(skb_put(skb, len), out_buffer, len);
if (endpoint.addr.sa_family == AF_INET)