disable watchdog functionality (except for distance) in ad-hoc mode (fixes #373)
authorFelix Fietkau <nbd@openwrt.org>
Tue, 22 Aug 2006 11:59:30 +0000 (11:59 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 22 Aug 2006 11:59:30 +0000 (11:59 +0000)
SVN-Revision: 4623

openwrt/package/wificonf/wificonf.c

index 7f83a8f595f7d790d70fadafda7f9306d0f0e86f..335dbfc3d1533422408f441726bda0c1e81b1d9e 100644 (file)
@@ -281,7 +281,7 @@ void start_watchdog(int skfd, char *ifname)
 {
        FILE *f;
        unsigned char buf[8192], wdslist[8192], wbuf[80], *v, *p, *next, *tmp;
-       int i, j, wds = 0, c = 0, restart_wds = 0, wdstimeout = 0;
+       int i, j, wds = 0, c = 0, restart_wds = 0, wdstimeout = 0, infra;
 
        if (fork())
                return;
@@ -289,6 +289,8 @@ void start_watchdog(int skfd, char *ifname)
        f = fopen("/var/run/wifi.pid", "w");
        fprintf(f, "%d\n", getpid());
        fclose(f);
+
+       infra = strtol(nvram_safe_get(wl_var("infra")), NULL, 0);
        
        v = nvram_safe_get(wl_var("wds"));
        memset(wdslist, 0, 8192);
@@ -314,6 +316,9 @@ void start_watchdog(int skfd, char *ifname)
                else
                        c = 0;
 
+               if (infra != 1)
+                       continue;
+
                if (nvram_match(wl_var("mode"), "sta") ||
                        nvram_match(wl_var("mode"), "wet")) {
                        i = 0;