[PATCH] P2P: Add IFNAME=iface command option for interface redirection

Dmitry Shmidt dimitrysh at google.com
Tue May 21 14:48:16 EDT 2013

On Tue, May 21, 2013 at 12:55 AM, Jouni Malinen <j at w1.fi> wrote:
> On Mon, May 20, 2013 at 05:59:33PM -0700, Dmitry Shmidt wrote:
>> I like idea to have global interface to control everything. However,
>> it looks like it doesn't understand
>> "usual" interface commands like:
>> root at manta:/ # wpa_cli -g @android:wpa_wlan0
>> Interactive mode
>> > status
>> > IFNAME=wlan0 status
>> Unknown command 'IFNAME=wlan0'
>> > p2p_find
>> OK
> wpa_supplicant does understand the command and the "status" failing is
> by design since there is no way of figuring out which interface that
> would apply to without the IFNAME prefix. I guess there could also be a
> global STATUS command added to give systemwide (not specific to a
> network interface information).
> The middle one is a current limitation in wpa_cli, not in the
> wpa_supplicant control interface. You can run that with "raw
> IFNAME=wlan0 STATUS" from wpa_cli. I guess I should make wpa_cli
> understand that IFNAME= prefix, too, so that this would not need to go
> through the raw command. Anyway, this is all within wpa_cli.

You are right, raw command is working. I am going to prepare wpa_cli patch, if
you don't mind.

>> I understand that it was not your original design direction, but it
>> will be easier for wifi manager to
>> have one socket control and one socket monitor.
> That was the original design direction for the global control interface
> extensions, too, and it should work fine (and does in my tests). Please
> let me know if you hit any issues that are not just because of wpa_cli
> limitations on this. As far as I can tell, it should now be possible to
> run every operation (both commands and events) through the global
> interface now.

It is possible that I am confused with control and monitor socket mix,
but it looks like in case of global we are using "same" socket. It will
be different socket descriptor, but it is literally connected to the same file.
wpa_ctrl_open() will connect control and monitor socket to same "named"
I see it is working, but isn't it a chance that we can mess control and event
Is there easy way to use different name sockets for global interface for
control and monitor?

> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap

More information about the HostAP mailing list