connection: store reply trackers at reply_dst side
authorDaniel Mack <daniel@zonque.org>
Thu, 8 Jan 2015 13:14:14 +0000 (14:14 +0100)
committerDaniel Mack <daniel@zonque.org>
Thu, 8 Jan 2015 13:14:14 +0000 (14:14 +0100)
commit980a3f42f5ff353bfda904aa0d26e16737336103
treec44a4baffe255715da3edd5f650c4703fffdd1d0
parent8a81af663ee87d0a572db21fee303dc1a018f863
connection: store reply trackers at reply_dst side

We are currently storing the reply objects at the connection that is
expected to send the reply. This raises some problems with interrupted
system calls when the message receiver name is taken over while the
sender has returned to userspace, before it restarts the syscall. If
the name is not taken over, but the receiver simply dies at this time,
we even leak the kdbus_reply object.

Fix this by storing the replies with the sending (and possibly
blocking) connection, as this is really where they belong. However,
this means that when moving messages, or when a connection dies, we
have to walk all connection on the bus in order to find pending replies
that point back to the connection in question. This can be optimized
with a second list, but I left that for later.

Signed-off-by: Daniel Mack <daniel@zonque.org>
connection.c
reply.c
reply.h