NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/39233: OpenSSH fails to initialize tun(4) tunnels correctly

The following reply was made to PR bin/39233; it has been noted by GNATS.

From: Quentin Garnier <>
To: Taylor R Campbell <>
Subject: Re: bin/39233: OpenSSH fails to initialize tun(4) tunnels correctly
Date: Tue, 29 Jul 2008 16:58:59 +0200

 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 On Tue, Jul 29, 2008 at 10:36:31AM -0400, Taylor R Campbell wrote:
 > @@ -636,20 +639,90 @@
 >      return -1;
 >  }
 > =20
 > +#if defined(__NetBSD__)
 > +
 > +static ssize_t
 > +tun_get_device_name(int tun, int mode, char *buf, size_t buflen)
 Why do you pass "tun" to that function?  I don't see the point.
 Well, there would be a point in the SSH_TUNMODE_ETHERNET case for
 SSH_TUNID_ANY, but you don't use that feature of tap(4).
 > +#elif defined(__OpenBSD__) || defined(__FreeBSD__)
 Is FreeBSD's tun(4) really compatible with OpenBSD's?
 I think (although I'm not 100% certain) we use the OpenBSD version of
 OpenSSH.  The so-called portable version has code that deals with Linux
 and FreeBSD's specificities for tunnel interface handling, so I don't
 think you have to bother here.
 As a matter of fact, I don't think you have to bother at all with
 ifdefs, unless it makes dealing with conflicts for later imports easier,
 but I'm not entirely sure it will be the case.
 But then we have PAM code, so we're probably using a mix of the portable
 and the OpenBSD version...
 > +        if (tun_get_device_name(tun, mode, device, sizeof(device)) =3D=
 =3D -1) {
 > +                debug("%s: no tunnel %d for mode %u", __func__, tun, mod=
 > +            return (-1);
 > +    }
 I really don't see why device can't be a const char * and
 tun_get_device_name would return either something correct or NULL.
 Otherwise it's looking fine.
 Quentin Garnier - -
 "See the look on my face from staying too long in one place
 [...] every time the morning breaks I know I'm closer to falling"
 KT Tunstall, Saving My Face, Drastic Fantastic, 2007.
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 Version: GnuPG v1.4.9 (NetBSD)

Home | Main Index | Thread Index | Old Index