Bug 1310 - nmbd "forgets" netmask from interfaces setting
Summary: nmbd "forgets" netmask from interfaces setting
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: nmbd (show other bugs)
Version: 3.0.3
Hardware: All Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-30 14:41 UTC by Steve
Modified: 2005-08-24 10:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve 2004-04-30 14:41:43 UTC
I've experienced the following problem (Linux 2.4.22 + gcc 3.2.2):

My interface setting is: "interfaces = 192.168.1.0/24" and "bind interfaces 
only = Yes"

smbd and nmbd are running fine after startup. But when I change anything with 
my network interfaces (i.e. adding or removing an interface), nmbd dies within 
the next minutes, claiming "reload_interfaces: No subnets to listen to. 
Shutting down..."

I've had a closer look and found out that on the call of load_interfaces() 
(from reload_interfaces()) the interface string hadn't been "192.168.1.0/24", 
but only "192.168.1.0". Thus, it couldn't find the network any longer, as the 
netmask didn't match.

The problem seems to be the following line in interpret_interfaces():
 /* parse it into an IP address/netmasklength pair */
 *p++ = 0;

Here, the "/" is overwritten to split the string into tokens. However, as p 
points to Globals.szInterfaces, it seems to modify the string also there. 
Thus, next time lp_interfaces() is used, the configuration settings are 
returned as if the "/24" had never been there.
Comment 1 Gerald (Jerry) Carter (dead mail address) 2004-11-11 13:50:08 UTC
I'm pretty sure we fixed this on in 3.0.6 or later.
Comment 2 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:21:59 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.