Date: Fri, 31 Jan 1997 14:15:02 +0100 (MET) From: hans@brandinnovators.com (Hans Zuidam) To: hackers@freebsd.org Subject: tunnel device and SIGIO weirdness Message-ID: <199701311315.OAA01068@truk.brandinnovators.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701311315.OAA01068>