aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/send.c')
-rw-r--r--src/send.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/send.c b/src/send.c
index 7a8bea1..0b3ff48 100644
--- a/src/send.c
+++ b/src/send.c
@@ -31,6 +31,8 @@ static void packet_send_handshake_initiation(struct wireguard_peer *peer)
peer->last_sent_handshake = ktime_get_boot_fast_ns();
up_write(&peer->handshake.lock);
+ device_wait_for_awake();
+
net_dbg_ratelimited("%s: Sending handshake initiation to peer %llu (%pISpfsc)\n", peer->device->dev->name, peer->internal_id, &peer->endpoint.addr);
if (noise_handshake_create_initiation(&packet, &peer->handshake)) {
@@ -71,6 +73,8 @@ void packet_send_handshake_response(struct wireguard_peer *peer)
{
struct message_handshake_response packet;
+ device_wait_for_awake();
+
net_dbg_ratelimited("%s: Sending handshake response to peer %llu (%pISpfsc)\n", peer->device->dev->name, peer->internal_id, &peer->endpoint.addr);
peer->last_sent_handshake = ktime_get_boot_fast_ns();
@@ -89,6 +93,8 @@ void packet_send_handshake_cookie(struct wireguard_device *wg, struct sk_buff *i
{
struct message_handshake_cookie packet;
+ device_wait_for_awake();
+
net_dbg_skb_ratelimited("%s: Sending cookie response for denied handshake message for %pISpfsc\n", wg->dev->name, initiating_skb);
cookie_message_create(&packet, initiating_skb, sender_index, &wg->cookie_checker);
socket_send_buffer_as_reply_to_skb(wg, initiating_skb, &packet, sizeof(packet));