[Etherboot-developers] signed comparison bug
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Philip R. A. <pr...@eg...> - 2002-03-14 19:48:38
|
Hi Etherboot folks,
I recently came across a bug in the kernel loading code
in 4.6.7 that seems to be still present in 5.0.5. I haven't tested the
later one, but that part of the code is the same.
The problem is the unsigned short block number, prevblock is being promoted
to signed int in a comparison :
main.c:656
if ((block || bcounter) && (block != prevblock+1)) {
/* Block order should be continuous */
tp.u.ack.block = htons(block = prevblock);
}
if ((block || bcounter) && (block != (unsigned short) (prevblock+1))) {
fixes the problem. It was preventing the block number roll over from working.
(tftpd version also needs to be 0.17 or greater, it has a similar problem).
Cheers,
Phil
--
Philip R. Auld, Ph.D. Technical Staff
Egenera Corp. pa...@eg...
165 Forest St., Marlboro, MA 01752 (508)786-9444
|