From owner-freebsd-current Mon Aug 31 08:04:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA01822 for freebsd-current-outgoing; Mon, 31 Aug 1998 08:04:51 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA01817 for ; Mon, 31 Aug 1998 08:04:49 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.1/8.9.1) id LAA26383; Mon, 31 Aug 1998 11:03:39 -0400 (EDT) (envelope-from wollman) Date: Mon, 31 Aug 1998 11:03:39 -0400 (EDT) From: Garrett Wollman Message-Id: <199808311503.LAA26383@khavrinen.lcs.mit.edu> To: Stefan Eggers Cc: Kris Kennaway , freebsd-current@FreeBSD.ORG Subject: Re: IPFW showing extra lines In-Reply-To: <199808310622.IAA01965@semyam.dinoco.de> References: <199808302055.WAA02656@semyam.dinoco.de> <199808310622.IAA01965@semyam.dinoco.de> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG < said: >> From my patch: >> valsize = len; >> if (sopt->sopt_valsize < valsize) { >> valsize = sopt->sopt_valsize; >> - sopt->sopt_valsize = len; >> } >> + sopt->sopt_valsize = len; > And here the correct fix should have been "= valsize" instead of "= > len" - otherwise the result length might end up being larger than the > buffer provided. I think then the fix is OK. 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 -- indeed, they can supply a null buffer in order to find out how much space they must allocate to hold it all. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, CRS, or NSA| - Susan Aglukark and Chad Irschick To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message