Fixed init_history race.

Hard wired to eth0
This commit is contained in:
pdw
2002-03-25 16:51:55 +00:00
parent 9ebd79a7e2
commit ad32bdc709

View File

@@ -139,7 +139,7 @@ void packet_loop(void* ptr) {
device = pcap_lookupdev(errbuf); device = pcap_lookupdev(errbuf);
printf("Device: %s\n",device); printf("Device: %s\n",device);
pd = pcap_open_live(device,CAPTURE_LENGTH,1,1000,errbuf); pd = pcap_open_live("eth0",CAPTURE_LENGTH,1,1000,errbuf);
if(pd == NULL) { if(pd == NULL) {
fprintf(stderr, "pcap_open_live(): %s\n",errbuf); fprintf(stderr, "pcap_open_live(): %s\n",errbuf);
exit(1); exit(1);
@@ -153,7 +153,6 @@ void packet_loop(void* ptr) {
exit(1); exit(1);
} }
printf("Begin loop\n"); printf("Begin loop\n");
init_history();
pcap_loop(pd,0,(pcap_handler)handle_packet,NULL); pcap_loop(pd,0,(pcap_handler)handle_packet,NULL);
printf("end loop\n"); printf("end loop\n");
} }
@@ -174,6 +173,8 @@ int main(int argc, char **argv) {
pthread_mutex_init(&tick_mutex, NULL); pthread_mutex_init(&tick_mutex, NULL);
init_history();
pthread_create(&thread, NULL, (void*)&packet_loop, NULL); pthread_create(&thread, NULL, (void*)&packet_loop, NULL);
ui_loop(); ui_loop();