summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-net.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-04-13 13:38:06 +1000
committerDamien Miller <djm@mindrot.org>2018-04-13 13:38:06 +1000
commitcfb1d9bc76734681e3dea532a1504fcd466fbe91 (patch)
treeecc9ee1f27227c9f4e75c176fcf74fc9b6c63a0a /openbsd-compat/port-net.c
parentafa6e79b76fb52a0c09a29688b5c0d125eb08302 (diff)
Fix tunnel forwarding broken in 7.7p1
bz2855, ok dtucker@
Diffstat (limited to 'openbsd-compat/port-net.c')
-rw-r--r--openbsd-compat/port-net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c
index 7050629c3..bb535626f 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)
185 else 185 else
186 debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); 186 debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd);
187 187
188 if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) 188 if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
189 goto failed; 189 goto failed;
190 190
191 return (fd); 191 return (fd);
@@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname)
272 goto failed; 272 goto failed;
273 } 273 }
274 274
275 if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) 275 if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL)
276 goto failed; 276 goto failed;
277 277
278 close(sock); 278 close(sock);