*
* Connection Manager
*
- * Copyright (C) 2011 Intel Corporation. All rights reserved.
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
static char *path;
static DBusConnection *connection;
+static int prev_phase;
char pppd_version[] = VERSION;
{
const char *reason = "disconnect";
DBusMessage *msg;
+ int send_msg = 0;
if (connection == NULL)
return;
- if (arg == PHASE_DEAD || arg == PHASE_DISCONNECT) {
+ if (prev_phase == PHASE_AUTHENTICATE &&
+ arg == PHASE_TERMINATE) {
+ reason = "auth failed";
+ send_msg = 1;
+ }
+
+ if (send_msg > 0 || arg == PHASE_DEAD || arg == PHASE_DISCONNECT) {
msg = dbus_message_new_method_call(busname, path,
interface, "notify");
if (msg == NULL)
dbus_message_unref(msg);
}
+
+ prev_phase = arg;
}
int plugin_init(void)