summaryrefslogtreecommitdiffstats
path: root/tools/hciconfig.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-11-23 19:38:22 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-11-23 19:38:22 +0000
commitdd5f6c5572b954ea569a918a1612820d3c7b8318 (patch)
tree6f48fca91b9568c1bdd0c1ae70e66b9ae383be97 /tools/hciconfig.c
parent3e9d510274d6560e026c76dc3ecf415db0dd7e68 (diff)
Fix strict-aliasing warning
Diffstat (limited to 'tools/hciconfig.c')
-rw-r--r--tools/hciconfig.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 527c9632..417147a5 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -348,8 +348,7 @@ static void cmd_aclmtu(int ctl, int hdev, char *opt)
if (sscanf(opt, "%4hu:%4hu", &mtu, &mpkt) != 2)
return;
- *((uint16_t *)&dr.dev_opt + 1) = mtu;
- *((uint16_t *)&dr.dev_opt + 0) = mpkt;
+ dr.dev_opt = mpkt | (mtu << 16);
if (ioctl(ctl, HCISETACLMTU, (unsigned long) &dr) < 0) {
fprintf(stderr, "Can't set ACL mtu on hci%d: %s(%d)\n",
@@ -369,9 +368,8 @@ static void cmd_scomtu(int ctl, int hdev, char *opt)
if (sscanf(opt, "%4hu:%4hu", &mtu, &mpkt) != 2)
return;
- *((uint16_t *)&dr.dev_opt + 1) = mtu;
- *((uint16_t *)&dr.dev_opt + 0) = mpkt;
-
+ dr.dev_opt = mpkt | (mtu << 16);
+
if (ioctl(ctl, HCISETSCOMTU, (unsigned long) &dr) < 0) {
fprintf(stderr, "Can't set SCO mtu on hci%d: %s (%d)\n",
hdev, strerror(errno), errno);