Subject: bin/3551: bin: endian botch in gdb/ipkdb
To: None <gnats-bugs@gnats.netbsd.org>
From: David Jones <dej@inode.org>
List: netbsd-bugs
Date: 04/27/1997 18:22:46
>Number:         3551
>Category:       bin
>Synopsis:       port for ipkdb is in native byte order
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 27 18:35:01 1997
>Last-Modified:
>Originator:     David Jones
>Organization:
	INODE Community Networking
>Release:        1.2
>Environment:
	
System: NetBSD qpoint 1.2D NetBSD 1.2D (QPOINT) #0: Sat Mar 22 18:11:37 EST 1997 dej@qpoint:/local/src/sys.970322/arch/amiga/compile/QPOINT amiga


>Description:
	
	In /gnu/usr.bin/gdb/gdb/remote_ipkdb.c, we have:

	sin.sin_family = AF_INET;
	sin.sin_port = 1138;
	sin.sin_addr.s_addr = 0;
	if (bind(ipkdb_desc, (struct sockaddr *)&sin, sizeof sin) < 0)
		fatal("netopen: bind failed\n");

Now, I've never tried to run ipkdb, but I think the above will fail if you
are initiating gdb from a little-endian machine.  The "1138" needs to
be put in network byte order.

>How-To-Repeat:
	
	As I said, I've never tried it. 
>Fix:
	
	sin.sin_port = htons(1138);
>Audit-Trail:
>Unformatted: