From owner-freebsd-hackers Fri Dec 20 05:10:20 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id FAA19562 for hackers-outgoing; Fri, 20 Dec 1996 05:10:20 -0800 (PST) Received: from news.IAEhv.nl (root@news.IAEhv.nl [194.151.64.4]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id FAA19555 for ; Fri, 20 Dec 1996 05:10:11 -0800 (PST) Received: from truk.brandinnovators.com (uucp@localhost) by news.IAEhv.nl (8.6.13/1.63) with IAEhv.nl; pid 9704 on Fri, 20 Dec 1996 13:43:19 +0100; id NAA09704 efrom: hans@truk.brandinnovators.com; eto: freebsd-hackers@freebsd.org Received: by truk.brandinnovators.com (8.7.5/BI96070101) for id NAA00973; Fri, 20 Dec 1996 13:38:50 GMT Message-Id: <199612201338.NAA00973@truk.brandinnovators.com> From: hans@brandinnovators.com (Hans Zuidam) Subject: FIONREAD on tunnel device? To: freebsd-hackers@freebsd.org Date: Fri, 20 Dec 1996 13:38:50 +0000 () X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi, While playing with a proprietary TCP/IP stack connected to FreeBSD-2.1.5R I think I stumbled into a bug. When I do: ioctl(fd, FIONREAD, &len); read(fs, buf, len); buf ends up with less data than when I do: len = read(fs, buf, MAXINT); /* or some other large number... */ The problem (as far as I can see) is that (in if_tun.c) FIONREAD returns: tp->tun_if.if_snd.ifq_head->m_len while it should probably be: tp->tun_if.if_snd.ifq_head->m_pkthdr.len Regards, Hans -- H. Zuidam E-Mail: hans@brandinnovators.com Brand Innovators B.V. P-Mail: P.O. Box 1377 de Pinckart 54 5602 BJ Eindhoven, The Netherlands 5674 CC Nuenen Tel. +31 40 2631134, Fax. +31 40 2831138