summaryrefslogtreecommitdiffstats
path: root/source4/wrepl_server/wrepl_in_call.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-02 17:19:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:36 -0500
commitb75ed7d7ac9b3d5beca71926a15cfec5e3a0092c (patch)
treed951c116c1399b260a8b4f16a196ca1e9d3a606e /source4/wrepl_server/wrepl_in_call.c
parent1a83c7388f7c677e58608b5670c335e7701fdf70 (diff)
downloadsamba-b75ed7d7ac9b3d5beca71926a15cfec5e3a0092c.tar.gz
samba-b75ed7d7ac9b3d5beca71926a15cfec5e3a0092c.tar.xz
samba-b75ed7d7ac9b3d5beca71926a15cfec5e3a0092c.zip
r12677: get rid of the special cases for the local wins owner table entry,
the call to winsdb_get_maxVersion() is moved into place. This allows us to fetch records with the owner address that matches our local_owner address, this is important if the restart with an empty wins.ldb. w2k3 does this in the same way when you remove the database files from disk and restart the WINS-Service. metze (This used to be commit e43de87d06614206a858e1102cd82e7f02163bba)
Diffstat (limited to 'source4/wrepl_server/wrepl_in_call.c')
-rw-r--r--source4/wrepl_server/wrepl_in_call.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c
index 9bd01c14bbc..4d5fad8a7cf 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -115,7 +115,7 @@ static NTSTATUS wreplsrv_in_table_query(struct wreplsrv_in_call *call)
repl_out->command = WREPL_REPL_TABLE_REPLY;
return wreplsrv_fill_wrepl_table(service, call, table_out,
- our_ip, our_ip, True);
+ our_ip, True);
}
static int wreplsrv_in_sort_wins_name(struct wrepl_wins_name *n1,
@@ -173,7 +173,6 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
struct wrepl_wins_owner *owner_in = &call->req_packet.message.replication.info.owner;
struct wrepl_replication *repl_out = &call->rep_packet.message.replication;
struct wrepl_send_reply *reply_out = &call->rep_packet.message.replication.info.reply;
- struct wreplsrv_owner local_owner;
struct wreplsrv_owner *owner;
const char *filter;
struct ldb_result *res = NULL;
@@ -183,16 +182,7 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
NTSTATUS status;
uint32_t i;
- if (strcmp(call->wreplconn->our_ip, owner_in->address) == 0) {
- ZERO_STRUCT(local_owner);
- local_owner.owner.address = service->wins_db->local_owner;
- local_owner.owner.min_version = 0;
- local_owner.owner.max_version = wreplsrv_local_max_version(service);
- local_owner.owner.type = 1;
- owner = &local_owner;
- } else {
- owner = wreplsrv_find_owner(service->table, owner_in->address);
- }
+ owner = wreplsrv_find_owner(service, service->table, owner_in->address);
repl_out->command = WREPL_REPL_SEND_REPLY;
reply_out->num_names = 0;
@@ -203,6 +193,8 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
* return an empty list.
*/
if (!owner) {
+ DEBUG(2,("WINSREPL:reply [0] records unknown owner[%s] to partner[%s]\n",
+ owner_in->address, call->wreplconn->partner->address));
return NT_STATUS_OK;
}
@@ -219,6 +211,11 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
* return an empty list.
*/
if (owner_in->min_version > owner_in->max_version) {
+ DEBUG(2,("WINSREPL:reply [0] records owner[%s] min[%llu] max[%llu] to partner[%s]\n",
+ owner_in->address,
+ (long long)owner_in->min_version,
+ (long long)owner_in->max_version,
+ call->wreplconn->partner->address));
return NT_STATUS_OK;
}
@@ -227,6 +224,11 @@ static NTSTATUS wreplsrv_in_send_request(struct wreplsrv_in_call *call)
* return an empty list.
*/
if (owner_in->min_version > owner->owner.max_version) {
+ DEBUG(2,("WINSREPL:reply [0] records owner[%s] min[%llu] max[%llu] to partner[%s]\n",
+ owner_in->address,
+ (long long)owner_in->min_version,
+ (long long)owner_in->max_version,
+ call->wreplconn->partner->address));
return NT_STATUS_OK;
}