NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-sparc64/46652: sparc ofwboot.net fails to load kernel via tftp



>Number:         46652
>Category:       port-sparc64
>Synopsis:       sparc ofwboot.net fails to load kernel via tftp
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 03 18:30:00 +0000 2012
>Originator:     S.P.Zeidler
>Release:        NetBSD 6.0_BETA2
>Organization:
        dis-
>Environment:
System: NetBSD amdmin.netbsd.de 4.0_STABLE NetBSD 4.0_STABLE (GENERIC) #1: Thu 
Jun 14 20:00:29 UTC 2012 
spz%amdmin.netbsd.de@localhost:/home/netbsd/6/amd64/kern-compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
        sparc + sparc64 ofwboot.net lost the ability to load a kernel via tftp
        The ofwboot.net crashes instead.
>How-To-Repeat:
        boot net tftp:netbsd.gz
        on a likely sparc in an environment where the kernel should be
        loaded via tftp.
>Fix:
roll back some changes:

Index: net.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/ofwboot/net.c,v
retrieving revision 1.7
diff -u -p -r1.7 net.c
--- net.c       21 May 2011 15:50:42 -0000      1.7
+++ net.c       3 Jul 2012 18:05:55 -0000
@@ -181,13 +181,14 @@ net_mountroot_bootp(void)
 }
 
 int
-net_tftp_bootp(struct of_dev *op)
+net_tftp_bootp(int **sock)
 {
 
        net_mountroot_bootp();
        if (myip.s_addr == 0)
                return(ENOENT);
 
+       *sock = &netdev_sock;
        return (0);
 }
 
Index: net.h
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/ofwboot/net.h,v
retrieving revision 1.2
diff -u -p -r1.2 net.h
--- net.h       21 May 2011 15:50:42 -0000      1.2
+++ net.h       3 Jul 2012 18:05:55 -0000
@@ -34,7 +34,7 @@
 
 int    net_open(struct of_dev *);
 int    net_close(struct of_dev *);
-int    net_tftp_bootp(struct of_dev *);
+int    net_tftp_bootp(int **);
 int    net_mountroot(void);
 
 #endif /* _OFWBOOT_NET_H */
Index: ofdev.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/stand/ofwboot/ofdev.c,v
retrieving revision 1.32
diff -u -p -r1.32 ofdev.c
--- ofdev.c     1 Jun 2011 11:42:18 -0000       1.32
+++ ofdev.c     3 Jul 2012 18:05:55 -0000
@@ -536,7 +536,7 @@ open_again:
                if (!strncmp(*file,"/tftp:",6)) {
                        *file += 6;
                        memcpy(&file_system[0], &file_system_tftp, sizeof 
file_system[0]);
-                       if (net_tftp_bootp(of->f_devdata)) {
+                       if (net_tftp_bootp((int **) &of->f_devdata)) {
                                net_close(&ofdev);
                                goto bad;
                        }



Home | Main Index | Thread Index | Old Index