diff options
author | Stefan Metzmacher <metze@sernet.de> | 2008-03-26 20:07:10 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-19 07:05:53 +0100 |
commit | 6bcd2cbd27cc62e5cfc5a4707b7a991ab691f3c8 (patch) | |
tree | a0456e45bcafe1d79b0524965930c57a1b1e2e7d /source4 | |
parent | d5b7240ac510fc3d1a7033b22a3a59b1450103aa (diff) | |
download | samba-6bcd2cbd27cc62e5cfc5a4707b7a991ab691f3c8.tar.gz samba-6bcd2cbd27cc62e5cfc5a4707b7a991ab691f3c8.tar.bz2 samba-6bcd2cbd27cc62e5cfc5a4707b7a991ab691f3c8.zip |
wrepl_server: make 'use inform' the default and autofallback against old servers
metze
(from samba4wins tree f44c8c8e1986e2105e899bb1f8a3896575eef582)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/wrepl_server/wrepl_out_helpers.c | 25 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.c | 2 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.h | 1 |
3 files changed, 25 insertions, 3 deletions
diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c index e1e3f38b12..d9a9684c79 100644 --- a/source4/wrepl_server/wrepl_out_helpers.c +++ b/source4/wrepl_server/wrepl_out_helpers.c @@ -77,10 +77,15 @@ static NTSTATUS wreplsrv_out_connect_wait_assoc_ctx(struct wreplsrv_out_connect_ NT_STATUS_NOT_OK_RETURN(status); state->wreplconn->assoc_ctx.peer_ctx = state->assoc_io.out.assoc_ctx; + state->wreplconn->assoc_ctx.peer_major = state->assoc_io.out.major_version; if (state->type == WINSREPL_PARTNER_PUSH) { - state->wreplconn->partner->push.wreplconn = state->wreplconn; - talloc_steal(state->wreplconn->partner, state->wreplconn); + if (state->wreplconn->assoc_ctx.peer_major >= 5) { + state->wreplconn->partner->push.wreplconn = state->wreplconn; + talloc_steal(state->wreplconn->partner, state->wreplconn); + } else { + state->type = WINSREPL_PARTNER_NONE; + } } else if (state->type == WINSREPL_PARTNER_PULL) { state->wreplconn->partner->pull.wreplconn = state->wreplconn; talloc_steal(state->wreplconn->partner, state->wreplconn); @@ -966,6 +971,22 @@ static NTSTATUS wreplsrv_push_notify_wait_connect(struct wreplsrv_push_notify_st status = wreplsrv_out_connect_recv(state->creq, state, &state->wreplconn); NT_STATUS_NOT_OK_RETURN(status); + /* is the peer doesn't support inform fallback to update */ + switch (state->command) { + case WREPL_REPL_INFORM: + if (state->wreplconn->assoc_ctx.peer_major < 5) { + state->command = WREPL_REPL_UPDATE; + } + break; + case WREPL_REPL_INFORM2: + if (state->wreplconn->assoc_ctx.peer_major < 5) { + state->command = WREPL_REPL_UPDATE2; + } + break; + default: + break; + } + switch (state->command) { case WREPL_REPL_UPDATE: state->full_table = true; diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index 393712c76a..5e100f46cc 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -207,7 +207,7 @@ NTSTATUS wreplsrv_load_partners(struct wreplsrv_service *service) WINSREPL_DEFAULT_PULL_RETRY_INTERVAL); partner->push.change_count = ldb_msg_find_attr_as_uint(res->msgs[i], "pushChangeCount", WINSREPL_DEFAULT_PUSH_CHANGE_COUNT); - partner->push.use_inform = ldb_msg_find_attr_as_uint(res->msgs[i], "pushUseInform", false); + partner->push.use_inform = ldb_msg_find_attr_as_uint(res->msgs[i], "pushUseInform", true); DEBUG(3,("wreplsrv_load_partners: found partner: %s type: 0x%X\n", partner->address, partner->type)); diff --git a/source4/wrepl_server/wrepl_server.h b/source4/wrepl_server/wrepl_server.h index 7ee5a80624..d92e524c35 100644 --- a/source4/wrepl_server/wrepl_server.h +++ b/source4/wrepl_server/wrepl_server.h @@ -79,6 +79,7 @@ struct wreplsrv_out_connection { struct { uint32_t our_ctx; uint32_t peer_ctx; + uint16_t peer_major; } assoc_ctx; /* |