From 3d0e42005d3bf786341ab96cfa1788bc601faa12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 16 May 2018 13:59:58 +0000 Subject: [PATCH] Import upstream commit cfb1d9b, which fixes tunnel forwarding. --- openbsd-compat/port-net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c index 7050629c31f7..bb535626ffe0 100644 --- a/openbsd-compat/port-net.c +++ b/openbsd-compat/port-net.c @@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname) else debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; return (fd); @@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname) goto failed; } - if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) + if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) goto failed; close(sock);