diff options
Diffstat (limited to 'server/responder/nss')
-rw-r--r-- | server/responder/nss/nsssrv.c | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/server/responder/nss/nsssrv.c b/server/responder/nss/nsssrv.c index 456c6292..a896ef31 100644 --- a/server/responder/nss/nsssrv.c +++ b/server/responder/nss/nsssrv.c @@ -41,7 +41,6 @@ #include "util/btreemap.h" #include "responder/common/responder_packet.h" #include "providers/data_provider.h" -#include "monitor/monitor_sbus.h" #include "monitor/monitor_interfaces.h" #include "sbus/sbus_client.h" @@ -186,35 +185,44 @@ static void nss_shutdown(struct resp_ctx *rctx) exit(0); } +static struct sbus_method nss_dp_methods[] = { + { NULL, NULL } +}; -static void nss_dp_reconnect_init(struct sbus_connection *conn, int status, void *pvt) +struct sbus_interface nss_dp_interface = { + DP_CLI_INTERFACE, + DP_CLI_PATH, + SBUS_DEFAULT_VTABLE, + nss_dp_methods, + NULL +}; + + +static void nss_dp_reconnect_init(struct sbus_connection *conn, + int status, void *pvt) { struct resp_ctx *rctx = talloc_get_type(pvt, struct resp_ctx); + int ret; /* Did we reconnect successfully? */ if (status == SBUS_RECONNECT_SUCCESS) { DEBUG(1, ("Reconnected to the Data Provider.\n")); - return; + + /* Identify ourselves to the data provider */ + ret = dp_common_send_id(conn, + DP_CLI_FRONTEND, + DATA_PROVIDER_VERSION, + "NSS", ""); + /* all fine */ + if (ret == EOK) return; } - /* Handle failure */ + /* Failed to reconnect */ DEBUG(0, ("Could not reconnect to data provider.\n")); /* Kill the backend and let the monitor restart it */ nss_shutdown(rctx); } -static struct sbus_method nss_dp_methods[] = { - { NULL, NULL } -}; - -struct sbus_interface nss_dp_interface = { - DP_CLI_INTERFACE, - DP_CLI_PATH, - SBUS_DEFAULT_VTABLE, - nss_dp_methods, - NULL -}; - int nss_process_init(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct confdb_ctx *cdb) |