From ceec9e142e4fe8e2388e7bd73fa65809ab1b0715 Mon Sep 17 00:00:00 2001 From: Keith M Wesolowski Date: Fri, 16 May 2014 17:57:38 +0000 Subject: 5010 ipdadm should check ipd_open return Reviewed by: Robert Mustacchi Approved by: Richard Lowe --- usr/src/cmd/ipdadm/ipdadm.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'usr/src') diff --git a/usr/src/cmd/ipdadm/ipdadm.c b/usr/src/cmd/ipdadm/ipdadm.c index ca68541690..4f222be9b0 100644 --- a/usr/src/cmd/ipdadm/ipdadm.c +++ b/usr/src/cmd/ipdadm/ipdadm.c @@ -119,6 +119,11 @@ ipdadm_list(int argc, char *argv[]) } fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_status_read(fd, &hdl); (void) ipd_close(fd); @@ -146,6 +151,11 @@ ipdadm_info(int argc, char *argv[]) return (usage(stderr)); fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_status_read(fd, &hdl); (void) ipd_close(fd); if (rval != 0) { @@ -231,6 +241,11 @@ ipdadm_corrupt(int argc, char *argv[]) ic.ic_corrupt = val; fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_ctl(fd, g_zid, &ic); (void) ipd_close(fd); @@ -262,6 +277,11 @@ ipdadm_delay(int argc, char *argv[]) ic.ic_delay = val; fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_ctl(fd, g_zid, &ic); (void) ipd_close(fd); @@ -293,6 +313,11 @@ ipdadm_drop(int argc, char *argv[]) ic.ic_drop = val; fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_ctl(fd, g_zid, &ic); (void) ipd_close(fd); @@ -360,6 +385,11 @@ ipdadm_remove(int argc, char *argv[]) ic.ic_mask |= rval; fd = ipd_open(NULL); + if (fd < 0) { + (void) fprintf(stderr, "%s: failed to open ipd ctl node: %s\n", + g_pname, ipd_errmsg); + return (E_ERROR); + } rval = ipd_ctl(fd, g_zid, &ic); (void) ipd_close(fd); if (rval == -1) { -- cgit v1.2.3 From d690b62cf13675007342e6bb43d4816ec57a46dd Mon Sep 17 00:00:00 2001 From: Dan McDonald Date: Wed, 23 Jul 2014 19:50:51 -0400 Subject: 5026 intra-node/inter-zone networking doesn't always deliver SIGPOLL Reviewed by: Saso Kiselkov Reviewed by: Gordon Ross Reviewed by: Jerry Jelinek Reviewed by: Robert Mustacchi Approved by: Garrett D'Amore --- usr/src/uts/common/fs/sockfs/sockcommon_subr.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/fs/sockfs/sockcommon_subr.c b/usr/src/uts/common/fs/sockfs/sockcommon_subr.c index 00ab44e44c..957c8f93b4 100644 --- a/usr/src/uts/common/fs/sockfs/sockcommon_subr.c +++ b/usr/src/uts/common/fs/sockfs/sockcommon_subr.c @@ -22,6 +22,9 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. + */ #include #include @@ -396,7 +399,12 @@ socket_sendsig(struct sonode *so, int event) * the proc is active. */ mutex_enter(&pidlock); - proc = prfind(so->so_pgrp); + /* + * Even if the thread started in another zone, we're receiving + * on behalf of this socket's zone, so find the proc using the + * socket's zone ID. + */ + proc = prfind_zone(so->so_pgrp, so->so_zoneid); if (proc == NULL) { mutex_exit(&pidlock); return; @@ -413,7 +421,12 @@ socket_sendsig(struct sonode *so, int event) pid_t pgrp = -so->so_pgrp; mutex_enter(&pidlock); - proc = pgfind(pgrp); + /* + * Even if the thread started in another zone, we're receiving + * on behalf of this socket's zone, so find the pgrp using the + * socket's zone ID. + */ + proc = pgfind_zone(pgrp, so->so_zoneid); while (proc != NULL) { mutex_enter(&proc->p_lock); socket_sigproc(proc, event); -- cgit v1.2.3