Changing MaxKeylen in Application

I Have to change maxkeylength to 30. I have added a macro in my application for MAXKEYLEN as 30 and i am building libconfd library with -DMAXKEYLEN=30. The application is working fine with the changes, accepting keylengths greater than 9. But i when i am using the precompiled confd_load, I am getting error for the Maxkeylen 20/9 is not sufficient. Can you suggest what should i do

You have to recompile also the included-and-precompiled “applications” that you want to use with the MAXKEYLEN define and your rebuilt libconfd. Sources for confd_load and confd_cmd are provided in $CONFD_DIR/src/confd/tools, and in case you want to use the ‘maapi’ command (e.g. in clispec commands), the source for that is provided in $CONFD_DIR/src/confd/cli.

Thanks but can you tell why on building the library again we have to build the precompiled binaries such as confd_load, maapi.

I have not build even the confd binary again.But that is working. I have only build the libconfd and my application with max keylen change.

Those binaries are statically linked with the original libconfd.a, they need to be rebuilt with your new libconfd. But even if they were dynamically linked with, they need to be recompiled with your new value of MAXKEYLEN, since this changes the definition of the confd_hkeypath type.

You don’t need to rebuild the confd binary (actually you can’t), it doesn’t use the confd_hkeypath C type internally, and can handle keypaths of any size.