[PATCH 1/7] dbus: Provide the interface address of the peer

Jouni Malinen j
Wed May 21 13:58:37 PDT 2014

On Tue, May 20, 2014 at 02:51:08PM +0300, Tomasz Bursztyka wrote:
> This info will be useful once paired with the peer.

Could you please describe what you would be using this information for?
There is a reason for keeping this information "hidden" outside struct
p2p_peer_info since it can be surprising how this field behaves
especially if the peer happens to be using multiple interface addresses.
In other words, this may be the interface address used in a completely
separate P2P group which has nothing to do with the local device. In
addition, the address information may change frequently if the peer is
in two P2P groups, so you don't know what exactly you'll get back here.

> +	info = p2p_get_peer_info(peer_args->wpa_s->global->p2p,
> +				 peer_args->p2p_device_addr, 0);

> +	p2p_get_interface_addr(peer_args->wpa_s->global->p2p,
> +			       info->p2p_device_addr, iface_addr);

If you want to get the interface address of the peer in a specific group
(e.g., the one in which the local device is also a member), this is not
the way to get that information. To be more complete, there is no such
information stored reliably within wpa_supplicant currently, i.e., to be
able to expose this information, you would first need to extend the P2P
module to support storage of per-group information for each peer device.
The peer may be in multiple groups concurrently and as such, can have
multiple P2P Interface Addresses. In general, you cannot find the
correct one by using P2P Device Address as the key.
Jouni Malinen                                            PGP id EFC895FA

More information about the Hostap mailing list