minor pcap_capture update to not call atoi() against PCAP_LOOP_SLEEP for every sleep...
authorMichael Rash <mbr@cipherdyne.org>
Thu, 19 Jul 2012 03:00:58 +0000 (23:00 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Thu, 19 Jul 2012 03:00:58 +0000 (23:00 -0400)
server/pcap_capture.c

index 41eaf90..acefd95 100644 (file)
@@ -58,12 +58,15 @@ pcap_capture(fko_srv_options_t *opts)
     int                 promisc = 0;
     int                 set_direction = 1;
     int                 status;
+    int                 useconds;
     pid_t               child_pid;
 
 #if FIREWALL_IPFW
     time_t              now;
 #endif
 
+    useconds = atoi(opts->config[CONF_PCAP_LOOP_SLEEP]);
+
     /* Set promiscuous mode if ENABLE_PCAP_PROMISC is set to 'Y'.
     */
     if(opts->config[CONF_ENABLE_PCAP_PROMISC][0] == 'Y')
@@ -288,7 +291,7 @@ pcap_capture(fko_srv_options_t *opts)
         }
 #endif
 
-        usleep(atoi(opts->config[CONF_PCAP_LOOP_SLEEP]));
+        usleep(useconds);
     }
 
     pcap_close(pcap);