]> The Tcpdump Group git mirrors - libpcap/commitdiff
From Sebastien Roy: fix compilation problems on versions of Solaris with
authorGuy Harris <[email protected]>
Thu, 26 Feb 2009 09:16:26 +0000 (01:16 -0800)
committerGuy Harris <[email protected]>
Thu, 26 Feb 2009 09:16:26 +0000 (01:16 -0800)
libdlpi.

CREDITS
pcap-libdlpi.c

diff --git a/CREDITS b/CREDITS
index ec8c1ece0f65e4fa8498aacdc2b705e568bd67e2..7f691d55ffbd272c7d1327ed21382423b616b445 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -105,6 +105,7 @@ Additional people who have contributed patches:
        Scott Barron                    <sb125499 at ohiou dot edu>
        Scott Gifford                   <sgifford at tir dot com>
        Sebastian Krahmer               <krahmer at cs dot uni-potsdam dot de>
        Scott Barron                    <sb125499 at ohiou dot edu>
        Scott Gifford                   <sgifford at tir dot com>
        Sebastian Krahmer               <krahmer at cs dot uni-potsdam dot de>
+       Sebastien Roy                   <Sebastien dot Roy at Sun dot COM>
        Sepherosa Ziehau                <sepherosa at gmail dot com>
        Shaun Clowes                    <delius at progsoc dot uts dot edu dot au>
        Solomon Peachy                  <pizza at shaftnet dot org>
        Sepherosa Ziehau                <sepherosa at gmail dot com>
        Shaun Clowes                    <delius at progsoc dot uts dot edu dot au>
        Solomon Peachy                  <pizza at shaftnet dot org>
index 8666117fe831056289e4a1ada37d00dcfd0c8c55..87cd08b7d92926ccdbaa4977e62b73a94fdc30bb 100644 (file)
@@ -53,6 +53,7 @@ static int pcap_read_libdlpi(pcap_t *, int, pcap_handler, u_char *);
 static int pcap_inject_libdlpi(pcap_t *, const void *, size_t);
 static void pcap_close_libdlpi(pcap_t *);
 static void pcap_libdlpi_err(const char *, const char *, int, char *);
 static int pcap_inject_libdlpi(pcap_t *, const void *, size_t);
 static void pcap_close_libdlpi(pcap_t *);
 static void pcap_libdlpi_err(const char *, const char *, int, char *);
+static void pcap_cleanup_libdlpi(pcap_t *);
 
 /*
  * list_interfaces() will list all the network links that are
 
 /*
  * list_interfaces() will list all the network links that are
@@ -113,7 +114,7 @@ pcap_activate_libdlpi(pcap_t *p)
        if (retv != DLPI_SUCCESS) {
                if (retv == DLPI_ELINKNAMEINVAL || retv == DLPI_ENOLINK)
                        err = PCAP_ERROR_NO_SUCH_DEVICE;
        if (retv != DLPI_SUCCESS) {
                if (retv == DLPI_ELINKNAMEINVAL || retv == DLPI_ENOLINK)
                        err = PCAP_ERROR_NO_SUCH_DEVICE;
-               else if (retv == DLPI_SYSERR && errno == EACCES)
+               else if (retv == DL_SYSERR && errno == EACCES)
                        err = PCAP_ERROR_PERM_DENIED;
                pcap_libdlpi_err(p->opt.source, "dlpi_open", retv,
                    p->errbuf);
                        err = PCAP_ERROR_PERM_DENIED;
                pcap_libdlpi_err(p->opt.source, "dlpi_open", retv,
                    p->errbuf);
@@ -155,8 +156,9 @@ pcap_activate_libdlpi(pcap_t *p)
        }
 
        /* Try to enable SAP promiscuity. */
        }
 
        /* Try to enable SAP promiscuity. */
-       if ((retv = dlpi_promiscon(p->dlpi_hd, DL_PROMISC_SAP)) != DLPI_SUCCESS) {
-               if (!promisc) {
+       retv = dlpi_promiscon(p->dlpi_hd, DL_PROMISC_SAP);
+       if (retv != DLPI_SUCCESS) {
+               if (p->opt.promisc) {
                        pcap_libdlpi_err(p->opt.source, "dlpi_promisc(SAP)",
                            retv, p->errbuf);
                        goto bad;
                        pcap_libdlpi_err(p->opt.source, "dlpi_promisc(SAP)",
                            retv, p->errbuf);
                        goto bad;
@@ -179,7 +181,7 @@ pcap_activate_libdlpi(pcap_t *p)
        p->fd = dlpi_fd(p->dlpi_hd);
 
        /* Push and configure bufmod. */
        p->fd = dlpi_fd(p->dlpi_hd);
 
        /* Push and configure bufmod. */
-       if (pcap_conf_bufmod(p, snaplen, p->md.timeout) != 0)
+       if (pcap_conf_bufmod(p, p->snapshot, p->md.timeout) != 0)
                goto bad;
 
        /*
                goto bad;
 
        /*