Subject: port-sparc/8738: make boot.net with BOOTP failure
To: None <gnats-bugs@gnats.netbsd.org>
From: Y. Takizawa <you@nightbreak.org>
List: netbsd-bugs
Date: 11/02/1999 09:14:07
>Number:         8738
>Category:       port-sparc
>Synopsis:       make boot.net with BOOTP failure
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sparc-maintainer (NetBSD/sparc Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov  2 08:54:00 1999
>Last-Modified:
>Originator:     Y. Takizawa
>Organization:
>Release:        NetBSD-current source 19991023
>Environment:


>Description:

Can not compile ``boot.net'' for network boot using BOOTP.

>How-To-Repeat:

# cd /usr/src/sys/arch/sparc/stand
# diff -u Makefile.buildboot.orig Makefile.buildboot
--- Makefile.buildboot.orig     Tue Jun 29 09:03:39 1999
+++ Makefile.buildboot  Wed Nov  3 00:24:49 1999
@@ -17,7 +17,7 @@
 # Note: a `RELOC' value of 0x340000 seems to work on most machines
 RELOC?=                ${RELOC_SUN4C}
 
-CPPFLAGS+=	-D_STANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C -DSUN_BOOTPARAMS\
+CPPFLAGS+=	-D_STANDALONE -DRELOC=${RELOC} -DSUN4 -DSUN4C \
		-DHEAP_VARIABLE
 
 CPPFLAGS+=     -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
# cd boot
# make boot.net
...
cc1: warnings being treated as errors
/usr/src/sys/arch/sparc/stand/boot/../common/net.c: In function `net_mountroot':
/usr/src/sys/arch/sparc/stand/boot/../common/net.c:148: warning: implicit declaration of function `bootp'
/usr/src/sys/arch/sparc/stand/boot/../common/net.c:153: invalid operands to binary !=
*** Error code 1

Stop.

>Fix:

--- sys/arch/sparc/stand/common/net.c.orig	Wed Nov  3 01:11:17 1999
+++ sys/arch/sparc/stand/common/net.c	Wed Nov  3 01:11:17 1999
@@ -58,6 +58,9 @@
 #include <lib/libsa/net.h>
 #include <lib/libsa/netif.h>
 #include <lib/libsa/bootparam.h>
+#ifndef SUN_BOOTPARAMS
+#include <lib/libsa/bootp.h>
+#endif
 #include <lib/libsa/nfs.h>
 
 #include <lib/libkern/libkern.h>
@@ -150,7 +153,7 @@
 	printf("Using IP address: %s\n", inet_ntoa(myip));
 
 	printf("myip: %s (%s)", hostname, inet_ntoa(myip));
-	if (gateip)
+	if (gateip.s_addr)
 		printf(", gateip: %s", inet_ntoa(gateip));
 	if (netmask)
 		printf(", netmask: %s", intoa(netmask));

>Audit-Trail:
>Unformatted: