Changeset 1389

Show
Ignore:
Timestamp:
02/27/09 12:39:30 (4 years ago)
Author:
benoitg
Message:

* Fix #488 and #493 (arp_get() in firewall.c couldn't parse lowercase mac's from /proc/net/arp) with patch fromjch@…. Otherwise wifidog wouldn't work with recent openwrt and Ubuntu.

Location:
trunk/wifidog
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r1378 r1389  
    11# $Id$ 
    2  
     22009-02-27 Benoit Gr�goire  <bock@step.polymtl.ca> 
     3        * Fix #488 and #493 (arp_get() in firewall.c couldn't parse lowercase mac's from /proc/net/arp) with patch from jch@pps.jussieu.fr.  Otherwise wifidog wouldn't work with recent openwrt and Ubuntu. 
     4         
    352008-09-30 Wichert Akkerman <wichert@wiggy.net> 
    46        * Add exitcode to iptables failure errors. 
  • trunk/wifidog/NEWS

    r1303 r1389  
    11# $Id$ 
     2WiFiDog 1.1.5: 
     3        * First supported version on OpenWRT kamikaze 
     4 
    25WiFiDog 1.1.4: 
    36        * Fix incorrect firewal rule deletion introduced in 1.1.3rc1.  Caused the incoming byte count reported to be incorrect for users that logged in a second time on a gateway that wasn't restarted in between. 
  • trunk/wifidog/src/firewall.c

    r1305 r1389  
    136136         /* Find ip, copy mac in reply */ 
    137137         reply = NULL; 
    138     while (!feof(proc) && (fscanf(proc, " %15[0-9.] %*s %*s %17[A-F0-9:] %*s %*s", ip, mac) == 2)) { 
     138    while (!feof(proc) && (fscanf(proc, " %15[0-9.] %*s %*s %17[A-Fa-f0-9:] %*s %*s", ip, mac) == 2)) { 
    139139                  if (strcmp(ip, req_ip) == 0) { 
    140140                                reply = safe_strdup(mac); 
     
    249249        /* Ping the client, if he responds it'll keep activity on the link. 
    250250         * However, if the firewall blocks it, it will not help.  The suggested 
    251          * way to deal witht his is to keep the DHCP lease time extremely  
     251         * way to deal witht his is to keep the DHCP lease time extremely 
    252252         * short:  Shorter than config->checkinterval * config->clienttimeout */ 
    253253        icmp_ping(ip); 
     
    257257        } 
    258258            LOCK_CLIENT_LIST(); 
    259          
     259 
    260260        if (!(p1 = client_list_find(ip, mac))) { 
    261261            debug(LOG_ERR, "Node %s was freed while being re-validated!", ip); 
     
    354354        struct sockaddr_in saddr; 
    355355#if defined(__linux__) || defined(__NetBSD__) 
    356         struct {  
     356        struct { 
    357357                struct ip ip; 
    358358                struct icmp icmp; 
     
    379379 
    380380        while (j >> 16) 
    381                 j = (j & 0xffff) + (j >> 16);   
     381                j = (j & 0xffff) + (j >> 16); 
    382382 
    383383        packet.icmp.icmp_cksum = (j == 0xffff) ? j : ~j; 
     
    415415    /* Some rand() implementations have less randomness in low bits 
    416416     * than in high bits, so we only pay attention to the high ones. 
    417      * But most implementations don't touch the high bit, so we  
     417     * But most implementations don't touch the high bit, so we 
    418418     * ignore that one. 
    419419     **/