summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:30:48 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-09-28 13:30:48 +0000
commit54943abd65058d7c24fbf9384759181c16913a96 (patch)
tree1a15484532ef237cf2d5aa55c2ca3756ef3c3235
parent684fe2781c46ccfb30a4e653fad126286bddcdcb (diff)
Add secure link mode.
-rw-r--r--network/manager.c2
-rw-r--r--network/server.c6
-rw-r--r--network/server.h3
3 files changed, 6 insertions, 5 deletions
diff --git a/network/manager.c b/network/manager.c
index b5b4f0a8..053e03bb 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -939,7 +939,7 @@ int network_init(DBusConnection *conn, struct network_conf *service_conf)
* (setup connection request) contains the destination service
* field that defines which service the source is connecting to.
*/
- if (server_init(conn, conf->iface_prefix) < 0)
+ if (server_init(conn, conf->iface_prefix, conf->security) < 0)
return -1;
if (connection_init(conn, conf->iface_prefix) < 0)
diff --git a/network/server.c b/network/server.c
index b5a2c6d0..ac87ad19 100644
--- a/network/server.c
+++ b/network/server.c
@@ -600,7 +600,8 @@ static gboolean connect_event(GIOChannel *chan,
return TRUE;
}
-int server_init(DBusConnection *conn, const char *iface_prefix)
+int server_init(DBusConnection *conn, const char *iface_prefix,
+ gboolean secure)
{
struct l2cap_options l2o;
struct sockaddr_l2 l2a;
@@ -645,8 +646,7 @@ int server_init(DBusConnection *conn, const char *iface_prefix)
goto fail;
}
- /* FIXME: Set link mode - it is applied to all servers */
- lm = 0;
+ lm = secure? L2CAP_LM_SECURE : 0;
if (lm && setsockopt(sk, SOL_L2CAP, L2CAP_LM, &lm, sizeof(lm)) < 0) {
err = errno;
error("Failed to set link mode. %s(%d)",
diff --git a/network/server.h b/network/server.h
index 9f49cad7..839aea4b 100644
--- a/network/server.h
+++ b/network/server.h
@@ -21,7 +21,8 @@
*
*/
-int server_init(DBusConnection *conn, const char *iface_prefix);
+int server_init(DBusConnection *conn, const char *iface_prefix,
+ gboolean secure);
void server_exit();
int server_register(const char *path, bdaddr_t *src, uint16_t id);
int server_register_from_file(const char *path, const bdaddr_t *src,