summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-12-25 17:43:16 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-12-25 17:43:16 +0000
commitbbda499067067aefc8e642a2784d247ac0331eae (patch)
treea702f2c2ba1716b29c5f3b4d019c4590330ff461 /tools
parentac243219976dab3363bcd3215f963eb0026af788 (diff)
Add memset() to different places to initialize the structures
Diffstat (limited to 'tools')
-rw-r--r--tools/ciptool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/ciptool.c b/tools/ciptool.c
index d0b6625d..7c952cf4 100644
--- a/tools/ciptool.c
+++ b/tools/ciptool.c
@@ -146,9 +146,9 @@ static int do_connect(int ctl, int dev_id, bdaddr_t *src, bdaddr_t *dst, unsigne
exit(1);
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, src);
- addr.l2_psm = 0;
if (bind(sk, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
perror("Can't bind L2CAP socket");
@@ -156,7 +156,9 @@ static int do_connect(int ctl, int dev_id, bdaddr_t *src, bdaddr_t *dst, unsigne
exit(1);
}
+ memset(&opts, 0, sizeof(opts));
size = sizeof(opts);
+
if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &opts, &size) < 0) {
perror("Can't get L2CAP options");
close(sk);
@@ -173,6 +175,7 @@ static int do_connect(int ctl, int dev_id, bdaddr_t *src, bdaddr_t *dst, unsigne
exit(1);
}
+ memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
bacpy(&addr.l2_bdaddr, dst);
addr.l2_psm = htobs(psm);