Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Baptiste Jonglez <baptiste@bitsofnetworks.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: openwrt route_allowed_ips is inprecise
Date: Mon, 19 Dec 2016 14:19:54 +0100	[thread overview]
Message-ID: <20161219131953.GB12378@tuxmachine.polynome.dn42> (raw)
In-Reply-To: <CAHmME9qEg6iBwWpwgT_oPPGymfccuOdAyHv1e4+n5c-O8n9=4g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]

On Mon, Dec 19, 2016 at 02:09:33PM +0100, Jason A. Donenfeld wrote:
> On Mon, Dec 19, 2016 at 2:06 PM, Baptiste Jonglez
> <baptiste@bitsofnetworks.org> wrote:
> > Please provide numbers.  I would be very surprised if a few redundant
> > routes have any performance impact, given that the kernel can handle 600k
> > routes without major issues.
> 
> I'm thinking about the case in which a server has a 10/8 of clients,
> each of which gets a /32. In this case quite a few routes wind up in
> the table...

How many?  What is the performance impact?

> Fortunately the change is pretty easy. Instead of running
> `proto_add_ipv4_route ...` you run:
> 
> [[ $(ip route get "$i") != *dev\ $INTERFACE\ * ]] && proto_add_ipv4_route ...

I really don't like this kind of magic: if there are 42 allowed_ips
entries in the config, then I would expect 42 routes to be created.  If
you don't want them, then just disable route_allowed_ips and add static or
interface routes yourself.

Also, are you sure that this works with busybox's version of "ip"?  What
if "ip" is not enabled in the image?

All in all, since this change is not functionally needed, I don't see the
point of adding the extra complexity and spending the time to test and
maintain this.

Baptiste

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2016-12-19 13:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-18 20:14 Jason A. Donenfeld
2016-12-19  8:00 ` Jörg Thalheim
2016-12-19 12:32   ` Jason A. Donenfeld
2016-12-19 13:06     ` Baptiste Jonglez
2016-12-19 13:09       ` Jason A. Donenfeld
2016-12-19 13:19         ` Baptiste Jonglez [this message]
2016-12-19 13:21           ` Jason A. Donenfeld
2016-12-20  1:13 ` Baptiste Jonglez
2016-12-20  3:14   ` Jason A. Donenfeld
2016-12-20  3:38     ` Dan Luedtke
2016-12-20  4:33       ` Jason A. Donenfeld
2016-12-20  8:52         ` Dan Lüdtke
2016-12-20 10:15           ` Dan Lüdtke
2016-12-20 13:33             ` Jason A. Donenfeld
2016-12-20 14:51               ` Dan Lüdtke
2016-12-20 18:27                 ` Jason A. Donenfeld

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=20161219131953.GB12378@tuxmachine.polynome.dn42 \
    --to=baptiste@bitsofnetworks.org \
    --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).