Subject: Re: samba and SIOCGIFCONF
To: None <M.Drochner@fz-juelich.de>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-net
Date: 12/20/2007 22:28:02
That was me and I don't use samba at all.  I am very hesitant to add
patches because I don't understand how it ever could have worked.


From: Greg Troxel <gdt@ir.bbn.com>
Subject: Re: nmap not working?
To: "Jared D. McNeill" <jmcneill@invisible.ca>
Cc: current-users@netbsd.org, pkgsrc-users@netbsd.org
Date: Fri, 09 Nov 2007 19:55:49 -0500

In pkgsrc/net/samba/work/samba-2.0.26a/source/lib/interfaces.c, line 123
has a for loop that uses struct ifreq *ifr as an array in data returned
from SIOCGIFCONF.  This is totally bogus and would have failed under 4.4BSD.
With the struct sockaddr_storage change, it should work.

If it doesn't work, someone should gdb this loop.

If it works for some, and fails to find interfaces on systems with many
interfaces, then change buff from 8192 to 32768 or more.  Each address
is now 144 bytes, the minimum struct ifreq, because sockaddr_storage is
128 and there's 16 of ifr_name.