Hi Tomasz,

On 08/04/2014 03:52 PM, Tomasz Bursztyka wrote:
Hi,
+++ b/src/dhcp.c
@@ -459,7 +459,8 @@ static void lease_available_cb(GDHCPClient *dhcp_client, gpointer user_data)
          __connman_ipconfig_set_gateway(dhcp->ipconfig, gateway);
      }
  -    if (!apply_lease_available_on_network(dhcp_client, dhcp))
+    if (dhcp->network
+        && !apply_lease_available_on_network(dhcp_client, dhcp))
          return;

Indeed, but do the test in apply_lease_available_on_network() preferably.
just a: if (!dhcp->network)
                return true;
Here is my understanding:
1 From the name of the function, return "true" seemed to mean that apply lease available on network successful.
In fact. the network is NULL, and it should failed.
2 At the same time, what the function do is about service update. but the patch is about P2P.

In consideration of those reasons, I move the code to lease_available_cb.

Best Regards
Guoqiang

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

Reply via email to