svn commit: samba r18917 - in branches/SAMBA_4_0/source:
lib/socket_wrapper script/tests
tridge at samba.org
tridge at samba.org
Tue Sep 26 11:31:15 GMT 2006
Author: tridge
Date: 2006-09-26 11:31:14 +0000 (Tue, 26 Sep 2006)
New Revision: 18917
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18917
Log:
having 255 virtual interfaces available in socket wrapper means we
stat() 240 files that don't exist on every broadcast. That's a bit
excessive!
reduce max virtual interfaces to 16
Modified:
branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c
branches/SAMBA_4_0/source/script/tests/mktestsetup.sh
branches/SAMBA_4_0/source/script/tests/selftest.sh
Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c 2006-09-26 11:27:09 UTC (rev 18916)
+++ branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c 2006-09-26 11:31:14 UTC (rev 18917)
@@ -89,6 +89,8 @@
#define SOCKET_TYPE_CHAR_TCP 'T'
#define SOCKET_TYPE_CHAR_UDP 'U'
+#define MAX_WRAPPED_INTERFACES 16
+
static struct sockaddr *sockaddr_dup(const void *data, socklen_t len)
{
struct sockaddr *ret = (struct sockaddr *)malloc(len);
@@ -156,7 +158,7 @@
if (s) {
unsigned int iface;
if (sscanf(s, "%u", &iface) == 1) {
- if (iface >= 1 && iface <= 0xFF) {
+ if (iface >= 1 && iface <= MAX_WRAPPED_INTERFACES) {
return iface;
}
}
@@ -189,7 +191,7 @@
return -1;
}
- if (iface == 0 || iface > 0xFF) {
+ if (iface == 0 || iface > MAX_WRAPPED_INTERFACES) {
errno = EINVAL;
return -1;
}
@@ -804,7 +806,7 @@
type = SOCKET_TYPE_CHAR_UDP;
- for(iface=0; iface <= 0xFF; iface++) {
+ for(iface=0; iface <= MAX_WRAPPED_INTERFACES; iface++) {
snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/"SOCKET_FORMAT,
socket_wrapper_dir(), type, iface, prt);
if (stat(un_addr.sun_path, &st) != 0) continue;
Modified: branches/SAMBA_4_0/source/script/tests/mktestsetup.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/mktestsetup.sh 2006-09-26 11:27:09 UTC (rev 18916)
+++ branches/SAMBA_4_0/source/script/tests/mktestsetup.sh 2006-09-26 11:31:14 UTC (rev 18917)
@@ -396,10 +396,10 @@
cat >$PRIVATEDIR/wins_config.ldif<<EOF
-dn: name=TORTURE_26,CN=PARTNERS
+dn: name=TORTURE_6,CN=PARTNERS
objectClass: wreplPartner
-name: TORTURE_26
-address: 127.0.0.26
+name: TORTURE_6
+address: 127.0.0.6
pullInterval: 0
pushChangeCount: 0
type: 0x3
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/selftest.sh 2006-09-26 11:27:09 UTC (rev 18916)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh 2006-09-26 11:31:14 UTC (rev 18917)
@@ -80,9 +80,9 @@
export SOCKET_WRAPPER_DEFAULT_IFACE
smbd_check_or_start
-SOCKET_WRAPPER_DEFAULT_IFACE=26
+SOCKET_WRAPPER_DEFAULT_IFACE=6
export SOCKET_WRAPPER_DEFAULT_IFACE
-TORTURE_INTERFACES='127.0.0.26/8,127.0.0.27/8,127.0.0.28/8,127.0.0.29/8,127.0.0.30/8,127.0.0.31/8'
+TORTURE_INTERFACES='127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8'
TORTURE_OPTIONS="--option=interfaces=$TORTURE_INTERFACES $CONFIGURATION"
# ensure any one smbtorture call doesn't run too long
TORTURE_OPTIONS="$TORTURE_OPTIONS --maximum-runtime=$TORTURE_MAXTIME"
More information about the samba-cvs
mailing list