Show
Ignore:
Timestamp:
02/23/06 11:16:16 (8 years ago)
Author:
papril
Message:

* src/fw_iptables.c:
* Changed order in the filter.FORWARD chain
* Added TCPMSS rule
* Fixed deleting the rules on shutdown

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/src/util.c

    r935 r964  
    217217} 
    218218 
     219char *get_gw_iface (void) { 
     220#ifdef __linux__ 
     221    FILE *input; 
     222    char *device, *gw; 
     223 
     224    device = (char *)malloc(16); 
     225    gw = (char *)malloc(16); 
     226 
     227    input = fopen("/proc/net/route", "r"); 
     228    while (!feof(input)) { 
     229        fscanf(input, "%s %s %*s %*s %*s %*s %*s %*s %*s %*s %*s\n", device, gw); 
     230        if (strcmp(gw, "00000000") == 0) { 
     231            free(gw); 
     232            return device; 
     233        } 
     234    } 
     235    fclose(input); 
     236 
     237    free(device); 
     238    free(gw); 
     239#endif 
     240    return NULL; 
     241} 
     242 
    219243void mark_online() { 
    220244        int before;