Skip to content

Commit

Permalink
openssh: fix tunnel forwarding broken in 7.7p1
Browse files Browse the repository at this point in the history
Uses an upstream patch from
openssh/openssh-portable@b81b2d1

Fixes NixOS#48016.
  • Loading branch information
pvgoran committed Oct 8, 2018
1 parent 89beaef commit adf440c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/tools/networking/openssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ stdenv.mkDerivation rec {

patches =
[
./fix-tunnel-forwarding-broken-in-7.7p1.patch

./locale_archive.patch
./fix-host-key-algorithms-plus.patch

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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)
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 adf440c

Please sign in to comment.