From 980c9cff04d70d6301c9538647872156b1b425eb Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 31 Oct 2007 14:52:08 +0000 Subject: Make the connection to fail if unable to add a interface to bridges. --- network/bridge.c | 8 ++++++-- network/server.c | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'network') diff --git a/network/bridge.c b/network/bridge.c index ad4fc72e..7dbbd616 100644 --- a/network/bridge.c +++ b/network/bridge.c @@ -42,8 +42,8 @@ #include "common.h" static int bridge_socket = -1; -static const char *gn_bridge; -static const char *nap_bridge; +static const char *gn_bridge = NULL; +static const char *nap_bridge = NULL; int bridge_init(const char *gn_iface, const char *nap_iface) { @@ -118,6 +118,10 @@ int bridge_add_interface(int id, const char *dev) if (err < 0) return err; + /* Only run scripts in GN bridges */ + if (id != BNEP_SVC_GN) + return 0; + err = bnep_if_up(name, id); if (err < 0) return err; diff --git a/network/server.c b/network/server.c index e9db7df9..8c7bfb0d 100644 --- a/network/server.c +++ b/network/server.c @@ -334,7 +334,6 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) goto failed; info("Authorization succedded. New connection: %s", devname); - response = BNEP_SUCCESS; bridge = bridge_get_name(ns->id); if (bridge) { @@ -348,9 +347,9 @@ static void authorization_callback(DBusPendingCall *pcall, void *data) } else bnep_if_up(devname, ns->id); - ns->clients = g_slist_append(ns->clients, g_strdup(s->address)); + response = BNEP_SUCCESS; - /* FIXME: send the D-Bus message to notify the new bnep iface */ + ns->clients = g_slist_append(ns->clients, g_strdup(s->address)); failed: send_bnep_ctrl_rsp(s->nsk, response); -- cgit