Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Matt Layher <mdlayher@gmail.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	Devanath S <s.devanath@gmail.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: wireguard-go on windows
Date: Thu, 25 Feb 2021 15:14:58 -0500	[thread overview]
Message-ID: <f9d3c90b-57d7-a0fb-2c28-9a5ba8b8e103@gmail.com> (raw)
In-Reply-To: <CAHmME9qNVFuf170GEObu1_d=F=snG94qE1Y+KWZJ5DEeL_14Vg@mail.gmail.com>

A glance at 
https://github.com/WireGuard/wgctrl-go/blob/master/internal/wguser/parse.go#L48 
seems to indicate that we treat the first "blank" line produced by 
bufio.Scanner (which strips \n) as a sentinel to stop parsing, which 
would mean something like "errno=0\n\n" would parse the errno and be 
done once it interprets the final line "\n".

The tests seem to indicate this works as expected, but I don't regularly 
develop on Windows and welcome PRs if something has changed.
- Matt

On 2/25/21 12:54 PM, Jason A. Donenfeld wrote:
> + Matt Layher
>
> Hi Davanath,
>
>> We are trying to use wgctrl way of configuring the wireguard devices
>> and facing issues while creating/configuring the wireguard device on
>> windows.
>>
>> 1) First problem was while creating the wintun device using wintun.dll
>> and using wgctrl for configuring it.  It hangs in
>> wgclient.ConfigureDevice api()
> wgctrl works with wireguard. wireguard uses wintun, but wireguard is not wintun.
>
>> 2) So tried to first create the device through wireguard.exe. And then
>> used wgctrl way to configure it, but wgClient.Devices() is not able to
>> get the devices on our test windows boxes (even though it works on my
>> development machine)
> This sounds like a potential bug in wgctrl.
>
> Matt -- I wonder if there's a bug in the parser, recently unearthed by
> a change in wireguard-go. Specifically, uapi stipulates that requests
> and responses end with \n\n. Is it possible that you're relying on the
> socket to EOF, instead of looking for the \n\n? Recent wireguard-go
> keeps the socket open, in case you want to send one request after
> another.
>
> Jason

  reply	other threads:[~2021-02-25 20:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25  6:30 Devanath S
2021-02-25 15:53 ` Jason A. Donenfeld
     [not found]   ` <CADjMg7VHCX04+UgCY4AwLub5=otDJ9dTHMLdX16OVDZoDG88xQ@mail.gmail.com>
2021-02-25 16:42     ` Fwd: " Devanath S
2021-02-25 17:54       ` Jason A. Donenfeld
2021-02-25 20:14         ` Matt Layher [this message]
2021-02-25 20:21           ` Devanath S
2021-09-12 15:07 ` Devanath S

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=f9d3c90b-57d7-a0fb-2c28-9a5ba8b8e103@gmail.com \
    --to=mdlayher@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=s.devanath@gmail.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).