[ldns-users] Some selective const goodness for tsig

Michael Weiser michael at weiser.dinsnail.net
Mon Dec 12 23:59:10 UTC 2016


Hi,

for ddns I need to use tsig. I track all my strings as const char * as
much as possible and find it inelegant to have to write something like
the following, especially since ldns either just stores the pointer and
never free()s it (ldns_tsig_credentials) or strdup()s it internally
(ldns_resolver):

/* they forgot to const them but they strdup them, so all is well */
ldns_resolver_set_tsig_algorithm(updres, (char *)algop->theirname);
ldns_resolver_set_tsig_keyname(updres, (char *)keyname);
ldns_resolver_set_tsig_keydata(updres, (char *)key);

So I const'ed tsig parameters as much as sensible in the attached patch.
I'd appreciate if this could be included.
-- 
Thanks,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Some-selective-const-goodness-for-tsig.patch
Type: text/x-diff
Size: 5943 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20161213/1151bf9a/attachment.bin>


More information about the ldns-users mailing list