From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Halasa Date: Tue, 03 Nov 2009 00:38:59 +0100 Subject: [U-Boot] Net driver questions In-Reply-To: <200911021753.39366.vapier@gentoo.org> (Mike Frysinger's message of "Mon, 2 Nov 2009 18:53:38 -0400") References: <200911012232.11058.vapier@gentoo.org> <200911021753.39366.vapier@gentoo.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Mike Frysinger writes: >> Let's look... The code does NetSetHandler(TftpHandler). >> I think NetReceive() calls (*packetHandler)() = TftpHandler and this one >> may call NetStartAgain(). > > but this doesnt call recv(), and NetStartAgain() changes the handler, so i > still dont see recursion with the recv() function. but perhaps your > definition of recursive is different from mine. recv() does not turn around > and call recv(), but recv() may turn around and call other driver functions. I haven't debugged it yet (is there a way to print a backtrace?) but the first recv() doesn't return from NetReceive(). > the tftp error behavior is to basically discard all pending packets, so in > practice, it shouldnt be a big deal. it would probably be cleaner though if > the packet handler returned an integer indicating errors that NetReceive() > would pass up so that the driver recv knew to stop processing packets right > away. I think so. I'll look at it too. -- Krzysztof Halasa