Subject: Re: misc/1823: new byteorder related bug in libsa
To: None <drochner@zelux6.zel.kfa-juelich.de>
From: Gordon W. Ross <gwr@mc.com>
List: netbsd-bugs
Date: 12/07/1995 21:16:22
I think I like the attached fix a little better, because it
preserves the global bp_server_port (helpful for debugging).
Thanks for the bug report, none the less!

Gordon Ross

> >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.


*** bootparam.c.orig	Fri Oct 13 22:46:05 1995
--- bootparam.c	Thu Dec  7 21:07:26 1995
***************
*** 107,113 ****
  		struct xdr_inaddr xina;
  	} *args;
  	struct repl {
! 		u_int32_t port;
  		u_int32_t encap_len;
  		/* encapsulated data here */
  		n_long  capsule[64];
--- 107,114 ----
  		struct xdr_inaddr xina;
  	} *args;
  	struct repl {
! 		u_int16_t _pad;
! 		u_int16_t port;
  		u_int32_t encap_len;
  		/* encapsulated data here */
  		n_long  capsule[64];