Subject: misc/1823: new byteorder related bug in libsa
To: None <gnats-bugs@gnats.netbsd.org>
From: None <drochner@zelux6.zel.kfa-juelich.de>
List: netbsd-bugs
Date: 12/07/1995 22:06:10
>Number:         1823
>Category:       misc
>Synopsis:       new byteorder related bug in libsa
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec  7 17:20:02 1995
>Last-Modified:
>Originator:     Matthias Drochner
>Organization:
	KFA Juelich
>Release:        1.1
>Environment:
	NetBSD 1.1 / -current
System: NetBSD zelz19 1.1 NetBSD 1.1 (MIST) #11: Fri Dec 1 19:15:50 MET 1995 root@zelz19:/usr/src/sys/arch/i386/compile/MIST i386


>Description:
	On little-endian machines, bootparam fails.
	A bad (truncated) remote port number will be cached after the whoami call and
	used for subsequent root and swap calls.
	(This was already addressed in pr misc/1404, but it appeares again
	in current sources.)
>How-To-Repeat:
	Build a network booter on i386.
>Fix:
	This works for me:
*** bootparam.c.orig    Sat Oct 14 03:46:05 1995
--- bootparam.c Thu Dec  7 22:15:13 1995
***************
*** 175,177 ****
         */
-       bp_server_port = repl->port;

--- 175,176 ----
***************
*** 179,181 ****
        printf("bp_whoami: server at %s:%d\n",
!                  inet_ntoa(bp_server_addr), ntohs(bp_server_port));
  #endif
--- 178,180 ----
        printf("bp_whoami: server at %s:%d\n",
!                  inet_ntoa(bp_server_addr), ntohl(repl->port));
  #endif
***************
*** 186,188 ****
                          BOOTPARAM_VERS,
!                         (int)ntohs(bp_server_port));

--- 185,187 ----
                          BOOTPARAM_VERS,
!                         ntohl(repl->port));


>Audit-Trail:
>Unformatted: