Skip to content

Propose Fix: Syntax Error, Mismatch vector, Mismatch XML and Yang #646

Open
bhumong wants to merge 4 commits intoclicon:masterfrom
bhumong:master
Open

Propose Fix: Syntax Error, Mismatch vector, Mismatch XML and Yang #646
bhumong wants to merge 4 commits intoclicon:masterfrom
bhumong:master

Conversation

@bhumong
Copy link

@bhumong bhumong commented Jan 14, 2026

This pull request related propose fix that I open in PR-641.

This pull request introduces several improvements and bug fixes across the codebase, focusing on enhanced error handling, prevention of double-free issues in RESTCONF connections and streams, improved YANG grouping resolution, and better XPath evaluation and parsing. These changes aim to make the system more robust, easier to debug, and more standards-compliant.

Error Handling and Debugging Enhancements:

  • Improved error reporting in RESTCONF methods, including more informative error messages when validation fails or when expected XML structures are missing. The system now logs unexpected payloads and gracefully falls back to generic error responses when needed. [1] [2] [3]

Memory Safety and Double-Free Prevention:

  • Added guard variables (sd_freed and rc_closed) to restconf_stream_data and restconf_conn structures, along with associated logic, to prevent double-free and double-close scenarios in RESTCONF HTTP/2 streams and SSL socket connections. [1] [2] [3] [4] [5] [6]

YANG Grouping Resolution Improvements:

  • Enhanced the logic in ys_grouping_resolve to attempt resolution via the original YANG statement if the initial lookup fails, improving compatibility with YANG modules that use grouping inheritance or shadowing. [1] [2]

XPath Parsing and Evaluation Enhancements:

  • Fixed parsing rules for / in XPath expressions to better handle tokenization and state transitions. [1] [2]
  • Improved XPath evaluation to correctly handle text() node tests by returning parent nodes with body content, and expanded string comparison support for various relational operators. [1] [2]
  • Ensured the translate() XPath function is always treated as implemented in the parser and evaluator, preventing unnecessary downgrades or errors when optional functions are disabled. [1] [2] [3]

YANG Identityref Namespace Handling:

  • Added a new function to handle identityref values with namespace prefixes, ensuring the necessary namespaces are declared in the output XML if present in the YANG specification.

sync from clicon/clixon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant