From owner-freebsd-bugs Wed Jun 2 3: 0: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 4218614DF2 for ; Wed, 2 Jun 1999 03:00:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id DAA66509; Wed, 2 Jun 1999 03:00:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Wed, 2 Jun 1999 03:00:02 -0700 (PDT) Message-Id: <199906021000.DAA66509@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Brian Somers Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Reply-To: Brian Somers Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/11988; it has been noted by GNATS. From: Brian Somers To: Tony Finch Cc: FreeBSD-gnats-submit@freebsd.org Subject: Re: kern/11988: recvmsg with a cmsghdr but no iovec is broken Date: Wed, 02 Jun 1999 10:58:41 +0100 > > >Number: 11988 > >Category: kern > >Synopsis: recvmsg with a cmsghdr but no iovec is broken [.....] This has been the case for some time - since before I implemented multi-link ppp. When I was writing it, I attempted to do exactly what you're doing and then to write() all my link configuration data. Things failed badly so I ended up merging everything into a single sendmsg()/recvmsg(). I'm afraid I have nothing fantastic to say (except to confirm that the problem exists, and has done for some time). One other observation (a problem I suffered with for some time); you *must* have some sort of handshake to confirm that the descriptor has been received. If you call close(conn) while the descriptor is still in limbo (an mbuf) the descriptor will arrive at the other end ready to give you EBADF next time you use it. A simple read(child, &ch, 1) after sendmsg() and before the close(conn) and a write(3, "X", 1) after the recvmsg() will do the trick. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message