Discussion:
[Dnsmasq-discuss] [PATCH] nettle hash lookup
Petr Menšík
2018-02-26 20:12:21 UTC
Permalink
Hi again,

We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.

Do you think older library version should be supported as well?

Best regards,
--
Petr Men¹ík
Software Engineer
Red Hat, http://www.redhat.com/
email: ***@redhat.com PGP: 65C6C973
Simon Kelley
2018-03-06 23:03:19 UTC
Permalink
Explanation is the root cause of the problem at

https://github.com/ShiftMediaProject/nettle/blob/master/NEWS, line 56
onwards.

This has been causing bug reports from Debian too, and at least one
failed attempt to solve the problem without really understanding it.

I applied the equivalent of your patch but with conditional compilation
to allow compilation on older libnettle versions. Thanks for that.


Cheers,

Simon.
Post by Petr Menšík
Hi again,
We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.
Do you think older library version should be supported as well?
Best regards,
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Petr Menšík
2018-03-15 16:40:35 UTC
Permalink
Hi again,

I reworked the original patch to contain fallback for older version of
nettle. It will work fine on more recent version (should be a bit faster
than original code), but still will compile for older libraries.
Post by Petr Menšík
Hi again,
We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.
Do you think older library version should be supported as well?
Best regards,
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
--
Petr Men¹ík
Software Engineer
Red Hat, http://www.redhat.com/
email: ***@redhat.com PGP: 65C6C973
Simon Kelley
2018-03-15 17:14:53 UTC
Permalink
Convergent evolution got me to

http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=f3223fbff65d8ae9d67426dce6218fda30dee0cf

which achieves the same thing in a slightly different way. Are you happy
with that?



Cheers,

Simon.
Post by Petr Menšík
Hi again,
I reworked the original patch to contain fallback for older version of
nettle. It will work fine on more recent version (should be a bit faster
than original code), but still will compile for older libraries.
Post by Petr Menšík
Hi again,
We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.
Do you think older library version should be supported as well?
Best regards,
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Petr Menšík
2018-03-16 12:31:51 UTC
Permalink
Sure, similar to my original version. It requires nettle 3.1 however,
since NETTLE_VERSION_MAJOR is not available in earlier versions. But
your version is cleaner, fine for me. Version 3.1 was released in 2015,
should be recent enough for most people.

Thanks
Post by Simon Kelley
Convergent evolution got me to
http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=f3223fbff65d8ae9d67426dce6218fda30dee0cf
which achieves the same thing in a slightly different way. Are you happy
with that?
Cheers,
Simon.
Post by Petr Menšík
Hi again,
I reworked the original patch to contain fallback for older version of
nettle. It will work fine on more recent version (should be a bit faster
than original code), but still will compile for older libraries.
Post by Petr Menšík
Hi again,
We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.
Do you think older library version should be supported as well?
Best regards,
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
--
Petr Men¹ík
Software Engineer
Red Hat, http://www.redhat.com/
email: ***@redhat.com PGP: 65C6C973
Simon Kelley
2018-03-17 22:12:42 UTC
Permalink
I looked at all the nettle version dependencies, and I've cleaned it up
to work with nettle 3.x, but lost the legacy support for 2.x

I used your nettle_hash #define trick.


Cheers,

Simon.
Post by Petr Menšík
Sure, similar to my original version. It requires nettle 3.1 however,
since NETTLE_VERSION_MAJOR is not available in earlier versions. But
your version is cleaner, fine for me. Version 3.1 was released in 2015,
should be recent enough for most people.
Thanks
Post by Simon Kelley
Convergent evolution got me to
http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=f3223fbff65d8ae9d67426dce6218fda30dee0cf
which achieves the same thing in a slightly different way. Are you happy
with that?
Cheers,
Simon.
Post by Petr Menšík
Hi again,
I reworked the original patch to contain fallback for older version of
nettle. It will work fine on more recent version (should be a bit faster
than original code), but still will compile for older libraries.
Post by Petr Menšík
Hi again,
We at Fedora use dynamic linking for all libraries. We had breakage of
dnsmasq build more than once, because dnsmasq is using directly
nettle_hash array. If its size changes, dynamic linker will refuse to
link it. For that reason, accessing hash array directly makes trouble.
There is however special function that looks like very similar to
hash_find() of dnsmasq, that iterates the array internally. It requires
nettle 3.4, but I think that is already old enough. It would help
preventing any more linker conflict, if library data changes.
Do you think older library version should be supported as well?
Best regards,
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...