Skip to content

Commit

Permalink
From Sebastien Roy: fix compilation problems on versions of Solaris with
Browse files Browse the repository at this point in the history
libdlpi.
  • Loading branch information
Guy Harris committed Feb 26, 2009
1 parent 936df0f commit 8cd961c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -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>
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>
Expand Down
10 changes: 6 additions & 4 deletions pcap-libdlpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 void pcap_cleanup_libdlpi(pcap_t *);

/*
* list_interfaces() will list all the network links that are
Expand Down Expand Up @@ -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;
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);
Expand Down Expand Up @@ -155,8 +156,9 @@ pcap_activate_libdlpi(pcap_t *p)
}

/* 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;
Expand All @@ -179,7 +181,7 @@ pcap_activate_libdlpi(pcap_t *p)
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;

/*
Expand Down

0 comments on commit 8cd961c

Please sign in to comment.