summaryrefslogtreecommitdiff
path: root/usr/src/lib/libdlpi/common/libdlpi.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2017-05-03 00:43:49 +0000
committerRobert Mustacchi <rm@joyent.com>2017-05-03 20:39:01 +0000
commite14f48674b1d80f3f8d374fdd837d53e312aa7d7 (patch)
treecf0a0e96e9e7c24bcb547b0461f3f9edc201fa49 /usr/src/lib/libdlpi/common/libdlpi.c
parent3a0d591b2c17c128db3a54e83e8d0ee2742271ae (diff)
downloadillumos-joyent-e14f48674b1d80f3f8d374fdd837d53e312aa7d7.tar.gz
OS-6097 snoop reports "Is a directory" for non-existent VNIC
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Jerry Jelinek <jerry.jelinek@joyent.com>
Diffstat (limited to 'usr/src/lib/libdlpi/common/libdlpi.c')
-rw-r--r--usr/src/lib/libdlpi/common/libdlpi.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/lib/libdlpi/common/libdlpi.c b/usr/src/lib/libdlpi/common/libdlpi.c
index aa97afee04..d07eea70e7 100644
--- a/usr/src/lib/libdlpi/common/libdlpi.c
+++ b/usr/src/lib/libdlpi/common/libdlpi.c
@@ -23,7 +23,7 @@
* Use is subject to license terms.
*/
/*
- * Copyright (c) 2014, Joyent, Inc.
+ * Copyright (c) 2017, Joyent, Inc.
*/
/*
@@ -1088,10 +1088,12 @@ i_dlpi_open(const char *provider, const char *zonename, int *fd, uint_t flags,
(void) snprintf(path, sizeof (path), "/dev/ipnet/%s",
provider);
}
- if ((*fd = open(path, oflags)) != -1)
+ if ((*fd = open(path, oflags)) != -1) {
return (DLPI_SUCCESS);
- else
- return (errno == ENOENT ? DLPI_ENOLINK : DL_SYSERR);
+ } else {
+ return (errno == ENOENT || errno == EISDIR ?
+ DLPI_ENOLINK : DL_SYSERR);
+ }
} else if (style1 && !(flags & DLPI_DEVONLY)) {
char driver[DLPI_LINKNAME_MAX];
char device[DLPI_LINKNAME_MAX];
@@ -1160,7 +1162,7 @@ fallback:
if ((*fd = open(path, oflags)) != -1)
return (DLPI_SUCCESS);
- return (errno == ENOENT ? DLPI_ENOLINK : DL_SYSERR);
+ return (errno == ENOENT || errno == EISDIR ? DLPI_ENOLINK : DL_SYSERR);
}
/*