summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}