Date: Sun, 18 May 2008 17:45:30 GMT From: Rui Paulo <rpaulo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 141810 for review Message-ID: <200805181745.m4IHjUZg048691@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=141810 Change 141810 by rpaulo@rpaulo_epsilon on 2008/05/18 17:45:11 Use pcap_loop() instead of pcap_dispatch(). Affected files ... .. //depot/projects/soc2008/rpaulo-tcpad/main.c#4 edit Differences ... ==== //depot/projects/soc2008/rpaulo-tcpad/main.c#4 (text+ko) ==== @@ -23,7 +23,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/soc2008/rpaulo-tcpad/main.c#3 $ + * $P4: //depot/projects/soc2008/rpaulo-tcpad/main.c#4 $ */ #include <err.h> @@ -104,8 +104,11 @@ errx(1, "interface type not recognized"); LIST_INIT(&chead); - for (;;) { - pcap_dispatch(p, -1, tcpad_pcaphandler, - (unsigned char *)&linkhlen); - } + + pcap_loop(p, -1, tcpad_pcaphandler, (unsigned char *)&linkhlen); + + pcap_freecode(&fp); + pcap_close(p); + + return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805181745.m4IHjUZg048691>