Skip to contentSkip to conversation

how to fix bugs in etherboot?

PATCH David Edmondson 2 participants 2 messages Jan 23, 2009

lore
Share & tools
lore
#0 lore raw

Upstream etherboot accepted a patch (attached) to fix wrapping of the TFTP block index. Without the patch we are unable to boot recent Solaris over the network in HVM guests (because our miniroot now exceeds 64k blocks).

Whilst unstable has moved on to gpxe (which doesn't suffer from this problem), it would be useful to us for this to be fixed in the stable series.

Any preferences on the best approach? I can submit changes which include an updated ROM image, the patch and scaffolding to apply it. Or something else.

Quoted 1 line

From df8d6537d7947cbe6fd8176b19e38fd45eef7313 Mon Sep 17 00:00:00 2001

From: David Edmondson <[email protected]>
Date: Thu, 22 Jan 2009 12:19:21 -0500
Subject: [PATCH] [core] Fix wrapping of tftp block index

Handle wrapping of the tftp block index correctly by ensuring that we compare unsigned shorts when examining block index numbers.

---
 src/core/nic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
src/core/nic.c +1 -1
index 6aaa8e2..90dec41 100644
@@ -828,7 +828,7 @@ int tftp_block ( struct tftpreq_info_t *request, struct tftpblk_info_t *block )
 			}
 		} break;
 		case TFTP_DATA :
-			if ( ntohs(rcvd->u.data.block) != ( blockidx + 1 ) )
+			if ( ntohs(rcvd->u.data.block) != (unsigned short)( blockidx + 1 ) )
 				break; /* Re-ACK last block sent */
 			if ( recvlen > ( blksize+sizeof(rcvd->u.data.block) ) )
 				break; /* Too large; ignore */
Signature · 1 line
1.5.6.3

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · David Edmondson

Any preferences on the best approach? I can submit changes which include an updated ROM image, the patch and scaffolding to apply it. Or something else.

Yes, as you describe. Create a patches/ subdir of etherboot/ and apply patches therein just as we do to gpxe in xen-unstable.

-- Keir