Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: mikma.wg@lists.m7n.se
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: wireguard-go: IpcGetOperation: return peers in sorted order
Date: Sat, 15 Feb 2020 23:50:24 +0100	[thread overview]
Message-ID: <CAHmME9rPnUPE7g3M7wsAfDw2_U0Gy4eqUWF2bnJ9yyhsHX0D3Q@mail.gmail.com> (raw)
In-Reply-To: <cdf774f4-694e-22ab-966a-c57a1b9ff10a@m7n.se>


[-- Attachment #1.1: Type: text/plain, Size: 1502 bytes --]

The show command presently sorts things based on last handshake time:
https://git.zx2c4.com/wireguard-tools/tree/src/show.c#n27

It sounds like you'd like the output of showconf to be sorted too so that
peers have some stable output order; perhaps you have diffing configs in
mind?

The kernel will output peers in the order that they were added, iirc. Maybe
wireguard-go should do the same?

Alternatively, we could sort this in the showconf code? But then we need
some sorting criteria, and people might wish instead for things to match
the input order of the original file.

In other words, either showconf sorts, or wireguard-go retains its input
order. I think I'd prefer the latter. Do you have a preference?

Jason


On Sat, Feb 15, 2020, 23:42 <mikma.wg@lists.m7n.se> wrote:

> Hello,
>
> I have an improvement to IpcGetOperation in wireguard-go.
>
> uapi: IpcGetOperation: return peers in sorted order
>
> Sort peers based on the public key.
> The pros of using a sorted peer list is that the order doesn't change in
> each ipc operation, or execution of the "wg showconf" command. Which
> could be the case previously with an unsorted peer list.
>
> The output from git format-patch is attached. The patch is also
> available at
>
> https://cgit.m7n.se/pub/wireguard-go/commit/?id=027bf58651f1a7b2be1bedfde187e5277a13f48e
>
> /Mikael
> _______________________________________________
> WireGuard mailing list
> WireGuard@lists.zx2c4.com
> https://lists.zx2c4.com/mailman/listinfo/wireguard
>

[-- Attachment #1.2: Type: text/html, Size: 2508 bytes --]

[-- Attachment #2: Type: text/plain, Size: 148 bytes --]

_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2020-02-15 22:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-15 22:42 mikma.wg
2020-02-15 22:50 ` Jason A. Donenfeld [this message]

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=CAHmME9rPnUPE7g3M7wsAfDw2_U0Gy4eqUWF2bnJ9yyhsHX0D3Q@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=mikma.wg@lists.m7n.se \
    --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).