diff options
-rw-r--r-- | source4/wrepl_server/wrepl_out_push.c | 3 | ||||
-rw-r--r-- | source4/wrepl_server/wrepl_server.c | 53 |
2 files changed, 3 insertions, 53 deletions
diff --git a/source4/wrepl_server/wrepl_out_push.c b/source4/wrepl_server/wrepl_out_push.c index 82e6031564..d227a31346 100644 --- a/source4/wrepl_server/wrepl_out_push.c +++ b/source4/wrepl_server/wrepl_out_push.c @@ -25,6 +25,7 @@ #include "wrepl_server/wrepl_server.h" #include "libcli/composite/composite.h" #include "wrepl_server/wrepl_out_helpers.h" +#include "nbt_server/wins/winsdb.h" static void wreplsrv_out_partner_push(struct wreplsrv_partner *partner, BOOL propagate); @@ -123,7 +124,7 @@ NTSTATUS wreplsrv_out_push_run(struct wreplsrv_service *service) uint64_t seqnumber; uint32_t change_count; - seqnumber = wreplsrv_local_db_seqnumber(service); + seqnumber = winsdb_get_seqnumber(service->wins_db); for (partner = service->partners; partner; partner = partner->next) { /* if it's not a push partner, go to the next partner */ diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c index 018b137d7e..e9dbd3b872 100644 --- a/source4/wrepl_server/wrepl_server.c +++ b/source4/wrepl_server/wrepl_server.c @@ -171,58 +171,7 @@ BOOL wreplsrv_is_our_address(struct wreplsrv_service *service, const char *addre uint64_t wreplsrv_local_max_version(struct wreplsrv_service *service) { - int ret; - struct ldb_context *ldb = service->wins_db->ldb; - struct ldb_dn *dn; - struct ldb_result *res = NULL; - TALLOC_CTX *tmp_ctx = talloc_new(service); - uint64_t maxVersion = 0; - - dn = ldb_dn_explode(tmp_ctx, "CN=VERSION"); - if (!dn) goto failed; - - /* find the record in the WINS database */ - ret = ldb_search(ldb, dn, LDB_SCOPE_BASE, - NULL, NULL, &res); - if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); - if (res->count > 1) goto failed; - - if (res->count == 1) { - maxVersion = ldb_msg_find_uint64(res->msgs[0], "maxVersion", 0); - } - -failed: - talloc_free(tmp_ctx); - return maxVersion; -} - -uint64_t wreplsrv_local_db_seqnumber(struct wreplsrv_service *service) -{ - int ret; - struct ldb_context *ldb = service->wins_db->ldb; - struct ldb_dn *dn; - struct ldb_result *res = NULL; - TALLOC_CTX *tmp_ctx = talloc_new(service); - uint64_t seqnumber = 0; - - dn = ldb_dn_explode(tmp_ctx, "@BASEINFO"); - if (!dn) goto failed; - - /* find the record in the WINS database */ - ret = ldb_search(ldb, dn, LDB_SCOPE_BASE, - NULL, NULL, &res); - if (ret != LDB_SUCCESS) goto failed; - talloc_steal(tmp_ctx, res); - if (res->count > 1) goto failed; - - if (res->count == 1) { - seqnumber = ldb_msg_find_uint64(res->msgs[0], "sequenceNumber", 0); - } - -failed: - talloc_free(tmp_ctx); - return seqnumber; + return winsdb_get_maxVersion(service->wins_db); } NTSTATUS wreplsrv_fill_wrepl_table(struct wreplsrv_service *service, |