Changeset 445 for trunk/wifidog/src/fw_iptables.c
- Timestamp:
- 02/12/05 01:46:22 (8 years ago)
- Files:
-
- 1 modified
-
trunk/wifidog/src/fw_iptables.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog/src/fw_iptables.c
r441 r445 35 35 #include <string.h> 36 36 #include <pthread.h> 37 #include <sys/socket.h> 38 #include <netinet/in.h> 39 #include <arpa/inet.h> 37 40 38 41 #include "common.h" … … 351 354 unsigned long int counter; 352 355 t_client *p1; 356 struct in_addr tempaddr; 353 357 354 358 /* Look for outgoing traffic */ … … 368 372 rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %s %*s %*s %*s %*s %*s 0x%*u", &counter, ip); 369 373 if (2 == rc && EOF != rc) { 374 /* Sanity*/ 375 if (!inet_aton(ip, &tempaddr)) { 376 debug(LOG_WARNING, "I was supposed to read an IP address but instead got [%s] - ignoring it", ip); 377 continue; 378 } 370 379 debug(LOG_DEBUG, "Outgoing %s Bytes=%ld", ip, counter); 371 380 LOCK_CLIENT_LIST(); … … 400 409 rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %s %*s", &counter, ip); 401 410 if (2 == rc && EOF != rc) { 411 /* Sanity*/ 412 if (!inet_aton(ip, &tempaddr)) { 413 debug(LOG_WARNING, "I was supposed to read an IP address but instead got [%s] - ignoring it", ip); 414 continue; 415 } 402 416 debug(LOG_DEBUG, "WIFI2FW %s Bytes=%ld", ip, counter); 403 417 LOCK_CLIENT_LIST(); … … 432 446 rc = fscanf(output, "%*s %lu %*s %*s %*s %*s %*s %*s %s", &counter, ip); 433 447 if (2 == rc && EOF != rc) { 448 /* Sanity*/ 449 if (!inet_aton(ip, &tempaddr)) { 450 debug(LOG_WARNING, "I was supposed to read an IP address but instead got [%s] - ignoring it", ip); 451 continue; 452 } 434 453 debug(LOG_DEBUG, "Incoming %s Bytes=%ld", ip, counter); 435 454 LOCK_CLIENT_LIST();
