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 <cube%cubidou.net@localhost>
To: Taylor R Campbell <campbell%mumble.net@localhost>
Cc: gnats-bugs%NetBSD.org@localhost
Subject: Re: bin/39233: OpenSSH fails to initialize tun(4) tunnels correctly
Date: Tue, 29 Jul 2008 16:58:59 +0200
--SLfjTIIQuAzj8yil
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=
e);
> + 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.
--=20
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"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.
--SLfjTIIQuAzj8yil
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (NetBSD)
iQEcBAEBAgAGBQJIjzAzAAoJENgoQloHrPnojr0H/14HHO1hHz1obxLQqQQ0auI8
9EdqwXAd+H94KQf3vO3Msn4MPXlItazACPz5uNhRzdan3VNyzcixBP7zl8go8YHv
OGZ0eARTY6dA0x+1SYrVXkVKzwFK9RSCjVy6hKzzD6HhmDq6PbfYDqpOxCp5qNrC
FwRRDNn219nafr8nUPKc/vxOXwJR/SCHVVylW+ZCQtrsKqoCCJz3OG5rRCvudZbY
5t2emhnYFZ6JYktKqQO/a6WfdD/xZPVmEQqZCiWoJ23FzqFSfOd0x0L/nXSo377Z
49s/HLoxnbpJYCy+6R4bEPlesvb/VOG+bx5k6tdZS/875NDM+1X4EiklJWx2Z54=
=WWOp
-----END PGP SIGNATURE-----
--SLfjTIIQuAzj8yil--
Home |
Main Index |
Thread Index |
Old Index