Hi Tomasz,

I met a wifi direct issue when use latest connman.

I'm not sure whether I catch your point, if I'm wrong , please correct me, thanks:-)

This patch seem that connman will use peer's */Group/* member to check whether local side is GC. and peer's group will updata when peer property changed, and it may come after group started signal arrival,
so here will get a wrong role. you can find it in attached log.

In my case, local side is GC, but connman start a dhcp server :(

On 07/17/2014 07:00 PM, Tomasz Bursztyka wrote:
+bool g_supplicant_peer_is_client(GSupplicantPeer *peer)
+{
+       GSupplicantGroup *group;
+       GSList *list;
+
+       if (!peer)
+               return false;
+
+       for (list = peer->groups; list; list = list->next) {
+               group = list->data;
+
Whether we need consider the case peer->groups= NULL?
+               if (group->role != G_SUPPLICANT_GROUP_ROLE_CLIENT ||
+                               group->orig_interface != peer->interface)
+                       continue;
+
+               if (group->interface == peer->current_group_iface)
+                       return true;
+       }
+
+       return false;
+}
+

connmand[4448]: gsupplicant/supplicant.c:signal_group_started() 
connmand[4448]: plugins/wifi.c:peer_changed() ident: 2208eddaee3e
connmand[4448]: plugins/wifi.c:peer_changed() name: HUAWEI, state 1
connmand[4448]: src/peer.c:connman_peer_unref_debug() 0x8bfc250 ref 1 by plugins/wifi.c:200:peer_cancel_timeout()
connmand[4448]: gsupplicant/supplicant.c:g_supplicant_peer_is_client() peer 0x8c02570
connmand[4448]: gsupplicant/supplicant.c:g_supplicant_peer_is_client() peer->groups (nil)
connmand[4448]: plugins/wifi.c:peer_changed() local side client 0
connmand[4448]: gsupplicant/supplicant.c:g_supplicant_peer_is_client() peer 0x8c02570
connmand[4448]: gsupplicant/supplicant.c:g_supplicant_peer_is_client() peer->groups (nil)
connmand[4448]: src/peer.c:start_dhcp_server() 
connmand[4448]: src/ippool.c:__connman_ippool_create() 
connmand[4448]: src/inet.c:__connman_inet_modify_address() cmd 0x14 flags 0x104 index 3 family 2 address 192.168.0.1 peer (null) prefixlen 24 broadcast 192.168.0.255
connmand[4448]: Peer DHCP server: option_code 1 option_value 255.255.255.0
connmand[4448]: Peer DHCP server: option_code 3 option_value 192.168.0.1
connmand[4448]: src/peer.c:connman_peer_ref_debug() 0x8bfc250 ref 2 by src/peer.c:143:start_dhcp_server()
connmand[4448]: src/rtnl.c:rtnl_message() buf 0xbffa42d0 len 60
connmand[4448]: src/rtnl.c:rtnl_message() NEWADDR len 60 type 20 flags 0x0000 seq 1 pid -4737
connmand[4448]: src/ipconfig.c:__connman_ipconfig_newaddr() index 3
connmand[4448]: wlan0 {add} address 192.168.0.1/24 label wlan0 family 2
connmand[4448]: src/rtnl.c:rtnl_message() buf 0xbffa42d0 len 60
connmand[4448]: src/rtnl.c:rtnl_message() NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
connmand[4448]: src/rtnl.c:rtnl_message() buf 0xbffa42d0 len 60
connmand[4448]: src/rtnl.c:rtnl_message() NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
connmand[4448]: src/rtnl.c:rtnl_message() buf 0xbffa42d0 len 60
connmand[4448]: src/rtnl.c:rtnl_message() NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
connmand[4448]: src/ipconfig.c:__connman_ipconfig_newroute() index 3
connmand[4448]: wlan0 {add} route 192.168.0.0 gw 0.0.0.0 scope 253 <LINK>
connmand[4448]: src/rtnl.c:rtnl_message() buf 0xbffa42d0 len 60
connmand[4448]: src/rtnl.c:rtnl_message() NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
connmand[4448]: gsupplicant/supplicant.c:signal_interface_changed() 
connmand[4448]: gsupplicant/supplicant.c:interface_property() State
connmand[4448]: plugins/wifi.c:interface_state() wifi 0x8bf0468 interface state 10
connmand[4448]: gsupplicant/supplicant.c:interface_property() state completed (10)
connmand[4448]: gsupplicant/supplicant.c:interface_property() CurrentAuthMode
connmand[4448]: gsupplicant/supplicant.c:interface_property() key CurrentAuthMode type s
connmand[4448]: gsupplicant/supplicant.c:signal_peer_changed() 
connmand[4448]: gsupplicant/supplicant.c:peer_property() key: Groups
connmand[4448]: gsupplicant/supplicant.c:peer_property() key: Groups
connmand[4448]: gsupplicant/supplicant.c:peer_property() key: Groups, signal ao
connmand[4448]: gsupplicant/supplicant.c:peer_property() 97
connmand[4448]: gsupplicant/supplicant.c:peer_groups_relation() 
connmand[4448]: gsupplicant/supplicant.c:peer_groups_relation() str: /fi/w1/wpa_supplicant1/Interfaces/1/Groups/SE
connmand[4448]: gsupplicant/supplicant.c:peer_groups_relation() group: 0x8bf6720
connmand[4448]: gsupplicant/supplicant.c:peer_groups_relation() peer->group: 0x8bff3e0

_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to