]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/misc-progs/wirelessctrl.c
DNS: Import local hosts into unbound
[ipfire-2.x.git] / src / misc-progs / wirelessctrl.c
index 4a2e6dc862d371f6cb9647766de2a9fd809df11b..1e166eb3da160f0467641d82f49cd5e2a41d3373 100644 (file)
@@ -39,7 +39,6 @@ void exithandler(void) {
 }
 
 int main(void) {
-       char green_dev[STRING_SIZE] = "";
        char buffer[STRING_SIZE];
        char *index, *ipaddress, *macaddress, *enabled;
        struct keyvalue *kv = NULL;
@@ -68,14 +67,6 @@ int main(void) {
                exit(1);
        }
 
-       /* Get the GREEN interface details */
-       if (findkey(kv, "GREEN_DEV", green_dev) > 0) {
-               if (!VALID_DEVICE(green_dev)) {
-                       fprintf(stderr, "Bad GREEN_DEV: %s\n", green_dev);
-                       exit(1);
-               }
-       }
-
        /* Get the BLUE interface details */
        if (findkey(kv, "BLUE_DEV", blue_dev) > 0) {
                if ((strlen(blue_dev) > 0) && !VALID_DEVICE(blue_dev)) {
@@ -135,21 +126,21 @@ int main(void) {
                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 --wait -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j ACCEPT", macaddress, ipaddress, blue_dev);
+                               snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -s %s -i %s -j RETURN", macaddress, ipaddress, blue_dev);
                                safe_system(command);
                                snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -m mac --mac-source %s -s %s -i %s -j RETURN", macaddress, ipaddress, blue_dev);
                                safe_system(command);
                        } else {
                                /* correctly formed mac address is 17 chars */
                                if (strlen(macaddress) == 17) {
-                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -i %s -j ACCEPT", macaddress, blue_dev);
+                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -m mac --mac-source %s -i %s -j RETURN", macaddress, blue_dev);
                                        safe_system(command);
                                        snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -m mac --mac-source %s -i %s -j RETURN", macaddress, blue_dev);
                                        safe_system(command);
                                }
 
                                if (VALID_IP_AND_MASK(ipaddress)) {
-                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -s %s -i %s -j ACCEPT", ipaddress, blue_dev);
+                                       snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSINPUT -s %s -i %s -j RETURN", ipaddress, blue_dev);
                                        safe_system(command);
                                        snprintf(command, STRING_SIZE-1, "/sbin/iptables --wait -A WIRELESSFORWARD -s %s -i %s -j RETURN", ipaddress, blue_dev);
                                        safe_system(command);