Bug 14169

Summary: natd only handles limited number of interfaces in ifreq list
Product: Base System Reporter: Jos Vissers <jos>
Component: binAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   

Description Jos Vissers 1999-10-06 21:00:01 UTC
	Natd can not find its interface from the ifreq list when the
	total number of interfaces/aliases exceeds a maximum and the
	nat-ed interface is beyond that maximum.
	It then responds with "Unknown interface name".
	I have vx0 with 13 addresses, fxp0 with 1, lp0 with 1,
	and lo0 with 1 address, ppp0 and ppp1 are not assigned an
	address and isp0 is the nat-ed inerface.
	Natd can not find isp0 because the size of the ifreq list is
	fixed at 32.

Fix: 

Increase the size of the ifreq list to 64, unless there is a
	reason to keep this at 32.

===================================================================
--- natd.c      1999/08/29 15:14:49     1.11.2.6
+++ natd.c      1999/10/06 16:23:13
@@ -704,7 +704,7 @@
 static void SetAliasAddressFromIfName (char* ifn)
 {
        struct ifconf           cf;
-       struct ifreq            buf[32];
+       struct ifreq            buf[64];
        char                    msg[80];
        struct ifreq*           ifPtr;
        int                     extra;
How-To-Repeat: 
	Add a number of aliases to any interfaces before the nat-ed
	interface. How many depends on the total number of
	physical interfaces since ifr_addr.sa_len is larger for
	the link layer interface.
Comment 1 ru freebsd_committer freebsd_triage 1999-10-06 21:09:21 UTC
Responsible Changed
From-To: freebsd-bugs->ru

Over to the maintainer :-) 
Comment 2 ru freebsd_committer freebsd_triage 1999-10-28 20:03:23 UTC
State Changed
From-To: open->closed

Fixed in both -current and -stable.