aboutsummaryrefslogtreecommitdiffstats
path: root/pcap-snoop.c
diff options
context:
space:
mode:
authorguy <guy>2004-10-19 07:06:11 +0000
committerguy <guy>2004-10-19 07:06:11 +0000
commite5aebee6d80c8909048dc1ce865e9adb97d94fd7 (patch)
tree77b64a0b8528dc128ac9f7c319e58a2b3ca8b565 /pcap-snoop.c
parent4b1ac36c836ee326f778742bc28dd3b374702281 (diff)
Add a "pcap_close_common()" routine which can be used as the close
routine for some pcap-XXX.c files and can be called by the close routine in other pcap-XXX.c files.
Diffstat (limited to 'pcap-snoop.c')
-rw-r--r--pcap-snoop.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/pcap-snoop.c b/pcap-snoop.c
index 18e4b6d..7a27b10 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.53 2004-04-07 18:33:29 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.54 2004-10-19 07:06:14 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -193,15 +193,6 @@ pcap_stats_snoop(pcap_t *p, struct pcap_stat *ps)
return (0);
}
-static void
-pcap_close_snoop(pcap_t *p)
-{
- if (p->buffer != NULL)
- free(p->buffer);
- if (p->fd >= 0)
- close(p->fd);
-}
-
/* XXX can't disable promiscuous */
pcap_t *
pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
@@ -392,7 +383,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
p->getnonblock_op = pcap_getnonblock_fd;
p->setnonblock_op = pcap_setnonblock_fd;
p->stats_op = pcap_stats_snoop;
- p->close_op = pcap_close_snoop;
+ p->close_op = pcap_close_common;
return (p);
bad: