From owner-freebsd-current Mon Aug 31 10:12:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA20680 for freebsd-current-outgoing; Mon, 31 Aug 1998 10:12:44 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA20663 for ; Mon, 31 Aug 1998 10:12:39 -0700 (PDT) (envelope-from seggers@semyam.dinoco.de) Received: (from uucp@localhost) by tim.xenologics.com (8.8.5/8.8.8) with UUCP id TAA26313; Mon, 31 Aug 1998 19:06:33 +0200 (MET DST) Received: from semyam.dinoco.de (semyam.dinoco.de [127.0.0.1]) by semyam.dinoco.de (8.9.1/8.8.8) with ESMTP id SAA22726; Mon, 31 Aug 1998 18:54:42 +0200 (CEST) (envelope-from seggers@semyam.dinoco.de) Message-Id: <199808311654.SAA22726@semyam.dinoco.de> To: Garrett Wollman cc: Stefan Eggers , Kris Kennaway , freebsd-current@FreeBSD.ORG, seggers@semyam.dinoco.de Subject: Re: IPFW showing extra lines In-reply-to: Your message of "Mon, 31 Aug 1998 11:03:39 EDT." <199808311503.LAA26383@khavrinen.lcs.mit.edu> Date: Mon, 31 Aug 1998 18:54:41 +0200 From: Stefan Eggers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > No -- you missed the point of the comment above. The definition of > the API is that we always return the size of the total amount of data > we have, regardless of what the size of the user's buffer is -- Sure? I took a look at the source of ipfw(8) and there it looks like it expects it to be the size of the data returned or it will access data outside the allocated buffer. The latter would be pretty bad of course. getsockopt(2) says pretty much the same if I understand it correctly: for the requested option(s) are to be returned. For getsockopt(), optlen is a value-result parameter, initially containing the size of the buffer pointed to by optval, and modified on return to indicate the actual size of the value returned. If no option value is to be supplied or returned, I think the actual size of the returned value is the size of the result we copied to user space. Otherwise the wording has to be revised (made more precise) and ipfw fixed. Stefan. -- Stefan Eggers Lu4 yao2 zhi1 ma3 li4, Max-Slevogt-Str. 1 ri4 jiu3 jian4 ren2 xin1. 51109 Koeln Federal Republic of Germany To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message