summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-05 08:32:34 +0000
committermav <mav@FreeBSD.org>2015-10-05 08:32:34 +0000
commitf19237a8be8a8500503cde373b7e9e0dfa61e4e4 (patch)
tree91be6866d5a7a2b368e51f88b3474958b53580b4
parentec7deb53d18cdb5720ef959156dcf8fcff0247f9 (diff)
downloadFreeBSD-src-f19237a8be8a8500503cde373b7e9e0dfa61e4e4.zip
FreeBSD-src-f19237a8be8a8500503cde373b7e9e0dfa61e4e4.tar.gz
MFC r285481: Make role sysctl handling from r284727 less strict.
-rw-r--r--sys/dev/isp/isp_freebsd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c
index e87e79a..4453480 100644
--- a/sys/dev/isp/isp_freebsd.c
+++ b/sys/dev/isp/isp_freebsd.c
@@ -101,18 +101,15 @@ isp_role_sysctl(SYSCTL_HANDLER_ARGS)
ISP_LOCK(isp);
old = FCPARAM(isp, chan)->role;
+ /* We don't allow target mode switch from here. */
+ value = (old & ISP_ROLE_TARGET) | (value & ISP_ROLE_INITIATOR);
+
/* If nothing has changed -- we are done. */
if (value == old) {
ISP_UNLOCK(isp);
return (0);
}
- /* We don't allow target mode switch from here. */
- if ((value ^ old) & ISP_ROLE_TARGET) {
- ISP_UNLOCK(isp);
- return (EPERM);
- }
-
/* Actually change the role. */
error = isp_control(isp, ISPCTL_CHANGE_ROLE, chan, value);
ISP_UNLOCK(isp);
OpenPOWER on IntegriCloud