Changeset View
Changeset View
Standalone View
Standalone View
head/sbin/geom/class/eli/geom_eli.c
Show First 20 Lines • Show All 1,112 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
if (nkey >= G_ELI_MAXMKEYS) { | if (nkey >= G_ELI_MAXMKEYS) { | ||||
gctl_error(req, "Invalid '%s' argument.", "keyno"); | gctl_error(req, "Invalid '%s' argument.", "keyno"); | ||||
return; | return; | ||||
} | } | ||||
val = gctl_get_intmax(req, "iterations"); | val = gctl_get_intmax(req, "iterations"); | ||||
/* Check if iterations number should and can be changed. */ | /* Check if iterations number should and can be changed. */ | ||||
if (val != -1) { | if (val != -1 && md->md_iterations == -1) { | ||||
md->md_iterations = val; | |||||
} else if (val != -1 && val != md->md_iterations) { | |||||
if (bitcount32(md->md_keys) != 1) { | if (bitcount32(md->md_keys) != 1) { | ||||
gctl_error(req, "To be able to use '-i' option, only " | gctl_error(req, "To be able to use '-i' option, only " | ||||
"one key can be defined."); | "one key can be defined."); | ||||
return; | return; | ||||
} | } | ||||
if (md->md_keys != (1 << nkey)) { | if (md->md_keys != (1 << nkey)) { | ||||
gctl_error(req, "Only already defined key can be " | gctl_error(req, "Only already defined key can be " | ||||
"changed when '-i' option is used."); | "changed when '-i' option is used."); | ||||
▲ Show 20 Lines • Show All 597 Lines • Show Last 20 Lines |