diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-09-03 18:50:35 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-09-06 14:40:13 -0400 |
commit | 4745ac57b7fb4ab071ee8f9b3386c5f4941a1561 (patch) | |
tree | 2a30261b0d242d42116a3803862c02eb6c4085d9 | |
parent | 7ad4202cbb7b0fd302a2fb586c431d7dd8375460 (diff) | |
download | sssd-4745ac57b7fb4ab071ee8f9b3386c5f4941a1561.tar.gz sssd-4745ac57b7fb4ab071ee8f9b3386c5f4941a1561.tar.xz sssd-4745ac57b7fb4ab071ee8f9b3386c5f4941a1561.zip |
Change libnl monitor callback to only signal going online
This feature was not used and would probably never be used, because it
is much safer to rely on online actions to time out. Moreover, it would
make implementing the new features more complex.
-rw-r--r-- | src/monitor/monitor.c | 8 | ||||
-rw-r--r-- | src/monitor/monitor.h | 7 | ||||
-rw-r--r-- | src/monitor/monitor_netlink.c | 4 |
3 files changed, 5 insertions, 14 deletions
diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 0e16b78f7..4cd1e99d0 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -154,15 +154,13 @@ static int mark_service_as_started(struct mt_svc *svc); static int monitor_cleanup(void); -static void network_status_change_cb(enum network_change state, - void *cb_data) +static void network_status_change_cb(void *cb_data) { struct mt_svc *iter; struct mt_ctx *ctx = (struct mt_ctx *) cb_data; - if (state != NL_ROUTE_UP) return; - - DEBUG(9, ("A new route has appeared, signaling providers to reset offline status\n")); + DEBUG(SSSDBG_TRACE_INTERNAL, ("A networking status change detected " + "signaling providers to reset offline status\n")); for (iter = ctx->svc_list; iter; iter = iter->next) { /* Don't signal services, only providers */ if (iter->provider) { diff --git a/src/monitor/monitor.h b/src/monitor/monitor.h index 73234424f..ab23e005c 100644 --- a/src/monitor/monitor.h +++ b/src/monitor/monitor.h @@ -43,12 +43,7 @@ int monitor_process_init(struct mt_ctx *ctx, /* from monitor_netlink.c */ struct netlink_ctx; -enum network_change { - NL_ROUTE_UP, - NL_ROUTE_DOWN -}; - -typedef void (*network_change_cb)(enum network_change, void *); +typedef void (*network_change_cb)(void *); int setup_netlink(TALLOC_CTX *mem_ctx, struct tevent_context *ev, network_change_cb change_cb, void *cb_data, diff --git a/src/monitor/monitor_netlink.c b/src/monitor/monitor_netlink.c index 33be7c850..cbf717fc3 100644 --- a/src/monitor/monitor_netlink.c +++ b/src/monitor/monitor_netlink.c @@ -250,9 +250,7 @@ static void link_msg_handler(struct nl_object *obj, void *arg) /* IFF_LOWER_UP is the indicator of carrier status */ if (flags & IFF_LOWER_UP) { - ctx->change_cb(NL_ROUTE_UP, ctx->cb_data); - } else { - ctx->change_cb(NL_ROUTE_DOWN, ctx->cb_data); + ctx->change_cb(ctx->cb_data); } } |