1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

bus: bump serial number counter when sending already sealed messages

This commit is contained in:
Lennart Poettering 2013-11-19 01:21:27 +01:00
parent 80c1974018
commit aea93debfa

View File

@ -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);
}