Subject: bin/270: portal does not accept host byte order port numbers
To: None <gnats-admin>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 05/30/1994 02:50:04
>Number:         270
>Category:       bin
>Synopsis:       portal does not accept host byte order port numbers
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon May 30 02:50:03 1994
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release:        current
>Environment:
	
System: NetBSD gandalf.bbb.no 0.9B GANDALF#3 i386


>Description:
	portal will only work with symbolic port numbers or network byte order
	port numbers.  It would be more natural if it used host byte order when
	given numeric port numbers.
>How-To-Repeat:
	Try to open "/p/tcp/localhost/25".  Watch it fail.  If the port number
	is given symbolically or in network byte order, it will work.
>Fix:
*** src/sbin/mount_portal/pt_tcp.c.orig	Sat Jan 15 11:19:34 1994
--- src/sbin/mount_portal/pt_tcp.c	Mon May 30 11:33:57 1994
***************
*** 121,127 ****
  	if (sp != 0)
  		s_port = sp->s_port;
  	else {
! 		s_port = atoi(port);
  		if (s_port == 0)
  			return (EINVAL);
  	}
--- 121,127 ----
  	if (sp != 0)
  		s_port = sp->s_port;
  	else {
! 		s_port = htons(atoi(port));
  		if (s_port == 0)
  			return (EINVAL);
  	}
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------