1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-16 00:39:15 -04:00
ports/net-mgmt/cdpr/files/patch-aa
Michael Landin 30f370ac84 o Update to > 2.1.0
- Feature enhancement
o Use %%DOCSDIR%%
o Add data files
2003-11-19 17:20:34 +00:00

36 lines
908 B
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))) );
/*