From owner-freebsd-bugs Wed Sep 19 22:20: 8 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from prism.flugsvamp.com (cb58709-a.mdsn1.wi.home.com [24.17.241.9]) by hub.freebsd.org (Postfix) with ESMTP id 6F1E437B411 for ; Wed, 19 Sep 2001 22:20:05 -0700 (PDT) Received: (from jlemon@localhost) by prism.flugsvamp.com (8.11.0/8.11.0) id f8K5I8e08579; Thu, 20 Sep 2001 00:18:08 -0500 (CDT) (envelope-from jlemon) Date: Thu, 20 Sep 2001 00:18:08 -0500 (CDT) From: Jonathan Lemon Message-Id: <200109200518.f8K5I8e08579@prism.flugsvamp.com> To: knotwell@ix.netcom.com, bugs@freebsd.org Subject: Re: kern/30634: kevent.data value incorrect for UDP sockets X-Newsgroups: local.mail.freebsd-bugs In-Reply-To: Organization: Cc: Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article you write: >>Description: >When kevent returns a read event for a UDP socket, the data field (AKA >the number of bytes to be read) is 16 bytes too long. This is happening because UDP places the sockaddr of the sending host in the data buffer. 16 bytes == sizeof(struct sockaddr_in). There isn't a quick fix for this because the kernel doesn't keep the data and addresses separate; there is only a single counter to indicate how much data is in the buffer. Getting an accurate count of the data would require walking the mbuf buffer chain (expensive) or changing the code to keep track of the counts separately. -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message