CESNET / libnetconf

C NETCONF library
Other
113 stars 83 forks source link

get-schema of ietf-netconf-acm fails #218

Closed ntadas closed 8 years ago

ntadas commented 8 years ago

Hi

with the fix introduced in #38 the get-schema of ietf-netconf-acm fails with: compare_schemas: internal (src/datastore.c:1673)

I think the problem is that in datastore.c in line 240 the indexes were updated and now the NACM_DS_INDEX is number 9 but in line 1665 the indexes were not updated.

it should be something like:

diff --git a/src/datastore.c b/src/datastore.c
index 9e5d36b..416ba31 100644
--- a/src/datastore.c
+++ b/src/datastore.c
@@ -1657,11 +1657,11 @@ static char* compare_schemas(struct data_model* model, char* name, char* version
                                        return strndup((char*)ietf_netconf_notifications_yin + 39, ietf_netconf_notifications_yin_len - 39);
                                case '5':
                                        return strndup((char*)nc_notifications_yin + 39, nc_notifications_yin_len - 39);
-                               case '6':
-                                       return strndup((char*)notifications_yin + 39, notifications_yin_len - 39);
                                case '7':
-                                       return strndup((char*)ietf_netconf_with_defaults_yin + 39, ietf_netconf_with_defaults_yin_len - 39);
+                                       return strndup((char*)notifications_yin + 39, notifications_yin_len - 39);
                                case '8':
+                                       return strndup((char*)ietf_netconf_with_defaults_yin + 39, ietf_netconf_with_defaults_yin_len - 39);
+                               case '9':
                                        return strndup((char*)ietf_netconf_acm_yin + 39, ietf_netconf_acm_yin_len - 39);
 #else
                                case '4':

not sure what should be the number 6.

Best Regards

rkrejci commented 8 years ago

Thanks, good catch!