Bug 7580 - smbd fails to start with more then 256 interfaces
Summary: smbd fails to start with more then 256 interfaces
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.5
Classification: Unclassified
Component: File services (show other bugs)
Version: unspecified
Hardware: x86 Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-21 18:34 UTC by Peter Novodvorsky
Modified: 2011-05-14 09:23 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 Peter Novodvorsky 2010-07-21 18:34:41 UTC
if more then 256 ip addresses are assigned to interfaces on the system smbd will fail to start on linux 2.6. The reason for that is that buff array in _get_interfaces (interfaces.c) is only 8192 bytes. Each ip address description occupies 32 bytes, so SIOCGIFCONF will return information on first 256 interfaces. smbd won't find the address it was asked to bind to and return with "can't determine netmask".

Our own fix just bumps up array size 8 times, but there might be smarter solution (call SIOCGIFCONF with buffer size 8126, if it fills up, ask again with double size, repeat).
Comment 1 Volker Lendecke 2010-08-01 04:34:04 UTC
Are you really using Samba 3.5 with a modern glibc? The way I understand the code is that we are using the getifaddrs() function if available. That function does not have any size restrictions. If that is not available, yes, we have that problem. My problem now however is that I don't know the error message the ioctl(..,SIOCGIFCONF,..) gives when the buffer was too small. Can you send us an strace of such a failure?

Thanks,

Volker
Comment 2 Volker Lendecke 2011-05-14 09:23:53 UTC
No feedback for half a year