diff --git a/android/pan.c b/android/pan.c
index 6b19120..b8d7404 100644
--- a/android/pan.c
+++ b/android/pan.c
#define SVC_HINT_NETWORKING 0x02
#define BNEP_BRIDGE "bnep"
+#define BNEP_PANU_INTERFACE "bt-pan"
#define FORWARD_DELAY_PATH "/sys/class/net/"BNEP_BRIDGE"/bridge/forward_delay"
static bdaddr_t adapter_addr;
sk = g_io_channel_unix_get_fd(dev->io);
- dev->session = bnep_new(sk, l_role, r_role);
+ dev->session = bnep_new(sk, l_role, r_role, BNEP_PANU_INTERFACE);
if (!dev->session)
goto fail;
diff --git a/profiles/network/bnep.c b/profiles/network/bnep.c
index 82d0d99..1aa0783 100644
--- a/profiles/network/bnep.c
+++ b/profiles/network/bnep.c
return FALSE;
}
-struct bnep *bnep_new(int sk, uint16_t local_role, uint16_t remote_role)
+struct bnep *bnep_new(int sk, uint16_t local_role, uint16_t remote_role,
+ char *iface)
{
struct bnep *session;
int dup_fd;
session->io = g_io_channel_unix_new(dup_fd);
session->src = local_role;
session->dst = remote_role;
+ strncpy(session->iface, iface, 16);
+ session->iface[15] = '\0';
g_io_channel_set_close_on_unref(session->io, TRUE);
session->watch = g_io_add_watch(session->io,
diff --git a/profiles/network/bnep.h b/profiles/network/bnep.h
index 87cdacf..bc43d4f 100644
--- a/profiles/network/bnep.h
+++ b/profiles/network/bnep.h
const char *bnep_uuid(uint16_t id);
const char *bnep_name(uint16_t id);
-struct bnep *bnep_new(int sk, uint16_t local_role, uint16_t remote_role);
+struct bnep *bnep_new(int sk, uint16_t local_role, uint16_t remote_role,
+ char *iface);
void bnep_free(struct bnep *session);
typedef void (*bnep_connect_cb) (char *iface, int err, void *data);
diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 5f45fdb..cc73989 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
#include "connection.h"
#define NETWORK_PEER_INTERFACE "org.bluez.Network1"
+#define BNEP_INTERFACE "bnep%d"
typedef enum {
CONNECTED,
nc->state = DISCONNECTED;
memset(nc->dev, 0, sizeof(nc->dev));
- strcpy(nc->dev, "bnep%d");
+ strncpy(nc->dev, BNEP_INTERFACE, 16);
+ nc->dev[15] = '\0';
bnep_free(nc->session);
nc->session = NULL;
}
sk = g_io_channel_unix_get_fd(nc->io);
- nc->session = bnep_new(sk, BNEP_SVC_PANU, nc->id);
+ nc->session = bnep_new(sk, BNEP_SVC_PANU, nc->id, BNEP_INTERFACE);
if (!nc->session)
goto failed;