wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Julian Orth <ju.orth@gmail.com>
To: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH v5 07/11] netlink: allow modification of transit net
Date: Mon, 17 Dec 2018 15:52:06 +0100	[thread overview]
Message-ID: <88c5a857-187b-54b8-d15b-30d3be981085@gmail.com> (raw)
In-Reply-To: <20181215165613.5486-8-ju.orth@gmail.com>

On 12/15/18 5:56 PM, Julian Orth wrote:
> +	ret = test_socket_net_capable(net ? : wg->transit_net);
I forgot to include the fix mentioned in [1]. I have fixed the commit in the
repository and I'll include the diff below.

diff --git a/src/netlink.c b/src/netlink.c
index f5c3a9e..90ff936 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -350,14 +350,20 @@ static int wg_get_device_done(struct netlink_callback *cb)

 static int set_socket(struct wg_device *wg, struct nlattr **attrs)
 {
-	struct wg_peer *peer;
-	struct nlattr *port_attr = attrs[WGDEVICE_A_LISTEN_PORT];
-	u16 port;
+	struct nlattr *netns_pid_attr, *netns_fd_attr, *port_attr;
 	struct net *net = NULL;
+	struct wg_peer *peer;
 	int ret = 0;
+	u16 port;
+
+	netns_pid_attr = attrs[WGDEVICE_A_TRANSIT_NETNS_PID];
+	netns_fd_attr = attrs[WGDEVICE_A_TRANSIT_NETNS_FD];
+	port_attr = attrs[WGDEVICE_A_LISTEN_PORT];
+
+	if (!netns_pid_attr && !netns_fd_attr && !port_attr)
+		return 0;

-	net = get_attr_net(attrs[WGDEVICE_A_TRANSIT_NETNS_PID],
-			attrs[WGDEVICE_A_TRANSIT_NETNS_FD]);
+	net = get_attr_net(netns_pid_attr, netns_fd_attr);
 	if (IS_ERR(net))
 		return PTR_ERR(net);
 	if (port_attr)

[1] https://lists.zx2c4.com/pipermail/wireguard/2018-October/003459.html
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

  reply	other threads:[~2018-12-17 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-15 16:56 [PATCH v5 00/11] Allow changing the transit namespace Julian Orth
2018-12-15 16:56 ` [PATCH v5 01/11] netlink: check for CAP_NET_ADMIN manually Julian Orth
2018-12-15 16:56 ` [PATCH v5 02/11] netlink: allow specifying the device namespace Julian Orth
2018-12-15 16:56 ` [PATCH v5 03/11] netlink: restrict access to the UDP socket Julian Orth
2018-12-15 16:56 ` [PATCH v5 04/11] device: rename creating_net to transit_net Julian Orth
2018-12-15 16:56 ` [PATCH v5 05/11] device: store a copy of the device net Julian Orth
2018-12-15 16:56 ` [PATCH v5 06/11] socket: allow modification of transit_net Julian Orth
2018-12-15 16:56 ` [PATCH v5 07/11] netlink: allow modification of transit net Julian Orth
2018-12-17 14:52   ` Julian Orth [this message]
2018-12-15 16:56 ` [PATCH v5 08/11] tools: add framework for shared options Julian Orth
2018-12-15 16:56 ` [PATCH v5 09/11] tools: allow specifying the device namespace Julian Orth
2018-12-15 16:56 ` [PATCH v5 10/11] tools: allow modification of transit net Julian Orth
2018-12-15 16:56 ` [PATCH v5 11/11] tests: add test for transit-net Julian Orth

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=88c5a857-187b-54b8-d15b-30d3be981085@gmail.com \
    --to=ju.orth@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).