The branch, master has been updated
via 691fb36 s4: Simple test script to create lots of contacts to stress
the LDB
via 7c9b3cd s4-librpc: do not limit to the first IP when trying to do a
rpc connection
via 5d18e57 s4-socket: allow connect_multi_next_socket to try all the
IP for a given host
from 29b5a95 py_passdb: Cannot steal an item pointer from an array
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -
commit 691fb365f8405d92a269abcef1028aa648d12580
Author: Matthieu Patou
Date: Fri Nov 11 19:01:54 2011 +0100
s4: Simple test script to create lots of contacts to stress the LDB
Autobuild-User: Matthieu Patou
Autobuild-Date: Fri Nov 11 22:02:53 CET 2011 on sn-devel-104
commit 7c9b3cdcf79088ff284d2383676d3f26ae42f8fb
Author: Matthieu Patou
Date: Thu Nov 10 20:59:09 2011 +0100
s4-librpc: do not limit to the first IP when trying to do a rpc connection
The function continue_ip_resolve_name was calling resolve_name_recv which
returns
only the first IP for a given hostname.
Instead we use resolve_name_multiple_recv which returns all the IP for a
given
hostname. This kind of problem can occur if a host has more than 1 IP but
is listenning
only on 1.
commit 5d18e57bec9db9444ae738c24ef63b21e3197a77
Author: Matthieu Patou
Date: Thu Nov 10 15:36:22 2011 +0100
s4-socket: allow connect_multi_next_socket to try all the IP for a given
host
This fix an incorrect behavior which was that if a host has 2 IP but
was listening on only 1 (and the second one) connect_multi_next_socket
was not able to connect because it used only the first result.
---
Summary of changes:
source4/lib/socket/connect_multi.c | 33 ++-
source4/librpc/rpc/dcerpc_sock.c | 32 +++---
.../devel/{chgtdcpass => addlotscontacts} | 43 +--
3 files changed, 84 insertions(+), 24 deletions(-)
copy source4/scripting/devel/{chgtdcpass => addlotscontacts} (59%)
mode change 100755 => 100644
Changeset truncated at 500 lines:
diff --git a/source4/lib/socket/connect_multi.c
b/source4/lib/socket/connect_multi.c
index 5358606..2b926c8 100644
--- a/source4/lib/socket/connect_multi.c
+++ b/source4/lib/socket/connect_multi.c
@@ -33,7 +33,8 @@
overall state
*/
struct connect_multi_state {
- struct socket_address *server_address;
+ struct socket_address **server_address;
+ unsigned num_address, current_address, current_port;
int num_ports;
uint16_t *ports;
@@ -125,14 +126,18 @@ static void connect_multi_next_socket(struct
composite_context *result)
struct composite_context *creq;
int next = multi->num_connects_sent;
- if (next == multi->num_ports) {
+ if (next == multi->num_address * multi->num_ports) {
/* don't do anything, just wait for the existing ones to finish
*/
return;
}
+ if (multi->current_address == multi->num_address) {
+ multi->current_address = 0;
+ multi->current_port += 1;
+ }
multi->num_connects_sent += 1;
- if (multi->server_address == NULL) {
+ if (multi->server_address == NULL ||
multi->server_address[multi->current_address] == NULL) {
composite_error(result, NT_STATUS_OBJECT_NAME_NOT_FOUND);
return;
}
@@ -141,13 +146,14 @@ static void connect_multi_next_socket(struct
composite_context *result)
if (composite_nomem(state, result)) return;
state->result = result;
- result->status = socket_create(multi->server_address->family,
SOCKET_TYPE_STREAM, &state->sock, 0);
+ result->status =
socket_create(multi->server_address[multi->current_address]->family,
+ SOCKET_TYPE_STREAM, &state->sock, 0);
if (!composite_is_ok(result)) return;
- state->addr = socket_address_copy(state, multi->server_address);
+ state->addr = socket_address_copy(state,
multi->server_address[multi->current_address]);
if (composite_nomem(state->addr, result)) return;
- socket_address_set_port(state->addr, multi->ports[next]);
+ socket_address_set_port(state->addr, multi->ports[multi->current_port]);
talloc_steal(state, state->sock);
@@ -157,12 +163,13 @@ static void connect_multi_next_socket(struct
composite_context *result)
if (composite_nomem(creq, result)) return;
talloc_steal(state, creq);
+ multi->current_address++;
composite_continue(result, creq, continue_one, state);
- /* if there are more ports to go then setup a timer to fire when we
have waited
+ /* if there are more ports / addresses to go then setup a timer to fire
when we have waited