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
1 changed files with 6 additions and 1 deletions

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