From owner-freebsd-hackers Sun Aug 30 08:08:08 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA27967 for freebsd-hackers-outgoing; Sun, 30 Aug 1998 08:08:08 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fledge.watson.org (COPLAND.CODA.CS.CMU.EDU [128.2.222.48]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA27962 for ; Sun, 30 Aug 1998 08:08:07 -0700 (PDT) (envelope-from robert@cyrus.watson.org) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.8.8/8.8.8) with SMTP id LAA05097; Sun, 30 Aug 1998 11:04:54 -0400 (EDT) Date: Sun, 30 Aug 1998 11:04:53 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org Reply-To: Robert Watson To: Alex Belits cc: Craig Anderson , freebsd-hackers@FreeBSD.ORG, brhall@timing.com Subject: Re: Help with passing fd on FreeBSD In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have a set of patches that try to clean up the fd-passing behavior in 3.0-CURRENT. I originally wrote them to allow the passing of kernel authorization tokens (http://www.watson.org/fbsd-hardening/tokens/). These patches allow lkm's to hook the externalize, internalize, and gc functions. However, in the process of writing this, I have fixed at least a few potential problems. A few were just coding issues (like some underlying assumptions about the size of mbufs and so on). I have not fixed the bug described in the BSD4.4 book (sorry, don't have it with me so don't have a page number) w.r.t. garbage collecting fd's in listening sockets. Passing tokens seems to work quite well for me. Is the mbuf problem you reported fixable by adding a sleep waiting for an mbuf? On Sat, 29 Aug 1998, Alex Belits wrote: > On Fri, 28 Aug 1998, Craig Anderson wrote: > > > Can someone give me pointers on passing open file descriptors on FreeBSD? > > This is covered in W. Richard Stevens Advanced programming book, but > > See R. Stevens "TCP/IP Illustrated", volume 3, chapter 18.3 > or R. Stevens "Unix Network Programming", second edition (1997), volume 1, > chapter 14.7. > > Previous books describe 4.3BSD and SVR4 fd passing that is more than > slightly different. > > > the structs in FreeBSD are slightly different, and I've never done this. > > In FreeBSD CMSG_DATA(cm) macro is the equivalent to cm->cmsg_data that is > commented out in include files in 4.4BSD-derived, but exists in > other compatible systems. > > Beware of the known bug in FreeBSD kernel (PR kern/4345). > > -- > Alex > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Robert N Watson Carnegie Mellon University http://www.cmu.edu/ TIS Labs at Network Associates, Inc. http://www.tis.com/ SafePort Network Services http://www.safeport.com/ robert@fledge.watson.org http://www.watson.org/~robert/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message