Summary
Cross-posting from sonic-mgmt-common#210 for broader visibility.
CVL's ValidateEditConfig() does not enforce mandatory true YANG fields
on OP_CREATE operations. Entries with missing mandatory fields are silently
accepted and written to CONFIG_DB.
Impact
Affects all sonic YANG models that use mandatory true — not just sonic-acl.
Root Cause (already identified)
Three layers all bypass this validation:
- YGOT validation is skipped for sonic models (
translib/request_binder.go:127)
lyd_check_mandatory_tree is commented out in libyang (yparser.go:59)
- No
OP_CREATE mandatory check exists in cvl/cvl_api.go
(only OP_DELETE has it)
Full details & reproduction steps
--> sonic-net/sonic-mgmt-common#210
Status
A fix has been implemented locally. Waiting for maintainer confirmation
on the intended design before opening a PR in sonic-mgmt-common.
Summary
Cross-posting from sonic-mgmt-common#210 for broader visibility.
CVL's
ValidateEditConfig()does not enforcemandatory trueYANG fieldson
OP_CREATEoperations. Entries with missing mandatory fields are silentlyaccepted and written to CONFIG_DB.
Impact
Affects all sonic YANG models that use
mandatory true— not justsonic-acl.Root Cause (already identified)
Three layers all bypass this validation:
translib/request_binder.go:127)lyd_check_mandatory_treeis commented out in libyang (yparser.go:59)OP_CREATEmandatory check exists incvl/cvl_api.go(only
OP_DELETEhas it)Full details & reproduction steps
--> sonic-net/sonic-mgmt-common#210
Status
A fix has been implemented locally. Waiting for maintainer confirmation
on the intended design before opening a PR in sonic-mgmt-common.