advertising: parse_secondary: fix mask value
authorChristian Eggers <ceggers@arri.de>
Fri, 23 Sep 2022 14:55:55 +0000 (16:55 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:55 +0000 (14:55 +0530)
It looks like a wrong mask value is used here as only the bits mentioned
in adv_secondary::flag can be set again within the loop.

Replace magic number by preprocessor macro.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
src/advertising.c

index f0b2ce4..0f7593a 100644 (file)
@@ -1046,7 +1046,7 @@ static bool parse_secondary(DBusMessageIter *iter,
                return false;
 
        /* Reset secondary channels before parsing */
-       client->flags &= 0xfe00;
+       client->flags &= ~MGMT_ADV_FLAG_SEC_MASK;
 
        dbus_message_iter_get_basic(iter, &str);