[PATCH 5/9] dbus: Provide the intended address of the peer

Jouni Malinen j
Fri May 16 08:14:38 PDT 2014


On Wed, May 14, 2014 at 04:10:42PM +0300, Tomasz Bursztyka wrote:
> This info will be fulfilled once paired with the peer.

What would this be used for by an external program?

> --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
> +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
> @@ -20,6 +20,7 @@
>  #include "dbus_new_handlers_p2p.h"
>  #include "dbus_dict_helpers.h"
>  #include "p2p/p2p.h"
> +#include "p2p/p2p_i.h"

You are not allowed to do that. *_i.h header files are internal to the
module and apart from couple of small exceptions, they must not be
included outside the directory where they are defined. This specific
case is clearly not one of those exceptions.

> +	struct p2p_device *dev;

> +	dev = (struct p2p_device *) (((u8 *) info) -
> +				     offsetof(struct p2p_device, info));

struct p2p_device is internal to src/p2p/* and shall not be dereferenced
here. If you need dev->intended_addr, you'll better have a good use case
for this and if so, the propoer way of doing this is by moving
intended_addr from struct p2p_device into struct p2p_peer_info. That
said, the way intended_addr is used within src/p2p is very much internal
to it and subject to change, so exposing it through the D-Bus interface
does not sound appropriate.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list