Skip to content

Commit

Permalink
Fixed filter namespace in netconf_rpc.o
Browse files Browse the repository at this point in the history
The "filter" node was not detected when an a namespace was used. The fix is similar to clicon@d045e8a and related to bug clicon#154 clicon#143
  • Loading branch information
s-bauer authored Dec 13, 2020
1 parent d6db28c commit be329da
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/netconf/netconf_rpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ netconf_get_config(clicon_handle h,
int retval = -1;
cxobj *xfilter; /* filter */
char *ftype = NULL;
cvec *nsc = NULL;
char *prefix = NULL;

if(xml_nsctx_node(xn, &nsc) < 0)
goto done;

/* Get prefix of netconf base namespace in the incoming message */
if (xml_nsctx_get_prefix(nsc, NETCONF_BASE_NAMESPACE, &prefix) == 0){
goto done;
}

/* ie <filter>...</filter> */
if ((xfilter = xpath_first(xn, NULL, "filter")) != NULL)
Expand Down Expand Up @@ -193,6 +203,8 @@ netconf_get_config(clicon_handle h,
}
retval = 0;
done:
if (nsc)
cvec_free(nsc);
return retval;
}

Expand Down Expand Up @@ -364,6 +376,16 @@ netconf_get(clicon_handle h,
int retval = -1;
cxobj *xfilter; /* filter */
char *ftype = NULL;
cvec *nsc = NULL;
char *prefix = NULL;

if(xml_nsctx_node(xn, &nsc) < 0)
goto done;

/* Get prefix of netconf base namespace in the incoming message */
if (xml_nsctx_get_prefix(nsc, NETCONF_BASE_NAMESPACE, &prefix) == 0){
goto done;
}

/* ie <filter>...</filter> */
if ((xfilter = xpath_first(xn, NULL, "filter")) != NULL)
Expand Down Expand Up @@ -393,6 +415,8 @@ netconf_get(clicon_handle h,
}
retval = 0;
done:
if(nsc)
cvec_free(nsc);
return retval;
}

Expand Down

0 comments on commit be329da

Please sign in to comment.