From: Marcel Holtmann Date: Wed, 26 Mar 2008 20:47:24 +0000 (+0100) Subject: Add workaround for my D-Link access point X-Git-Tag: 2.0_alpha~4871 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15e9803aefdf8996a9b4bdb0388500adef9577ed;p=framework%2Fconnectivity%2Fconnman.git Add workaround for my D-Link access point --- diff --git a/src/iface.c b/src/iface.c index 3632a68..6a9aa84 100644 --- a/src/iface.c +++ b/src/iface.c @@ -360,7 +360,8 @@ void connman_iface_indicate_station(struct connman_iface *iface, const char *name, int strength, int security) { DBusMessage *signal; - char *passphrase; + char *ssid, *passphrase; + int len; DBG("iface %p security %d name %s", iface, security, name); @@ -380,12 +381,21 @@ void connman_iface_indicate_station(struct connman_iface *iface, if (iface->state != CONNMAN_IFACE_STATE_SCANNING) return; - passphrase = __connman_iface_find_passphrase(iface, name); + len = strlen(name); + ssid = strdup(name); + if (ssid == NULL) + return; + + /* The D-Link access points return a 0x05 at the end of the SSID */ + if (ssid[len - 1] == '\05') + ssid[len - 1] = '\0'; + + passphrase = __connman_iface_find_passphrase(iface, ssid); if (passphrase != NULL) { - DBG("network %s passphrase %s", name, passphrase); + DBG("network %s passphrase %s", ssid, passphrase); g_free(iface->network.identifier); - iface->network.identifier = g_strdup(name); + iface->network.identifier = g_strdup(ssid); g_free(iface->network.passphrase); iface->network.passphrase = passphrase; @@ -395,6 +405,8 @@ void connman_iface_indicate_station(struct connman_iface *iface, state_changed(iface); } } + + free(ssid); } int connman_iface_get_ipv4(struct connman_iface *iface,