head 1.1; access; symbols OPENPKG_E1_MP_HEAD:1.1 OPENPKG_E1_MP:1.1 OPENPKG_E1_MP_2_STABLE:1.1.2.2 OPENPKG_E1_FP:1.1.2.2 OPENPKG_2_STABLE_MP:1.1 OPENPKG_2_STABLE_20061018:1.1.2.2 OPENPKG_2_STABLE:1.1.0.2 OPENPKG_CW_FP:1.1; locks; strict; comment @# @; 1.1 date 2003.12.13.13.42.14; author rse; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2003.12.13.13.42.14; author rse; state dead; branches; next 1.1.2.2; commitid iZxwRSmmWscPXUQr; 1.1.2.2 date 2006.10.16.14.48.54; author rse; state Exp; branches; next ; commitid iZxwRSmmWscPXUQr; desc @@ 1.1 log @modifying package: cdpr-2.1.0 20031213 again @ text @--- cdpr.c.orig Wed Nov 19 17:53:13 2003 +++ cdpr.c Wed Nov 19 17:54:06 2003 @@@@ -639,7 +639,7 @@@@ pcap_lookupnet(dev, &net, &mask, errbuf); /* Open the pcap device */ - if((handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf)) == NULL) + if((handle = pcap_open_live(dev, BUFSIZ, 1, 1000, errbuf)) == NULL) { printf("Error opening device (%s)\n", errbuf); exit(1); @@@@ -656,11 +656,6 @@@@ pcap_setfilter(handle, &filter); pcap_freecode(&filter); - /* Set non-blocking mode */ - if(pcap_setnonblock(handle, 1, errbuf)) - { - pcap_perror(handle, NULL); - } /* Get the next packet that comes in, we only need one */ printf("Waiting for CDP advertisement:\n"); @@@@ -671,11 +666,7 @@@@ do { packet = pcap_next(handle, &header); -#ifdef WIN32 - Sleep(10000); -#else - usleep(10000); -#endif + } while ((!packet) && ( timeout=((start_time+seconds) > (unsigned int)time(NULL))) ); /* Index: Makefile --- Makefile.orig 2003-10-23 01:18:47.000000000 +0200 +++ Makefile 2003-12-13 14:34:47.000000000 +0100 @@@@ -17,7 +17,7 @@@@ #LDFLAGS = -lsocket -lnsl -lpcap cdpr: cdpr.c cdprs.c conffile.c cdp.h cdpr.h - gcc $(CFLAGS) cdpr.c cdprs.c conffile.c $(LDFLAGS) -o cdpr + $(CC) $(CFLAGS) cdpr.c cdprs.c conffile.c $(LDFLAGS) -o cdpr $(LIBS) clean: rm -f cdpr @ 1.1.2.1 log @file cdpr.patch was added on branch OPENPKG_2_STABLE on 2006-10-16 14:48:54 +0000 @ text @d1 48 @ 1.1.2.2 log @Mass merge from CURRENT to 2-STABLE (all packages except those of JUNK class) @ text @a0 48 --- cdpr.c.orig Wed Nov 19 17:53:13 2003 +++ cdpr.c Wed Nov 19 17:54:06 2003 @@@@ -639,7 +639,7 @@@@ pcap_lookupnet(dev, &net, &mask, errbuf); /* Open the pcap device */ - if((handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf)) == NULL) + if((handle = pcap_open_live(dev, BUFSIZ, 1, 1000, errbuf)) == NULL) { printf("Error opening device (%s)\n", errbuf); exit(1); @@@@ -656,11 +656,6 @@@@ pcap_setfilter(handle, &filter); pcap_freecode(&filter); - /* Set non-blocking mode */ - if(pcap_setnonblock(handle, 1, errbuf)) - { - pcap_perror(handle, NULL); - } /* Get the next packet that comes in, we only need one */ printf("Waiting for CDP advertisement:\n"); @@@@ -671,11 +666,7 @@@@ do { packet = pcap_next(handle, &header); -#ifdef WIN32 - Sleep(10000); -#else - usleep(10000); -#endif + } while ((!packet) && ( timeout=((start_time+seconds) > (unsigned int)time(NULL))) ); /* Index: Makefile --- Makefile.orig 2003-10-23 01:18:47.000000000 +0200 +++ Makefile 2003-12-13 14:34:47.000000000 +0100 @@@@ -17,7 +17,7 @@@@ #LDFLAGS = -lsocket -lnsl -lpcap cdpr: cdpr.c cdprs.c conffile.c cdp.h cdpr.h - gcc $(CFLAGS) cdpr.c cdprs.c conffile.c $(LDFLAGS) -o cdpr + $(CC) $(CFLAGS) cdpr.c cdprs.c conffile.c $(LDFLAGS) -o cdpr $(LIBS) clean: rm -f cdpr @