This moves the checks previously under #ifdef STRICT in
nvmf_nqn_valid() into a separate helper for userland. This
requires that the NQN starts with "nqn.YYYY-MM." followed by at
least one additional character.
Details
Details
- Reviewers
asomers mav trasz - Commits
- rG9f0f30bc1f5f: libnvmf: Add nvmf_nqn_valid_strict() function
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
The only improvement I could suggest would be to factor out the guts of both functions into a third, private function. That would save callers of nvmf_nqn_valid_strict from calling strlen twice. But it's probably premature optimization.
Comment Actions
Yeah, I thought about it and initially I had made the common routine in the header take a bool strict argument, but the kernel never uses the strict version, only ctld(8) in userspace when parsing a config file (which is not a hot path).