summaryrefslogtreecommitdiff
path: root/sysdep/unix/wg_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix/wg_user.c')
-rw-r--r--sysdep/unix/wg_user.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sysdep/unix/wg_user.c b/sysdep/unix/wg_user.c
index 94060585..878dd49c 100644
--- a/sysdep/unix/wg_user.c
+++ b/sysdep/unix/wg_user.c
@@ -254,13 +254,6 @@ wg_user_set_device(struct pool *pool,
sock->rx_hook = user_rx_hook;
sock->tx_hook = user_tx_hook;
sock->err_hook = user_err_hook;
- int res = sk_connect_unix(sock, path, pathlen);
- DBG(L_TRACE "WG: socket %d %d %s", res, sock->fd, path);
- if (res < 0)
- {
- rfree(sock);
- return -1;
- }
uint tbsize = 8192;
sk_set_tbsize(sock, tbsize);
@@ -276,8 +269,17 @@ wg_user_set_device(struct pool *pool,
rfree(sock);
return -1;
}
+
sock->data = (void*)size;
+ int res = sk_connect_unix(sock, path, pathlen);
+ DBG(L_TRACE "WG: socket %d %d %s", res, sock->fd, path);
+ if (res < 0)
+ {
+ rfree(sock);
+ return -1;
+ }
+
/* abort(); */
return -1;
}