diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-05-14 19:00:30 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-01-12 23:34:24 +0100 |
commit | b4380098f3a901e8d76cef43da30540a6352682a (patch) | |
tree | 66f432f90d9e4223b9dfcbb17240caa13adf9488 | |
parent | ae5f9c701bcdae8f65e15b9f56ffd6bc7354a8fd (diff) |
Wg-user: Fix unix socket
And enable fast_rx.
-rw-r--r-- | sysdep/unix/wg_user.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sysdep/unix/wg_user.c b/sysdep/unix/wg_user.c index 6920d9ef..e7144d20 100644 --- a/sysdep/unix/wg_user.c +++ b/sysdep/unix/wg_user.c @@ -254,13 +254,7 @@ 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; - } + sock->fast_rx = 1; uint tbsize = 8192; sk_set_tbsize(sock, tbsize); @@ -276,8 +270,17 @@ wg_user_set_device(struct pool *pool, rfree(sock); return -1; } + sock->data = (void*)(uintptr_t)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; } |