Bug 20381

Summary: portmapper incorrectly checks interfaces with aliases
Product: Base System Reporter: Vlad Skvortsov <vss>
Component: binAssignee: Brian Somers <brian>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   

Description Vlad Skvortsov 2000-08-03 14:00:00 UTC
	/usr/sbin/portmap treats aliased ip addresses on interfaces as
	non-local thus refusing local daemons to register (for example,
	mountd).

	Function find_local() cycles through all interfaces and collects
	addresses associated with them. Though it only gets one (first)
	address from each interface. In case when lo0 has aliased ip besides
	127.0.0.1, the latter may be not the first associated with lo0 in the 
	list returned by sysctl(NET_RT_IFLIST). That way the aliased ip will
	be further treated as local and 127.0.0.1 as non-local.

Fix: 

Check if the interface has aliased ip addresses and in that case
	copy them all to internal local addresses array.
How-To-Repeat: 
	# iconfig lo0 1.2.3.4 netmask 0xfffffff alias
	# killall -9 portmap
	# portmap -v
	# mountd

	After this portmapper claims to syslog that request from mountd has
	come not from local address.
Comment 1 Sheldon Hearn 2000-08-03 17:54:57 UTC
On Thu, 03 Aug 2000 16:41:18 +0400, Vlad Skvortsov wrote:

> >Number:         20381
> >Category:       bin
> >Synopsis:       portmapper incorrectly checks interfaces with aliases

Could you try the last patch provided on PR bin/5139 ?

	http://www.freebsd.org/cgi/query-pr.cgi?pr=5139

Ciao,
Sheldon.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-08 12:10:55 UTC
Responsible Changed
From-To: freebsd-bugs->brian

Brian has a handle on this.
Comment 3 Brian Somers freebsd_committer freebsd_triage 2000-08-08 19:28:15 UTC
State Changed
From-To: open->closed

Committed to 4-stable
Comment 4 Brian Somers freebsd_committer freebsd_triage 2000-08-08 21:45:54 UTC
State Changed
From-To: closed->open

Oops, I closed the wrong PR.... sorry.
Comment 5 Brian Somers freebsd_committer freebsd_triage 2000-08-09 10:25:20 UTC
State Changed
From-To: open->closed

Fixed in -current.  I'll MFC in 1 week if there are no problems.