tcpdump mailing list archives

[Patch] pcap-dos.c


From: Gisle Vanem <gvanem () broadpark no>
Date: Sat, 19 Apr 2008 15:45:07 +0200

The recent change for pcap_activate() broke the DOS-port.
Here's a small fix:

--- pcap-dos.c.orig  Mon Apr 14 19:40:58 2008
+++ pcap-doc.c        Thu Apr 17 15:33:00 2008
@@ -97,10 +97,10 @@

static struct device *handle_to_device [20];

-static void pcap_activate_dos (pcap_t *p);
+static int  pcap_activate_dos (pcap_t *p);
static int  pcap_read_dos (pcap_t *p, int cnt, pcap_handler callback,
                           u_char *data);
-static void pcap_close_dos (pcap_t *p);
+static void pcap_cleanup_dos (pcap_t *p);
static int  pcap_stats_dos (pcap_t *p, struct pcap_stat *ps);
static int  pcap_sendpacket_dos (pcap_t *p, const void *buf, size_t len);
static int  pcap_setfilter_dos (pcap_t *p, struct bpf_program *fp);
@@ -152,6 +152,7 @@
               return (NULL);

       p->activate_op = pcap_activate_dos;
+       p->md.device = device;
       return (p);
}

@@ -163,7 +164,7 @@
{
  int err = 0;

-  if (p->opt.rfmon) {
+  if (pcap->opt.rfmon) {
    /*
     * No monitor mode on DOS.
     */
@@ -201,7 +202,7 @@
              "Cannot use different devices simultaneously "
              "(`%s' vs. `%s')", active_dev->name, pcap->md.device);
    free (pcap);
-    err = PCAP_ERROR;
+    err = PCAP_ERROR_ACTIVATED;
  }
  handle_to_device [pcap->fd-1] = active_dev;
  return (err);
@@ -743,7 +744,7 @@
         fprintf (stderr, "Catching signal %d.\n", sig);
  }
  exc_occured = 1;
-  pcap_close_dos (NULL);
+  pcap_cleanup_dos (NULL);
}
#endif  /* __DJGPP__ */

------------

--gv
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: