Changeset 285

Show
Ignore:
Timestamp:
11/21/04 15:55:20 (4 years ago)
Author:
aprilp
Message:

We were using the wrong IP address, woops

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/WIFIDOG_1_0_X/wifidog/ChangeLog

    r283 r285  
    33        * src/fw_iptables.c: changed call to iptables to use IP address instead of 
    44        host name, in case resolution fails. 
     5        * src/fw_iptables.c: we were using wrong IP addresses. woops. 
    56 
    672004-11-18 Philippe April <philippe@philippeapril.com> 
  • branches/WIFIDOG_1_0_X/wifidog/src/fw_iptables.c

    r284 r285  
    3535#include <string.h> 
    3636#include <pthread.h> 
     37#include <netinet/in.h> 
    3738 
    3839#include "conf.h" 
     
    9293    for (auth_server = config->auth_servers; auth_server != NULL; 
    9394                    auth_server = auth_server->next) { 
    94         if (auth_server->last_ip) { 
    95             iptables_do_command("-t nat -A " TABLE_WIFIDOG_AUTHSERVERS " -d %s -j ACCEPT", inet_ntoa(auth_server->last_ip)); 
     95        if (auth_server->last_ip && strcmp(inet_ntoa(auth_server->last_ip->s_addr), "0.0.0.0") != 0) { 
     96            iptables_do_command("-t nat -A " TABLE_WIFIDOG_AUTHSERVERS " -d %s -j ACCEPT", inet_ntoa(auth_server->last_ip->s_addr)); 
    9697        } else { 
    9798            iptables_do_command("-t nat -A " TABLE_WIFIDOG_AUTHSERVERS " -d %s -j ACCEPT", auth_server->authserv_hostname); 
     
    235236    } 
    236237    iptables_do_command("-t mangle -X " TABLE_WIFIDOG_INCOMING); 
     238 
     239    iptables_do_command("-t mangle -X " TABLE_WIFIDOG_AUTHSERVERS); 
    237240 
    238241    return 1;