Index: etherboot-5.4.3/src/core/nic.c
===================================================================
--- etherboot-5.4.3.orig/src/core/nic.c	2008-07-31 12:31:45.000000000 -0700
+++ etherboot-5.4.3/src/core/nic.c	2008-07-31 12:32:01.000000000 -0700
@@ -505,6 +505,56 @@
 	return 1;
 }
 
+int arp_ip(unsigned long destip)
+{
+	struct arprequest arpreq;
+	int arpentry, i;
+	int retry;
+
+	if (destip == IP_BROADCAST)
+		goto success;
+	if (((destip & netmask) !=
+		(arptable[ARP_CLIENT].ipaddr.s_addr & netmask)) &&
+		arptable[ARP_GATEWAY].ipaddr.s_addr)
+			destip = arptable[ARP_GATEWAY].ipaddr.s_addr;
+	for(arpentry = 0; arpentry<MAX_ARP; arpentry++) {
+		if (arptable[arpentry].ipaddr.s_addr == destip) break;
+		if (arpentry >= ARP_EXTRA0 && arptable[arpentry].ipaddr.s_addr == 0) {
+			arptable[arpentry].ipaddr.s_addr = destip;
+			break;
+		}
+	}
+	if (arpentry == MAX_ARP) {
+		printf("%@ is not in my arp table!\n", destip);
+		return(0);
+	}
+	for (i = 0; i < ETH_ALEN; i++)
+		if (arptable[arpentry].node[i])
+			break;
+	if (i == ETH_ALEN) {	/* Need to do arp request */
+		arpreq.hwtype = htons(1);
+		arpreq.protocol = htons(IP);
+		arpreq.hwlen = ETH_ALEN;
+		arpreq.protolen = 4;
+		arpreq.opcode = htons(ARP_REQUEST);
+		memcpy(arpreq.shwaddr, arptable[ARP_CLIENT].node, ETH_ALEN);
+		memcpy(arpreq.sipaddr, &arptable[ARP_CLIENT].ipaddr, sizeof(in_addr));
+		memset(arpreq.thwaddr, 0, ETH_ALEN);
+		memcpy(arpreq.tipaddr, &destip, sizeof(in_addr));
+		for (retry = 1; retry <= MAX_ARP_RETRIES; retry++) {
+			long timeout;
+			eth_transmit(broadcast, ETH_P_ARP, sizeof(arpreq),
+				&arpreq);
+			timeout = rfc2131_sleep_interval(TIMEOUT, retry);
+			if (await_reply(await_arp, arpentry,
+				arpreq.tipaddr, timeout)) goto success;
+		}
+		return(0);
+	}
+success:
+	return(1);
+}
+
 int ip_transmit(int len, const void *buf)
 {
 	unsigned long destip;
@@ -535,8 +585,13 @@
 			(arptable[ARP_CLIENT].ipaddr.s_addr & netmask)) &&
 			arptable[ARP_GATEWAY].ipaddr.s_addr)
 				destip = arptable[ARP_GATEWAY].ipaddr.s_addr;
-		for(arpentry = 0; arpentry<MAX_ARP; arpentry++)
+		for(arpentry = 0; arpentry<MAX_ARP; arpentry++) {
 			if (arptable[arpentry].ipaddr.s_addr == destip) break;
+			if (arpentry >= ARP_EXTRA0 && arptable[arpentry].ipaddr.s_addr == 0) {
+				memcpy ( &arptable[arpentry].ipaddr, &ip->dest.s_addr, sizeof(in_addr) );
+				break;
+			}
+		}
 		if (arpentry == MAX_ARP) {
 			printf("%@ is not in my arp table!\n", destip);
 			return(0);
Index: etherboot-5.4.3/src/core/pxe_export.c
===================================================================
--- etherboot-5.4.3.orig/src/core/pxe_export.c	2008-07-31 12:31:43.000000000 -0700
+++ etherboot-5.4.3/src/core/pxe_export.c	2008-07-31 12:32:01.000000000 -0700
@@ -1023,6 +1023,10 @@
 	dst_port = ntohs(udp_write->dst_port);
 	DBG ( " %d->%@:%d (%d)", src_port, udp_write->ip, dst_port,
 	      udp_write->buffer_size );
+	if ( ! arp_ip(udp_write->ip) ) {
+		udp_write->Status = PXENV_STATUS_OUT_OF_RESOURCES;
+		return PXENV_EXIT_FAILURE;
+	}
 	
 	/* FIXME: we ignore the gateway specified, since we're
 	 * confident of being able to do our own routing.  We should
Index: etherboot-5.4.3/src/include/etherboot.h
===================================================================
--- etherboot-5.4.3.orig/src/include/etherboot.h	2008-07-31 12:31:43.000000000 -0700
+++ etherboot-5.4.3/src/include/etherboot.h	2008-07-31 12:32:01.000000000 -0700
@@ -140,6 +140,16 @@
 #ifdef PXE_EXPORT
 	ARP_PROXYDHCP,
 #endif
+	ARP_EXTRA0,
+	ARP_EXTRA1,
+	ARP_EXTRA2,
+	ARP_EXTRA3,
+	ARP_EXTRA4,
+	ARP_EXTRA5,
+	ARP_EXTRA6,
+	ARP_EXTRA7,
+	ARP_EXTRA8,
+	ARP_EXTRA9,
 	MAX_ARP
 };
 
