Ejemplo n.º 1
0
void nl80211_remove_monitor_interface(struct nl80211_data* ctx)
{
    if (ctx->monitor_ifidx >= 0) {
        nl80211_remove_iface(ctx, ctx->monitor_ifidx);
        ctx->monitor_ifidx = -1;
    }

    if (ctx->monitor_sock >= 0) {
        eloop_unregister_read_sock(ctx->monitor_sock);
        close(ctx->monitor_sock);
        ctx->monitor_sock = -1;
    }
}
Ejemplo n.º 2
0
void nl80211_remove_monitor_interface(struct wpa_driver_nl80211_data *drv)
{
	if (drv->monitor_refcount > 0)
		drv->monitor_refcount--;
	wpa_printf(MSG_DEBUG, "nl80211: Remove monitor interface: refcount=%d",
		   drv->monitor_refcount);
	if (drv->monitor_refcount > 0)
		return;

	if (drv->monitor_ifidx >= 0) {
		nl80211_remove_iface(drv, drv->monitor_ifidx);
		drv->monitor_ifidx = -1;
	}
	if (drv->monitor_sock >= 0) {
		eloop_unregister_read_sock(drv->monitor_sock);
		close(drv->monitor_sock);
		drv->monitor_sock = -1;
	}
}