From owner-freebsd-hackers Fri Jan 31 05:51:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA23279 for hackers-outgoing; Fri, 31 Jan 1997 05:51:07 -0800 (PST) Received: from news.IAEhv.nl (root@news.IAEhv.nl [194.151.64.4]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id FAA23274 for ; Fri, 31 Jan 1997 05:51:03 -0800 (PST) Received: from truk.brandinnovators.com (uucp@localhost) by news.IAEhv.nl (8.6.13/1.63) with IAEhv.nl; pid 22910 on Fri, 31 Jan 1997 14:21:26 +0100; id OAA22910 efrom: hans@truk.brandinnovators.com; eto: hackers@freebsd.org Received: by truk.brandinnovators.com (8.7.5/BI96070101) for id OAA01068; Fri, 31 Jan 1997 14:15:02 +0100 (MET) Message-Id: <199701311315.OAA01068@truk.brandinnovators.com> From: hans@brandinnovators.com (Hans Zuidam) Subject: tunnel device and SIGIO weirdness To: hackers@freebsd.org Date: Fri, 31 Jan 1997 14:15:02 +0100 (MET) 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, I've been trying to use the tunnel device for debugging a proprietary TCP/IP stack. In order to simulate interrupts I use the async notification (i.e. SIGIOs) on the fd for the TCP/IP stack. As I ran into something that looks like missing or late arrival of SIGIOs I decided to take a closer look at how SIGIOs are delivered: [net/if_tun.c] if (tp->tun_flags & TUN_ASYNC && tp->tun_pgrp) { if (tp->tun_pgrp > 0) gsignal(tp->tun_pgrp, SIGIO); else if (p = pfind(-tp->tun_pgrp)) psignal(p, SIGIO); } while SIGIOs on sockets are delivered as [kern/uipc_socket2.c] if (so->so_state & SS_ASYNC) { if (so->so_pgid < 0) gsignal(-so->so_pgid, SIGIO); else if (so->so_pgid > 0 && (p = pfind(so->so_pgid)) != 0) psignal(p, SIGIO); } As far as I can see is the delivery of SIGIOs in the tunnel driver wrong. The `... && tp->tun_pgrp) { if (tp->tun_pgrp > 0) ...' looks redundant or in error. Can someone enlighten me? Thanks in advance, 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