[PATCH v0 2/2] bluetooth: Detect changes in constant properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mikel Astiz <mikel.astiz@xxxxxxxxxxxx>

The D-Bus API should guarantee that some properties remain constant and
therefore treat changes in such properties as errors.
---
 src/modules/bluetooth/bluetooth-util.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 5da557a..d10eb97 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -367,6 +367,11 @@ static int parse_device_property(pa_bluetooth_device *d, DBusMessageIter *i, boo
                 pa_xfree(d->alias);
                 d->alias = pa_xstrdup(value);
             } else if (pa_streq(key, "Address")) {
+                if (is_property_change) {
+                    pa_log("Device property 'Address' expected to be constant but changed for %s", d->path);
+                    return -1;
+                }
+
                 pa_xfree(d->address);
                 d->address = pa_xstrdup(value);
             }
-- 
1.7.11.7



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux