Permalink
Browse files

Fix tunnel forwarding broken in 7.7p1

bz2855, ok dtucker@
  • Loading branch information...
djmdjm committed Apr 13, 2018
1 parent afa6e79 commit cfb1d9bc76734681e3dea532a1504fcd466fbe91
Showing with 2 additions and 2 deletions.
  1. +2 −2 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);

0 comments on commit cfb1d9b

Please sign in to comment.