diff options
author | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-10-31 14:52:08 +0000 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.dentz@openbossa.org> | 2007-10-31 14:52:08 +0000 |
commit | 980c9cff04d70d6301c9538647872156b1b425eb (patch) | |
tree | b92bfc94e10a92813ca5cbbba54216bee357b46a /network | |
parent | 1884104ecb9b6b6a9ef6cc02d04e4861c9f1f6f6 (diff) |
Make the connection to fail if unable to add a interface to bridges.
Diffstat (limited to 'network')
-rw-r--r-- | network/bridge.c | 8 | ||||
-rw-r--r-- | network/server.c | 5 |
2 files changed, 8 insertions, 5 deletions
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); |