Bug 33085

Summary: Samba's NMBD cannot find alias interface
Product: Base System Reporter: Mario Doria <madd>
Component: kernAssignee: jlemon
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.5-PRERELEASE   
Hardware: Any   
OS: Any   

Description Mario Doria 2001-12-22 09:10:00 UTC
	With samba built from ports, version 2.2.2, NMBD dumps core when a client
	machine connects on an alias IP address.

How-To-Repeat: 	Create an alias interface ona  machine (let's say original IP addy is 10.25.1.1)
	and the alias IP is 10.25.1.2. On this machine setup a wins server with samba.
	On another machine, using smbclient (or a windoze machine) try to connect to any 
	share on the server system. The following error ocurrs:
	
	wins_srv_died(): WINS server 10.25.1.2 appears to be down.
	Connection to server failed

	This problem happens only after using sources CVSuped on the 15 of 
	december 2001. Using sources from december 14 eliminates the problem.
Comment 1 Mario Doria 2001-12-22 09:35:34 UTC
Here's some gdb output:

Complete nmbd.core is at http://www.tecdigital.net/madd/nmbd.core

sdf-1# gdb -e /usr/local/sbin/nmbd -c nmbd.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd".
Core was generated by `nmbd'.
Program terminated with signal 5, Trace/BPT trap.
Reading symbols from /usr/lib/libpam.so.1...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libc.so.4...(no debugging symbols
found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols
found)...
done.
#0  0x804b4ff in ?? ()
Comment 2 Mario Doria 2001-12-24 01:23:35 UTC
Fix/Workaround:

More information:

The machine's ifconfig output:
sdf-1# ifconfig
fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:b0:d0:aa:82:cf
        media: Ethernet autoselect (none)
        status: no carrier
fxp1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.25.165.1 netmask 0xffffff00 broadcast 10.25.165.255
        inet 10.25.165.2 netmask 0xffffffff broadcast 10.25.165.2
        inet 10.25.165.3 netmask 0xffffffff broadcast 10.25.165.3
        ether 00:02:b3:1b:49:71
        media: Ethernet autoselect (100baseTX)
        status: active
xl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        options=3<rxcsum,txcsum>
        ether 00:01:02:ed:26:dc
        media: Ethernet autoselect (100baseTX)
        status: active
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000

On interface fxp1, there are three IP addresses assigned. nmbd is to work on
10.25.165.3.

If I add the line:
interfaces = 127.0.0.1/24 10.25.165.3/24

to smb.conf, the problem is sorted out.
It broke on december 14, at 20:00:00 UTC.  The files that were changed
between december 14 @ 19:00:00 and december 14 @ 20:00:00 where:
(I don't know how these work in the system, what I know is that if I use
sources from december 14 @ 19:00:00, samba's nmbd will work fine. Afterwards
its all funny. The following files where the ones changing between those two
hours):

Edit src/sys/dev/bge/if_bge.c
 Edit src/sys/dev/gx/if_gx.c
 Edit src/sys/dev/lge/if_lge.c
 Edit src/sys/dev/nge/if_nge.c
 Edit src/sys/dev/txp/if_txp.c
 Edit src/sys/kern/kern_descrip.c
 Edit src/sys/kern/kern_event.c
 Edit src/sys/net/if.c
 Edit src/sys/net/if.h
 Edit src/sys/net/if_ethersubr.c
 Edit src/sys/net/if_var.h
 Edit src/sys/netinet/in.c
 Edit src/sys/netinet/in.h
 Edit src/sys/netinet/tcp_syncache.c
 Edit src/sys/pci/if_ti.c
 Edit src/sys/pci/if_xl.c
 Edit src/sys/sys/event.h
 Edit src/sys/sys/sockio.h
 Edit src/sys/vm/vm_zone.c
Comment 3 Mario Doria 2001-12-24 10:37:48 UTC
It seems that with recent changes, nmbd now notices that the broadcast
address of an alias interface is the same address as the alias interface.
Before december 14, it did not matter. For now, nmbd needs to be told in
which IP address to listen (if it's a alias IP address) and also add the
netmask accordingly.

Example, with a machine with ip address 10.0.0.1, and two alias addresses
(10.0.0.2 and 10.0.0.3), to make nmbd use IP 10.0.0.3, the line "interfaces
= 127.0.0.1 10.0.0.3/24" will make it work.


Thanks!
Comment 4 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-30 15:19:43 UTC
Responsible Changed
From-To: freebsd-bugs->jlemon

The only change made to the source files listed during the period 
given was Jonathan's merge of interface capabilities support.
Comment 5 Sheldon Hearn 2001-12-30 15:24:31 UTC
On Sat, 22 Dec 2001 03:02:46 CST, Mario Doria wrote:

> 	With samba built from ports, version 2.2.2, NMBD dumps core when a
>	client machine connects on an alias IP address.

Interestingly enough, this isn't 100% reproducible in -CURRENT.  It only
happens about 50% of the time.

Ciao,
Sheldon.
Comment 6 Mario Doria 2002-01-06 08:10:39 UTC
>    Interestingly enough, this isn't 100% reproducible in -CURRENT.  It
only
 >    happens about 50% of the time.

I found an error to be reproducible 100% of the time. As you said, also
in -STABLE happens, 50% of the time it dumps core, 50% it doesnt (more or
less). But, 100% of the time, when using an alias address to server nmbd
requests, nmbd stopped responding and the smbclient would report that the
wins server died.

Maybe a note when installing the port, or maybe my setup was a bit out of
the ordinary. I wrote to the samba mailing list and they asked for my core
dumps, but no answer so far.

Thanks,


Mario Doria
madd@tecdigital.net
Comment 7 dwcjr 2002-06-24 15:14:10 UTC
I think this was fixed, could you verify the problem exists on samba 2.2.5?
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2004-09-03 05:28:23 UTC
State Changed
From-To: open->closed

Feedback timeout (>1 year).