Skip to contentSkip to conversation

core/advertising: Fix byte order for MGMT_OP_ADD_ADVERTISING flags

PATCH In review Andrejs Hanins 3 participants 4 messages Jul 22, 2015 – Mar 17, 2016 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core/advertising: Fix byte order for MGMT_OP_ADD_ADVERTISING flags

Fix byte order for MGMT_OP_ADD_ADVERTISING flags

---
 src/advertising.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/advertising.c +1 -1
index d56b7a2..8c249d1 100644
@@ -500,7 +500,7 @@ static DBusMessage *refresh_advertisement(struct advertisement *ad)
 		return btd_error_failed(ad->reg, "Failed");
 	}
 
-	cp->flags = flags;
+	cp->flags = htobl(flags);
 	cp->instance = ad->instance;
 	cp->adv_data_len = adv_data_len;
 	memcpy(cp->data, adv_data, adv_data_len);
Signature · 1 line
1.9.1
#1 lore raw

Hi,

Quoted 5 lines · Andrejs Hanins

Fix byte order for MGMT_OP_ADD_ADVERTISING flags

---
 src/advertising.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good.

Quoted 14 lines
src/advertising.c +1 -2
index d56b7a2..8c249d1 100644
@@ -500,7 +500,7 @@ static DBusMessage *refresh_advertisement(struct advertisement *ad)
 		return btd_error_failed(ad->reg, "Failed");
 	}
 
-	cp->flags = flags;
+	cp->flags = htobl(flags);
 	cp->instance = ad->instance;
 	cp->adv_data_len = adv_data_len;
 	memcpy(cp->data, adv_data, adv_data_len);
--
Quoted 1 line

1.9.1

Cheers,
--
Vinicius

#2 lore raw
In reply to Andrejs Hanins

Hi,

Quoted 10 lines · Andrejs Hanins

Fix byte order for MGMT_OP_ADD_ADVERTISING flags

---
 src/advertising.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/advertising.c +0 -0
index d56b7a2..8c249d1 100644

src/advertising.c static DBusMessage *refresh_advertisement(struct advertisement *ad) · line 506

Quoted 8 lines
src/advertising.c +1 -1
@@ -500,7 +500,7 @@ static DBusMessage *refresh_advertisement(struct advertisement *ad)
 		return btd_error_failed(ad->reg, "Failed");
 	}
 
-	cp->flags = flags;
+	cp->flags = htobl(flags);
 	cp->instance = ad->instance;
 	cp->adv_data_len = adv_data_len;
 	memcpy(cp->data, adv_data, adv_data_len);

I'm surprised you never pinged about this forgotten patch (which I noticed now when cleaning up my linux-bluetooth folder). Anyway, the patch has been applied. Thanks.

Johan

#3 lore raw

Hi,

Quoted 16 lines · Johan Hedberg

Hi,

Quoted 13 lines · Andrejs Hanins

Fix byte order for MGMT_OP_ADD_ADVERTISING flags

---
 src/advertising.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/advertising.c +0 -0
index d56b7a2..8c249d1 100644
@@ -500,7 +500,7 @@ static DBusMessage *refresh_advertisement(struct advertisement *ad)
 		return btd_error_failed(ad->reg, "Failed");
 	}
 
Quoted 8 lines

src/advertising.c static DBusMessage *refresh_advertisement(struct advertisement *ad) · line 506

Quoted 5 lines
src/advertising.c +1 -1
-	cp->flags = flags;
+	cp->flags = htobl(flags);
 	cp->instance = ad->instance;
 	cp->adv_data_len = adv_data_len;
 	memcpy(cp->data, adv_data, adv_data_len);

I'm surprised you never pinged about this forgotten patch (which I noticed now when cleaning up my linux-bluetooth folder). Anyway, the patch has been applied. Thanks.

I was hoping that subject is an immediate attention grabber :) I'm glad it is finally applied.

Quoted 2 lines

Johan