Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Laura Zelenku <laura.zelenku@wandera.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] device: revert pipelining UAPI requests
Date: Tue, 9 Mar 2021 17:30:32 +0100	[thread overview]
Message-ID: <3A2A1B3E-75FB-4CCA-A7B9-FC7C02B7E9DB@wandera.com> (raw)
In-Reply-To: <CAHmME9rakmzN2ndkXchvcRXONjfk4ikJScWCSEYzNR8+1ow03w@mail.gmail.com>

Hi Jason,
I’m just using “wg-quick up wg0” command on Linux env with NO kernel module, just userspace implementation.
My config file looks like:
[Interface]
PrivateKey = ….mEw=
Address = fddd:dddd:1000::1/128
DNS = fddd:dddd::
MTU = 1420
[Peer]
PublicKey = …..pC0=
AllowedIPs = fd53::/32,fddd:dddd::/128
Endpoint = dev.wandera.com:3005
PersistentKeepalive = 25

In the command output you can see that "wg setconf wg0 /dev/fd/63” stucked and no following commands (set IP address, set MTU, …) are processed.
The output is:

# wg-quick up wg0
[#] ip link add wg0 type wireguard
RTNETLINK answers: Not supported
[!] Missing WireGuard kernel module. Falling back to slow userspace implementation.
[#] /wireguard/wireguard-go wg0
┌───────────────────────────────────────────────────┐
│                                                   │
│   Running this software on Linux is unnecessary,  │
│   because the Linux kernel has built-in first     │
│   class support for WireGuard, which will be      │
│   faster, slicker, and better integrated. For     │
│   information on installing the kernel module,    │
│   please visit: <https://wireguard.com/install>.  │
│                                                   │
└───────────────────────────────────────────────────┘
DEBUG: (wg0) 2021/03/09 13:11:41 Starting wireguard-go version 0.0.20210212-dirty
DEBUG: (wg0) 2021/03/09 13:11:41 Starting wireguard-go version 0.0.20210212-dirty
DEBUG: (wg0) 2021/03/09 13:11:41 Device started
DEBUG: (wg0) 2021/03/09 13:11:41 UAPI listener started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: decryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: encryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: decryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: handshake worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: encryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: handshake worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: handshake worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: encryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: decryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: decryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: encryption worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: handshake worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: TUN reader - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: event worker - started
DEBUG: (wg0) 2021/03/09 13:11:41 Interface up requested
DEBUG: (wg0) 2021/03/09 13:11:41 UDP bind has been updated
DEBUG: (wg0) 2021/03/09 13:11:41 Interface state was Down, requested Up, now Up
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv6 - started
[#] wg setconf wg0 /dev/fd/63
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv4 - started
DEBUG: (wg0) 2021/03/09 13:11:41 UAPI: Updating private key
DEBUG: (wg0) 2021/03/09 13:11:41 UAPI: Updating listen port
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv4 - stopped
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv6 - stopped
DEBUG: (wg0) 2021/03/09 13:11:41 UDP bind has been updated
DEBUG: (wg0) 2021/03/09 13:11:41 UAPI: Updating fwmark
DEBUG: (wg0) 2021/03/09 13:11:41 UAPI: Removing all peers
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Starting...
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Created
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Updating endpoint
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Updating persistent keepalive interval
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Sending keepalive packet
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Sending handshake initiation
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Removing all allowedips
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Adding allowedip
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - UAPI: Adding allowedip
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Routine: sequential receiver - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv4 - started
DEBUG: (wg0) 2021/03/09 13:11:41 Routine: receive incoming IPv6 - started
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Routine: sequential sender - started
DEBUG: (wg0) 2021/03/09 13:11:41 peer(0DIu…qpC0) - Received handshake response
DEBUG: (wg0) 2021/03/09 13:11:42 Interface up requested
DEBUG: (wg0) 2021/03/09 13:11:43 Interface up requested
DEBUG: (wg0) 2021/03/09 13:11:44 Interface up requested
DEBUG: (wg0) 2021/03/09 13:11:45 Interface up requested

As I’m thinking about proper fix I have no idea. The solution would also be to “return” after first set command (no second loop processing).

Laura


> On 9 Mar 2021, at 16:09, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> 
> On Tue, Mar 9, 2021 at 8:04 AM Laura Zelenku <laura.zelenku@wandera.com> wrote:
>> 
>> Hello devs,
>> there is an issue when using wg-quick tool and wg tool bellow from wireguard-tools repository (version v1.0.20210223). I’m running: wg-quick up operation with config file in /etc/wireguard/ directory. Get operations are ok. Processed without a problem. But for Set operation the processing will stuck on "buffered.ReadString('\n’)” (in the second run of for loop cycle, after set command is processed in first for loop cycle) because bufio.Scanner will read everything from the socket.
> 
> I'm unable to reproduce this issue. Can you send a small shell script
> that does so?
> 
>> Please revert till proper fix is ready.
> 
> How hard can a proper fix be? Can't we just commit the actual fix instead?
> 
> Jason


-- 
*IMPORTANT NOTICE*: This email, its attachments and any rights attaching 
hereto are confidential and intended exclusively for the person to whom the 
email is addressed. If you are not the intended recipient, do not read, 
copy, disclose or use the contents in any way. Wandera accepts no liability 
for any loss, damage or consequence resulting directly or indirectly from 
the use of this email and attachments.

  reply	other threads:[~2021-03-09 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09 15:02 Laura Zelenku
2021-03-09 15:09 ` Jason A. Donenfeld
2021-03-09 16:30   ` Laura Zelenku [this message]
2021-03-09 16:33     ` Jason A. Donenfeld
2021-03-10 12:13       ` Laura Zelenku

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A2A1B3E-75FB-4CCA-A7B9-FC7C02B7E9DB@wandera.com \
    --to=laura.zelenku@wandera.com \
    --cc=Jason@zx2c4.com \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).