BUGFIX#5730 : finally fixed
authorjaviplx <javiplx@gmail.com>
Fri, 28 May 2010 16:58:18 +0000 (16:58 +0000)
committerjaviplx <javiplx@gmail.com>
Fri, 28 May 2010 16:58:18 +0000 (16:58 +0000)
git-svn-id: file:///svnroot/wifihood/trunk@5 c51dfc6a-5949-4919-9c8e-f207a149c383

wifiscand/debian/changelog
wifiscand/wifiscand.c

index 0e4321f..e62985c 100644 (file)
@@ -1,3 +1,9 @@
+wifiscand (1.1-1) fremantle; urgency=low
+
+  * #5730 : fixed restoration of initial interface state
+
+ -- Javier Palacios <javiplx@gmail.com>  Fri, 28 May 2010 18:47:22 +0200
+
 wifiscand (1.0-1) fremantle; urgency=low
 
   * First release
index c0e29d8..0ee874e 100644 (file)
@@ -211,6 +211,9 @@ struct _AppData {
     osso_context_t *osso_context;
 };
 
+static GMainLoop *event_loop = NULL;
+static short int start_flags = 0;
+
 /* Callback for normal D-BUS messages */
 gint dbus_req_handler(const gchar * interface, const gchar * method,
                       GArray * arguments, gpointer data,
@@ -229,6 +232,12 @@ gint dbus_req_handler(const gchar * interface, const gchar * method,
     }
 
     if ( strcmp(method,"stop")==0 ) {
+       struct ifreq frq;
+       strncpy(frq.ifr_name, appdata->iface.ifname, IFNAMSIZ);
+       if(!ioctl(appdata->iface.sock, SIOCGIFFLAGS, &frq)) {
+           frq.ifr_flags = start_flags;
+           ioctl(appdata->iface.sock, SIOCSIFFLAGS, &frq);
+       }
         iw_sockets_close(appdata->iface.sock);
        appdata->iface.sock = 0;
     //    osso_system_note_infoprint(appdata->osso_context, "Stopping WifiScan", NULL);
@@ -266,8 +275,6 @@ gint dbus_req_handler(const gchar * interface, const gchar * method,
     return OSSO_ERROR;
 }
 
-static GMainLoop *event_loop = NULL;
-static short int start_flags = 0;
 
 int main( void ) {