Development discussion of WireGuard
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Isaac Nickaein <nickaein.i@gmail.com>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Minor bugs in the sample script for ns-routing
Date: Sat, 8 Feb 2020 22:33:09 +0100	[thread overview]
Message-ID: <CAHmME9qF6hMLctferUuRr-iASHhhM_DkyW-P3wGJL_qOUk0rFw@mail.gmail.com> (raw)
In-Reply-To: <CA+NJmkessNRmWxxST5tZSijVJU4QZevibKZ2XbXEWRCUty54PQ@mail.gmail.com>

On Sat, Feb 8, 2020 at 10:28 PM Isaac Nickaein <nickaein.i@gmail.com> wrote:
>
> The sample script provided at "Routing and Network Namespace
> Intergration" page seems to have a few bugs, at least on Ubuntu 19.10:
>
> 1. The execi command seems to have an extra "exec" at the beginning. Instead of:
>
> exec ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
> \#${SUDO_GID:-$(id -g)} -- "$@"
>
> It should say:
>
> ip netns exec physical sudo -E -u \#${SUDO_UID:-$(id -u)} -g
> \#${SUDO_GID:-$(id -g)} -- "$@"

No. The intent is that the ip process replaces the bash process
without fork(2)+wait(2), via execve(2).

> 2. The "shift" command should be moved into "execi" function.

Why? What does that accomplish? The structure is that the subcommands
inherit their arguments as though they've been called directly.

> 3. dhcpd seems to be replaced by dhclient. It would be nice if the
> script set it (and other configurations) as a variable, e.g. to make
> it easier for user to adopt the script:
>
> DHCP_DAEMON=dhcpd
> WG_IFACE=wgvpn0
> WLAN_IFACE=wlan0
> WLAN_PHY=phy0

You're free to reorganize this to work with any network daemon you
won't. For most users, dhcpcd+wpa_supplicant probably doesn't describe
their network setup, since most folks are in the habit of using large
management tools.
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2020-02-08 21:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08  5:01 Isaac Nickaein
2020-02-08 21:33 ` 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=CAHmME9qF6hMLctferUuRr-iASHhhM_DkyW-P3wGJL_qOUk0rFw@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=nickaein.i@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).