diff options
Diffstat (limited to 'dbus/dbus-transport-afbus.c')
-rw-r--r-- | dbus/dbus-transport-afbus.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/dbus/dbus-transport-afbus.c b/dbus/dbus-transport-afbus.c index f8ed372f..b4fe6e6e 100644 --- a/dbus/dbus-transport-afbus.c +++ b/dbus/dbus-transport-afbus.c @@ -29,6 +29,12 @@ #include "dbus-transport-socket.h" #include "dbus-watch.h" +/* FIXME: get this from glibc headers */ +#define SOL_BUS 280 + +#define BUS_ADD_ADDR 1 +#define BUS_JOIN_BUS 2 + /** * @defgroup DBusTransportAfbus AF_BUS-based DBusTransport implementation * @ingroup DBusInternals @@ -48,13 +54,21 @@ typedef struct DBusTransportAfbus DBusTransportAfbus; struct DBusTransportAfbus { DBusTransportSocket base; /**< Parent instance */ - int fd; /**< File descriptor. */ }; static void afbus_authenticated (DBusTransportSocket *socket_transport) { + /* Make the client join the bus when authenticated, so that it can send + * unicast messages to peers other than the daemon */ + if (setsockopt (_dbus_transport_get_socket_fd ((DBusTransport *) socket_transport, + SOL_BUS, + BUS_JOIN_BUS, + NULL, 0) != 0) + { + _dbus_verbose ("Could not join client to the bus\n"); + } } static const DBusTransportSocketVTable afbus_vtable = { @@ -86,8 +100,6 @@ _dbus_transport_new_for_afbus (int fd, server_guid, address)) goto failed_1; - afbus_transport->fd = fd; - return (DBusTransport *) afbus_transport; failed_1: |