I have a machine with two NICs. one's ip is 192.168.1.100, the other is 192.168.2.100. I connect to 192.168.1.100. after about one day, I can not use host name to browse this machine. and I use nbtstat -A 192.168.1.100 to test, it has no response. I use gdb to debug, it always block in sendto() function. and my smb.conf as follows: [global] workgroup = MYGROUP server string = Samba Server security = share load printers = no guest account = nobody log file = /var/log/samba.%m max log size = 50 socket options = TCP_NODELAY dns proxy = no #============================ Share Definitions ============================== [homes] comment = Home Directories browseable = no writable = yes [tftpboot] comment = tftp path = /mnt public = yes writable = yes browseable = yes guest ok = yes
when i down the other interface ( use ifconfig eth1 0 down ), it always work fine.
the following is gdb debug message. (gdb) up #1 0x000abcb4 in send_udp (fd=9, buf=0xbeffebfc "\021\nOp‹ß\002d", len=213, ip={s_addr = 4278364352}, port=138) at libsmb/nmblib.c:784 784 ret = (sendto(fd,buf,len,0,(struct sockaddr *)&sock_out, sizeof(sock_out)) >= 0); (gdb) l 779 /* 780 * Patch to fix asynch error notifications from Linux kernel. 781 */ 782 783 for (i = 0; i < 5; i++) { 784 ret = (sendto(fd,buf,len,0,(struct sockaddr *)&sock_out, sizeof(sock_out)) >= 0); 785 if (ret || errno != ECONNREFUSED) 786 break; 787 } 788 (gdb) p i $1 = 0 (gdb) p len $2 = 213 (gdb) p port $3 = 138
(gdb) info locals ret = 0 i = 0 sock_out = {sin_family = 2, sin_port = 35328, sin_addr = { s_addr = 4278364352}, sin_zero = "\000\000\000\000\000\000\000"}
(gdb) p num_good_sends $7 = 581
it block in sendto system call when I change my linux kernel from 2.6.9 to 2.6.10, it work fine. I think maybe this is a kernel bug, not nmbd.