diff mbox

[7/9,v2] opensm: Check for valid mkey protection level in config file

Message ID 1343832755-26753-7-git-send-email-foraker1@llnl.gov (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Jim Foraker Aug. 1, 2012, 2:52 p.m. UTC
Signed-off-by: Jim Foraker <foraker1@llnl.gov>
---
 opensm/osm_subnet.c |    7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 3e923f2..5ae49bb 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -2005,6 +2005,13 @@  int osm_subn_verify_config(IN osm_subn_opt_t * p_opts)
 	}
 #endif
 
+	if (p_opts->m_key_protect_bits > 3) {
+		log_report(" Invalid Cached Option Value:"
+			   "m_key_protection_level = %u Setting to %u "
+			   "instead\n", p_opts->m_key_protect_bits, 2);
+		p_opts->m_key_protect_bits = 2;
+	}
+
 	if (p_opts->root_guid_file != NULL) {
 		FILE *root_file = fopen(p_opts->root_guid_file, "r");
 		if (!root_file) {