Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
47 stars 5 forks source link

Yang schema evolution should invalidate compiled configurations from old schema revisions #1208

Closed wingo closed 5 years ago

wingo commented 5 years ago

In #1183, the snabb-softwire-v2 schema gained a leaf. This should have been accompanied with a new revision-date in the schema, but it wasn't. With a new revision-date, old compiled configurations without this leaf would know that they're stale. If the stale configuration is used, you end up with a configuration without a given leaf or its default value, which breaks some invariants in the code.

However -- the binary configuration loader currently does not detect that the loaded file is against an old revision. It should check that the binary was compiled against the latest revision of the schema known to Snabb.

wingo commented 5 years ago

Additionally, can be fixed in the same patch: if yang.load_configuration is given a compiled file directly, but the compiled file fails to load for whatever reason, then we could erroneously return nil from this function.