Improve lease extended info
Followup of the #2587 (closed) ticket:
- extend sanity-checks with an extended-info entry doing:
- ignore (do nothing: use with care as it can lead to undetected inconsistencies)
- fix (default: will fix common inconsistencies, this includes upgrade to new format)
- strict (fix + extra checks which makes sense only with Bulk Lease Query. Could be the default when BLQ is loaded)
- pedantic (all checks which can be done even useless for BLQ)
- log sanity check action
- update doc
Likely incomplete list of checks with the fix and stricter variants:
- user context is not null but not a map: make it null
- "ISC" entry is not null but not a map: remove it
- old format: move to new format and continue checks
- both old and new formats (v6): remove old format and likely obsolete entry
- extended-info entry not null but has a wrong type: remove it (chain)
- v6 empty list: remove it (mainly because it makes current LQ code to refuse it, chain)
- (sub)option entry not null but not a string: remove extended info (chain)
- can't decode (sub)option hex string: remove extended info (chain)
- (extra, v6) no link address: remove extended info (chain)
- (extra, v6) link address is not a string: remove extended info (chain)
- (extra, v6) link address string is not an IPv6 address: remove extended info (chain)
- (extra) relay-id is not null and not a string: remove extended info (chain)
- (extra) relay-id hex string can't be decoded: remove extended info (chain)
- (extra) remote-id is not null and not a string: remove extended info (chain)
- (extra) remote-id hex string can't be decoded: remove extended info (chain)
- (pedantic, v6) missing fields: hop and peer address: remove extended info (chain)
- (pedantic) extra fields: remove extra fields other than "comment"
Chain means if the (map) parent of the removed entry becomes empty remove it recursively.
Two things out of the scope of this ticket:
- extension to not memfile backend
- write the updated lease to the file (this includes a possible support by LFC)
Edited by Francis Dupont