Changeset 1389
- Timestamp:
- 02/27/09 12:39:30 (4 years ago)
- Location:
- trunk/wifidog
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/ChangeLog
r1378 r1389 1 1 # $Id$ 2 2 2009-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 3 5 2008-09-30 Wichert Akkerman <wichert@wiggy.net> 4 6 * Add exitcode to iptables failure errors. -
trunk/wifidog/NEWS
r1303 r1389 1 1 # $Id$ 2 WiFiDog 1.1.5: 3 * First supported version on OpenWRT kamikaze 4 2 5 WiFiDog 1.1.4: 3 6 * 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 136 136 /* Find ip, copy mac in reply */ 137 137 reply = NULL; 138 while (!feof(proc) && (fscanf(proc, " %15[0-9.] %*s %*s %17[A-F 0-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)) { 139 139 if (strcmp(ip, req_ip) == 0) { 140 140 reply = safe_strdup(mac); … … 249 249 /* Ping the client, if he responds it'll keep activity on the link. 250 250 * 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 252 252 * short: Shorter than config->checkinterval * config->clienttimeout */ 253 253 icmp_ping(ip); … … 257 257 } 258 258 LOCK_CLIENT_LIST(); 259 259 260 260 if (!(p1 = client_list_find(ip, mac))) { 261 261 debug(LOG_ERR, "Node %s was freed while being re-validated!", ip); … … 354 354 struct sockaddr_in saddr; 355 355 #if defined(__linux__) || defined(__NetBSD__) 356 struct { 356 struct { 357 357 struct ip ip; 358 358 struct icmp icmp; … … 379 379 380 380 while (j >> 16) 381 j = (j & 0xffff) + (j >> 16); 381 j = (j & 0xffff) + (j >> 16); 382 382 383 383 packet.icmp.icmp_cksum = (j == 0xffff) ? j : ~j; … … 415 415 /* Some rand() implementations have less randomness in low bits 416 416 * 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 418 418 * ignore that one. 419 419 **/
