[PATCH] gdhcp: Fix resource leak
The socket was not closed when the sendto got failed. --- gdhcp/ipv4ll.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c index 17ab3d5..283bb9b 100644 --- a/gdhcp/ipv4ll.c +++ b/gdhcp/ipv4ll.c @@ -110,11 +110,12 @@ int ipv4ll_send_arp_packet(uint8_t* source_eth, uint32_t source_ip, n = sendto(fd, p, sizeof(p), 0, (struct sockaddr*) dest, sizeof(dest)); - if (n 0) - return -errno; close(fd); + if (n 0) + return -errno; + return n; } -- 1.7.10.4 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] gweb: Check null before reference
Check NULL before making a reference. --- gweb/gresolv.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gweb/gresolv.c b/gweb/gresolv.c index d30e2f1..fbb7a54 100644 --- a/gweb/gresolv.c +++ b/gweb/gresolv.c @@ -1003,11 +1003,11 @@ guint g_resolv_lookup_hostname(GResolv *resolv, const char *hostname, { struct resolv_lookup *lookup; - debug(resolv, hostname %s, hostname); - if (resolv == NULL) return 0; + debug(resolv, hostname %s, hostname); + if (resolv-nameserver_list == NULL) { int i; -- 1.7.10.4 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] inet: Fix resource leak
The socket was not closed when err 0 is true. --- src/inet.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/inet.c b/src/inet.c index be69aca..7a0bc7e 100644 --- a/src/inet.c +++ b/src/inet.c @@ -1382,9 +1382,7 @@ int connman_inet_setup_tunnel(char *tunnel, int mtu) index = if_nametoindex(tunnel); err = connman_inet_set_mtu(index, mtu); - if (err 0) - return err; - else if (err) + if (err != 0) goto done; memset(ifr, 0, sizeof(ifr)); -- 1.7.10.4 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
[PATCH] bridge: Fix resource leak
The socket was not closed when err != -EEXIST was true. --- src/bridge.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bridge.c b/src/bridge.c index 2849ef7..47467e6 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -76,7 +76,9 @@ int __connman_bridge_create(const char *name) if (ioctl(sk, SIOCBRADDBR, name) == -1) { err = -errno; if (err != -EEXIST) - return -EOPNOTSUPP; + err = -EOPNOTSUPP; + + goto done; } err = set_forward_delay(name, 0); @@ -84,6 +86,7 @@ int __connman_bridge_create(const char *name) if (err 0) ioctl(sk, SIOCBRDELBR, name); +done: close(sk); return err; -- 1.7.10.4 ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman
Connman 1.9 won't attempt connecting to wifi service
Hello, Today i noticed one issue. I am not sure whether this is a bug or this is by design. I have a saved wifi profile with Autoconnect turned on and was able to connect to that profile without any problems. Yesterday i updated wpa_supplicant to version 1.0 and found that connman was no longer able to connect to by saved profile. So i reverted back to wpa_supplicant-0.7.3 and noticed that connman was still not able to connect to my saved wifi profile. I noticed that connman had appended a line 'Failure=invalid-key' in the settings file of the saved wifi profile due to which the connection was not happening even after restarting connman multiple times. I had to remove that line for it to start working again. I would have expected that connman would attempt connecting to the service at least once and figure out whether the key was invalid or not and then stop connection attempts to the service if the key was found to be invalid. At the moment I don't have an agent registered, so i don't know if there is something more that occurs in this case. The condition that occured in my case was purely a side effect of being in developer mode. I am not sure if this could occur in production mode. One last thing, Is connman compatible with wpa_supplicant-1.0? Lemme know. Thanks and Regards ~Sameer ___ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman