Date: Mon, 31 Aug 1998 11:03:39 -0400 (EDT) From: Garrett Wollman <wollman@khavrinen.lcs.mit.edu> To: Stefan Eggers <seggers@semyam.dinoco.de> Cc: Kris Kennaway <kkennawa@physics.adelaide.edu.au>, freebsd-current@FreeBSD.ORG Subject: Re: IPFW showing extra lines Message-ID: <199808311503.LAA26383@khavrinen.lcs.mit.edu> In-Reply-To: <199808310622.IAA01965@semyam.dinoco.de> References: <199808302055.WAA02656@semyam.dinoco.de> <199808310622.IAA01965@semyam.dinoco.de>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Mon, 31 Aug 1998 08:22:40 +0200, Stefan Eggers <seggers@semyam.dinoco.de> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808311503.LAA26383>