Changeset 180 for trunk/wifidog/src/fw_iptables.c
- Timestamp:
- 08/09/04 19:06:24 (9 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog/src/fw_iptables.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/fw_iptables.c
r176 r180 46 46 47 47 extern pthread_mutex_t client_list_mutex; 48 extern pthread_mutex_t config_mutex; 48 49 49 50 /** … … 77 78 iptables_fw_init(void) 78 79 { 79 s_config *config = config_get_config(); 80 s_config *config; 81 t_auth_serv *auth_server; 82 83 config = config_get_config(); 80 84 fw_quiet = 0; 85 81 86 iptables_do_command("-t nat -N " TABLE_WIFIDOG_VALIDATE); 82 87 iptables_do_command("-t nat -A " TABLE_WIFIDOG_VALIDATE " -d %s -j ACCEPT", config->gw_address); 83 iptables_do_command("-t nat -A " TABLE_WIFIDOG_VALIDATE " -d %s -j ACCEPT", config->auth_servers->authserv_hostname); 88 89 pthread_mutex_lock(&config_mutex); 90 91 for (auth_server = config->auth_servers; auth_server != NULL; 92 auth_server = auth_server->next) { 93 iptables_do_command("-t nat -A " TABLE_WIFIDOG_VALIDATE " -d %s -j ACCEPT", auth_server->authserv_hostname); 94 } 95 96 pthread_mutex_unlock(&config_mutex); 97 84 98 iptables_do_command("-t nat -A " TABLE_WIFIDOG_VALIDATE " -p udp --dport 67 -j ACCEPT"); 85 99 iptables_do_command("-t nat -A " TABLE_WIFIDOG_VALIDATE " -p tcp --dport 67 -j ACCEPT"); … … 97 111 iptables_do_command("-t nat -N " TABLE_WIFIDOG_UNKNOWN); 98 112 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -d %s -j ACCEPT", config->gw_address); 99 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -d %s -j ACCEPT", config->auth_servers->authserv_hostname); 113 114 pthread_mutex_lock(&config_mutex); 115 116 for (auth_server = config->auth_servers; auth_server != NULL; 117 auth_server = auth_server->next) { 118 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -d %s -j ACCEPT", auth_server->authserv_hostname); 119 } 120 121 pthread_mutex_unlock(&config_mutex); 122 100 123 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -p udp --dport 67 -j ACCEPT"); 101 124 iptables_do_command("-t nat -A " TABLE_WIFIDOG_UNKNOWN " -p tcp --dport 67 -j ACCEPT");
