From: Wolfgang Denk Date: Thu, 16 Jul 2009 14:39:59 +0200 Subject: [U-Boot] [PATCH] eth_receive(): Do not assume that caller always wants full packet. In-Reply-To: <200907161151.59353.kosmo@semihalf.com> References: <1247558915-26591-1-git-send-email-kosmo@semihalf.com> <200907151105.45474.vapier@gentoo.org> <200907161151.59353.kosmo@semihalf.com> Message-ID: <20090716123959.F3E34832E416@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Piotr =?iso-8859-2?q?Zi=EAcik?=, In message <200907161151.59353.kosmo@semihalf.com> you wrote: > > > > This patch fixes above problem by allowing partial packet read. > > > > seems like it could easily introduce incorrect behavior in existing > > applications. the code also sounds a bit risky ... your change would mean > > people could read the leading part, but the rest is lost ? > > discaded, if buffer is too small. This behaviour is similar to Linux recv() But recv() is on another level. Here we are dealing with receiving raw ethernet frames. > function. I do not see why we have to force application to prepare 1,5kB > buffer for received packets when for example it waits for ARP reply. Come on - what exactly is the extra effort you have to spend to prepare a bigger buffer? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Pig: An animal (Porcus omnivorous) closely allied to the human race by the splendor and vivacity of its appetite, which, however, is in- ferior in scope, for it balks at pig. - Ambrose Bierce