summaryrefslogtreecommitdiff
path: root/source3/lib/interface.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-05-18 10:32:27 +0200
committerVolker Lendecke <vl@samba.org>2009-05-18 13:38:55 +0200
commitbbbf9f13add12906480e6697eb56a2680dabe160 (patch)
treeeb7e7ef800154d0a862231038431d4bccb821ceb /source3/lib/interface.c
parent67a2e629919bdc5a783e64636890fec2a7dfa9f8 (diff)
downloadsamba-bbbf9f13add12906480e6697eb56a2680dabe160.tar.gz
Fix bug 5681: Do not limit the number of network interfaces
Jeremy as far as I can see there is no real technical reason to limit the number of interfaces. If you like this patch, can you please merge it to 3.4? If you don't please tell me :-) Thanks, Volker
Diffstat (limited to 'source3/lib/interface.c')
-rw-r--r--source3/lib/interface.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index b32ccb9c568..4a8a154edbc 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -492,7 +492,7 @@ static void interpret_interface(char *token)
void load_interfaces(void)
{
- struct iface_struct ifaces[MAX_INTERFACES];
+ struct iface_struct *ifaces = NULL;
const char **ptr = lp_interfaces();
int i;
@@ -507,7 +507,7 @@ void load_interfaces(void)
}
/* Probe the kernel for interfaces */
- total_probed = get_interfaces(ifaces, MAX_INTERFACES);
+ total_probed = get_interfaces(talloc_tos(), &ifaces);
if (total_probed > 0) {
probed_ifaces = (struct iface_struct *)memdup(ifaces,
@@ -517,6 +517,7 @@ void load_interfaces(void)
exit(1);
}
}
+ TALLOC_FREE(ifaces);
/* if we don't have a interfaces line then use all broadcast capable
interfaces except loopback */
@@ -569,15 +570,17 @@ void gfree_interfaces(void)
bool interfaces_changed(void)
{
+ bool ret = false;
int n;
- struct iface_struct ifaces[MAX_INTERFACES];
+ struct iface_struct *ifaces = NULL;
- n = get_interfaces(ifaces, MAX_INTERFACES);
+ n = get_interfaces(talloc_tos(), &ifaces);
if ((n > 0 )&& (n != total_probed ||
memcmp(ifaces, probed_ifaces, sizeof(ifaces[0])*n))) {
- return true;
+ ret = true;
}
- return false;
+ TALLOC_FREE(ifaces);
+ return ret;
}