summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-19 01:21:27 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-20 19:36:14 +0100
commitaea93debfa1281a7d5f1523225b043955c1c2472 (patch)
tree4564632dbe3ac7893908bb11dc884580ff4f89fc /src/libsystemd-bus
parent80c1974018fef49d74736c6893674e8e6eddd1d4 (diff)
bus: bump serial number counter when sending already sealed messages
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r--src/libsystemd-bus/sd-bus.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index d93138bb15..0be5a29f36 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -1271,8 +1271,13 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m) {
if (m->header->version > b->message_version)
return -EPERM;
- if (m->sealed)
+ if (m->sealed) {
+ /* If we copy the same message to multiple
+ * destinations, avoid using the same serial
+ * numbers. */
+ b->serial = MAX(b->serial, BUS_MESSAGE_SERIAL(m));
return 0;
+ }
return bus_message_seal(m, ++b->serial);
}