Skip to content

fix(xml_bind): namespace collision#672

Merged
olofhagsand merged 5 commits into
clicon:masterfrom
bhumong:original
Jul 4, 2026
Merged

fix(xml_bind): namespace collision#672
olofhagsand merged 5 commits into
clicon:masterfrom
bhumong:original

Conversation

@bhumong

@bhumong bhumong commented May 5, 2026

Copy link
Copy Markdown
Contributor

propose to fix issue 670

@bhumong bhumong marked this pull request as draft May 5, 2026 08:34
@bhumong bhumong marked this pull request as ready for review May 12, 2026 03:23

@olofhagsand olofhagsand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The xsibling code further down in xml_bind_yang0_opt:

 else if (xsibling &&
                 (xs = xml_find_type(xsibling, prefix, name, CX_ELMNT)) != NULL){

also suffers from a similar issue.
Summarizing, the fix is correct, but the code needs a restructuring for the xsibling optimization along with the yang check to be clearer.
I will pull this in and modify it in master.

new "kill old backend"
$clixon_backend -z -f $cfg >/dev/null 2>&1 || true
new "start backend -s startup -f $cfg"
$clixon_backend -D $DBG -s startup -f $cfg

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the start_backend to mimic other tests


if [ $BE -ne 0 ]; then
new "Kill backend"
$clixon_backend -z -f $cfg

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use stop_backend

Comment thread lib/src/clixon_xml_bind.c
if (xml2ns(xt, xml_prefix(xt), &ns) < 0)
goto done;
ns_resolved++;
nsy = yang_find_mynamespace(y);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL return is actually an error and should goto fail, but is harmless here, and if checked should have been tested earlier

@olofhagsand olofhagsand merged commit 4bceb06 into clicon:master Jul 4, 2026
8 checks passed
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.

2 participants