8000 RFD: can we make explicit link against libidn2 optional? · Issue #573 · iputils/iputils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
RFD: can we make explicit link against libidn2 optional? #573
Open
@yvs2014

Description

@yvs2014

iputils-ping supports IDN resolv via getaddrinfo() glibc functionality, there's no need to link it directly to libidn2 to get IDN support

shared lib links:

% ldd `which ping`
	linux-vdso.so.1 (0x00007ffca51db000)
	libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007df4f1ed5000)
	libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007df4f1eb3000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007df4f1c00000)
	libunistring.so.5 => /lib/x86_64-linux-gnu/libunistring.so.5 (0x00007df4f1a53000)
	/lib64/ld-linux-x86-64.so.2 (0x00007df4f1f20000)

a test version (https://github.com/yvs2014/iputils) built without explicit link against libidn2 works totally in the same way
(via implicit libc getaddrinfo() calls to libidn2 if current locale is unicode compat)

% ldd _build/ping/ping
	linux-vdso.so.1 (0x00007ffe499cd000)
	libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007050c22be000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007050c2000000)
	/lib64/ld-linux-x86-64.so.2 (0x00007050c230f000)

The only point where this explicit link against libidn2 needed is idn2_lookup_ul() call from ping/node_info.c.
Which in turn is used for -N subject-name and -N subject-fqdn (if I got it correctly -N is IP6 nodeinfo query client functionality).

Is that worth to make explicit link to libidn optional?
A couple ways that are tested:

  • optional support for IP6 IDN nodeinfo queries (it works)
  • replace idn2_lookup_ul() with libc idna_to_dns_encoding() (it works too, but it is internal libc interface and can be changed in anytime)
  • optional build support for RFC4620 client in general (not tried yet)

p.s. to test ip6-nodeinfo functionality (-N option) it needs to build ninfod server or some other one with similar interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0