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
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 62172 Build 59056: arc lint + arc unit
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).