aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-01-20 18:59:52 -0800
committerGuy Harris <guy@alum.mit.edu>2017-01-20 18:59:52 -0800
commit2c6d514e968e0273b0ecf065fc749066a0e746d3 (patch)
tree35fe521a30e25381e19887fee1d789f0cf8995d8
parentb4d719c1ea2a843a762a4831999a461b19a9f1e0 (diff)
Some fixes for the new API.
Save the result of the add_dev() call, so that the "#if 0" code could be made to work. (If it can't be made to work, it should be removed, along with the curdev variable and the assignment to it.) Don't pass dev->flags to add_dev(), as that routine expects PCAP_IF_ flags, not IFF_ flags - and we don't have the relevant IFF_ flags anyway (IFF_UP, IFF_RUNNING, IFF_LOOPBACK if that applies).
-rw-r--r--pcap-dos.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pcap-dos.c b/pcap-dos.c
index 20428547..457db72a 100644
--- a/pcap-dos.c
+++ b/pcap-dos.c
@@ -544,6 +544,7 @@ int pcap_lookupnet (const char *device, bpf_u_int32 *localnet,
int pcap_platform_finddevs (pcap_if_list_t *devlistp, char *errbuf)
{
struct device *dev;
+ pcap_if_t *curdev;
#if 0 /* Pkt drivers should have no addresses */
struct sockaddr_in sa_ll_1, sa_ll_2;
struct sockaddr *addr, *netmask, *broadaddr, *dstaddr;
@@ -562,8 +563,11 @@ int pcap_platform_finddevs (pcap_if_list_t *devlistp, char *errbuf)
FLUSHK();
(*dev->close) (dev);
- if (add_dev(devlistp, dev->name, dev->flags,
- dev->long_name, errbuf) == NULL)
+ /*
+ * XXX - find out whether it's up or running? Does that apply here?
+ */
+ if ((curdev = add_dev(devlistp, dev->name, 0,
+ dev->long_name, errbuf)) == NULL)
{
ret = -1;
break;