aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcap-bpf.c2
-rw-r--r--pcap-dlpi.c2
-rw-r--r--pcap-dos.c2
-rw-r--r--pcap-int.h2
-rw-r--r--pcap-libdlpi.c2
-rw-r--r--pcap-linux.c19
-rw-r--r--pcap-nit.c2
-rw-r--r--pcap-null.c2
-rw-r--r--pcap-pf.c2
-rw-r--r--pcap-sita.c2
-rw-r--r--pcap-snit.c2
-rw-r--r--pcap-snoop.c2
-rw-r--r--pcap-win32.c2
-rw-r--r--pcap.c2
14 files changed, 23 insertions, 22 deletions
diff --git a/pcap-bpf.c b/pcap-bpf.c
index b612b04e..b7fe0856 100644
--- a/pcap-bpf.c
+++ b/pcap-bpf.c
@@ -429,7 +429,7 @@ pcap_ack_zbuf(pcap_t *p)
#endif /* HAVE_ZEROCOPY_BPF */
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-dlpi.c b/pcap-dlpi.c
index 623c5c21..075d0cb3 100644
--- a/pcap-dlpi.c
+++ b/pcap-dlpi.c
@@ -1812,7 +1812,7 @@ dlpi_kread(register int fd, register off_t addr,
#endif
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
#ifdef DL_HP_RAWDLS
diff --git a/pcap-dos.c b/pcap-dos.c
index f42b394b..ea6b225a 100644
--- a/pcap-dos.c
+++ b/pcap-dos.c
@@ -149,7 +149,7 @@ struct pcap_dos {
struct pcap_stat stat;
};
-pcap_t *pcap_create_interface (char *ebuf)
+pcap_t *pcap_create_interface (const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-int.h b/pcap-int.h
index d88331df..c5a030f5 100644
--- a/pcap-int.h
+++ b/pcap-int.h
@@ -446,7 +446,7 @@ int pcap_setnonblock_fd(pcap_t *p, int, char *);
* "pcap_create_common()" allocates and fills in a pcap_t, for use
* by pcap_create routines.
*/
-pcap_t *pcap_create_interface(char *);
+pcap_t *pcap_create_interface(const char *, char *);
pcap_t *pcap_create_common(char *, size_t);
int pcap_do_addexit(pcap_t *);
void pcap_add_to_pcaps_to_close(pcap_t *);
diff --git a/pcap-libdlpi.c b/pcap-libdlpi.c
index 0bbc96cc..625f1e0a 100644
--- a/pcap-libdlpi.c
+++ b/pcap-libdlpi.c
@@ -426,7 +426,7 @@ pcap_libdlpi_err(const char *linkname, const char *func, int err, char *errbuf)
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-linux.c b/pcap-linux.c
index ea38fff5..8aea72cb 100644
--- a/pcap-linux.c
+++ b/pcap-linux.c
@@ -433,7 +433,8 @@ static int enter_rfmon_mode(pcap_t *handle, int sock_fd,
const char *device);
#endif /* HAVE_PF_PACKET_SOCKETS */
#if defined(HAVE_LINUX_NET_TSTAMP_H) && defined(PACKET_TIMESTAMP)
-static int iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf);
+static int iface_ethtool_get_ts_info(const char *device, pcap_t *handle,
+ char *ebuf);
#endif
#ifdef HAVE_PACKET_RING
static int iface_get_offload(pcap_t *handle);
@@ -454,7 +455,7 @@ static struct sock_fprog total_fcode
#endif /* SO_ATTACH_FILTER */
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device, char *ebuf)
{
pcap_t *handle;
@@ -469,7 +470,7 @@ pcap_create_interface(char *ebuf)
/*
* See what time stamp types we support.
*/
- if (iface_ethtool_get_ts_info(handle, ebuf) == -1) {
+ if (iface_ethtool_get_ts_info(device, handle, ebuf) == -1) {
pcap_close(handle);
return NULL;
}
@@ -6028,7 +6029,7 @@ iface_set_all_ts_types(pcap_t *handle)
* Get a list of time stamping capabilities.
*/
static int
-iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf)
+iface_ethtool_get_ts_info(const char *device, pcap_t *handle, char *ebuf)
{
int fd;
struct ifreq ifr;
@@ -6043,7 +6044,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf)
* and not all devices even necessarily *support* hardware time
* stamping, so don't report any time stamp types.
*/
- if (strcmp(handle->opt.device, "any") == 0) {
+ if (strcmp(device, "any") == 0) {
handle->tstamp_type_list = NULL;
return 0;
}
@@ -6059,7 +6060,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf)
}
memset(&ifr, 0, sizeof(ifr));
- strlcpy(ifr.ifr_name, handle->opt.device, sizeof(ifr.ifr_name));
+ strlcpy(ifr.ifr_name, device, sizeof(ifr.ifr_name));
memset(&info, 0, sizeof(info));
info.cmd = ETHTOOL_GET_TS_INFO;
ifr.ifr_data = (caddr_t)&info;
@@ -6094,7 +6095,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf)
* Other error.
*/
pcap_snprintf(ebuf, PCAP_ERRBUF_SIZE,
- "%s: SIOCETHTOOL(ETHTOOL_GET_TS_INFO) ioctl failed: %s", handle->opt.device,
+ "%s: SIOCETHTOOL(ETHTOOL_GET_TS_INFO) ioctl failed: %s", device,
strerror(save_errno));
return -1;
}
@@ -6139,7 +6140,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf)
}
#else /* ETHTOOL_GET_TS_INFO */
static int
-iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf _U_)
+iface_ethtool_get_ts_info(const char *device, pcap_t *handle, char *ebuf _U_)
{
/*
* This doesn't apply to the "any" device; you can't say "turn on
@@ -6148,7 +6149,7 @@ iface_ethtool_get_ts_info(pcap_t *handle, char *ebuf _U_)
* and not all devices even necessarily *support* hardware time
* stamping, so don't report any time stamp types.
*/
- if (strcmp(handle->opt.device, "any") == 0) {
+ if (strcmp(device, "any") == 0) {
handle->tstamp_type_list = NULL;
return 0;
}
diff --git a/pcap-nit.c b/pcap-nit.c
index ce3e52a5..1b626e21 100644
--- a/pcap-nit.c
+++ b/pcap-nit.c
@@ -355,7 +355,7 @@ pcap_activate_nit(pcap_t *p)
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-null.c b/pcap-null.c
index af46b8c7..b5fa3ab9 100644
--- a/pcap-null.c
+++ b/pcap-null.c
@@ -36,7 +36,7 @@
static char nosup[] = "live packet capture not supported on this system";
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
(void)strlcpy(ebuf, nosup, PCAP_ERRBUF_SIZE);
return (NULL);
diff --git a/pcap-pf.c b/pcap-pf.c
index 00e9107e..0a7f4588 100644
--- a/pcap-pf.c
+++ b/pcap-pf.c
@@ -506,7 +506,7 @@ your system may not be properly configured; see the packetfilter(4) man page\n",
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-sita.c b/pcap-sita.c
index 123700d3..1cd5f751 100644
--- a/pcap-sita.c
+++ b/pcap-sita.c
@@ -1014,7 +1014,7 @@ static int pcap_activate_sita(pcap_t *handle) {
return 0;
}
-pcap_t *pcap_create_interface(char *ebuf) {
+pcap_t *pcap_create_interface(const char *device _U_, char *ebuf) {
pcap_t *p;
p = pcap_create_common(ebuf, 0);
diff --git a/pcap-snit.c b/pcap-snit.c
index ae8dd8bd..7db2fd9a 100644
--- a/pcap-snit.c
+++ b/pcap-snit.c
@@ -431,7 +431,7 @@ pcap_activate_snit(pcap_t *p)
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-snoop.c b/pcap-snoop.c
index cdee48b5..687b1d90 100644
--- a/pcap-snoop.c
+++ b/pcap-snoop.c
@@ -406,7 +406,7 @@ pcap_activate_snoop(pcap_t *p)
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap-win32.c b/pcap-win32.c
index 0e380ea6..c6621c5b 100644
--- a/pcap-win32.c
+++ b/pcap-win32.c
@@ -1062,7 +1062,7 @@ bad:
}
pcap_t *
-pcap_create_interface(char *ebuf)
+pcap_create_interface(const char *device _U_, char *ebuf)
{
pcap_t *p;
diff --git a/pcap.c b/pcap.c
index 701f9ace..c968cc67 100644
--- a/pcap.c
+++ b/pcap.c
@@ -506,7 +506,7 @@ pcap_create(const char *device, char *errbuf)
/*
* OK, try it as a regular network interface.
*/
- p = pcap_create_interface(errbuf);
+ p = pcap_create_interface(device_str, errbuf);
if (p == NULL) {
/*
* We assume the caller filled in errbuf.