summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:26:25 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:26:25 +0000
commitd26525ada19fa8bb1a5d379dc14d68352161a221 (patch)
tree4dae8aae8eee704382884b5f500fd40b384b1688
parentec7083e9e5ba28b679f231c7bc341330feddf2ce (diff)
Fix bridge removal on exit.
-rw-r--r--network/server.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/network/server.c b/network/server.c
index de30f72e..e9fc2506 100644
--- a/network/server.c
+++ b/network/server.c
@@ -346,11 +346,13 @@ static void authorization_callback(DBusPendingCall *pcall, void *data)
bridge = bridge_get_name(ns->id);
if (bridge) {
bnep_if_up(devname, 0);
- if (!ns->up)
+ if (!ns->up) {
bnep_if_up(bridge, ns->id);
+ ns->iface = g_strdup(bridge);
+ ns->up = TRUE;
+ }
} else
bnep_if_up(devname, ns->id);
- ns->up = TRUE;
ns->clients = g_slist_append(ns->clients, g_strdup(s->address));
@@ -1138,6 +1140,9 @@ static void server_unregister(DBusConnection *conn, void *data)
info("Unregistered server path:%s", ns->path);
+ if (ns->up)
+ bnep_if_down(ns->iface);
+
server_free(ns);
}