]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/misc-progs/wirelessctrl.c
Merge branch 'master' into fifteen
[people/teissler/ipfire-2.x.git] / src / misc-progs / wirelessctrl.c
index 1f1b0f861e6a75913243938dd59482ee6328249e..e3a1107c2bff927bb2aa6e6b4d49bcb0e51ff8db 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
-#include "setuid.h"
 #include <errno.h>
 
+#include "setuid.h"
+#include "netutil.h"
+
 FILE *fd = NULL;
 char blue_dev[STRING_SIZE] = "";
 char command[STRING_SIZE];
@@ -130,7 +132,7 @@ int main(void) {
                macaddress = strtok(NULL, ",");
                enabled = strtok(NULL, ",");
 
-               if (strncmp(enabled, "on", 2) != 0) {
+               if (strcmp(enabled, "on") == 0) {
                        /* both specified, added security */
                        if ((strlen(macaddress) == 17) && (VALID_IP_AND_MASK(ipaddress))) {
                                snprintf(command, STRING_SIZE-1, "/sbin/iptables -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j ACCEPT", macaddress, ipaddress, blue_dev);