This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

netresolve: name resolution library project announcement


Hi all,

I would like to announce a new project called *netresolve* I started at sourceware.org. All started with a regression I experienced when using `ssh` to connect to a literal IPv6 link-local address caused by a Fedora patch to glibc. I wanted to know more about the original problem they were trying to solve and after some testing and source reading I found numerous bugs and limitations in the glibc network name resolution stack.

Many of the issues can be found using the following query:

    https://sourceware.org/bugzilla/buglist.cgi?quicksearch=getaddrinfo

Originally, I was going to prepare and submit patches for glibc and I indeed attached some to the bugzilla. But finally I realized some behavioral details are not settled so well and they need quite some documentation and discussion. Also I wanted to experiment with features that cannot be expressed in terms of `getaddrinfo()` or similar API or that are not possible with the current name service switch backend API which is even more restricted.

The result of that is a proof of concept implementation of a nonblocking (aka asynchronous) name resolution library with backends, which serves as an alternative to glibc's `getaddrinfo()` API.

Following libraries and tools are provided:

 * `netresolve` command line tool
 * `libnetresolve.so` name resolution library
 * `libnetresolve-getaddrinfo.so` provides `getaddrinfo()` API on top of netresolve
 * `tools/wrapper.sh` script to `LD_PRELOAD` the alternative getaddrinfo implementation

Current name resolution power is provided by the following backends:

 * any: handles translation of NULL or empty names to `0.0.0.0` and/or `::` unless configured for `connect()`
 * loopback: translates `localhost`, `localhost4`, `localhost6` and NULL/empty node names to `127.0.0.1` and/or `::1`
 * numerichost: handles numeric values including ifindex/scope_id percent sign notation
 * hosts: answers using data from /etc/hosts
 * dns: uses c-ares to perform DNS queries
 * unix: handles AF_UNIX paths

Following backends help with testing netresolve as well as glibc:

 * getaddrinfo: uses `getaddrinfo()` for name resolution
 * nss: uses a specified glibc nsswitch backend for name resolution
 * exec: performs name resolution by consulting an executable via stdin and stdout

Other features:

 * socket API to provide a common implementation of bind/connect after name resolution

Planned features:

 * extended information (like TTL, DNSSEC validation, etc.)
 * sensible dualstack networking (Happy Eyeballs and stuff like that)
 * name service switch backend on top of netresolve
 * SRV and MX record support
 * multicast DNS backend
 * AI_ADDRCONFIG-like functionality
 * wrappers for glib, python and others

The primary goal of the library is to provide name resolution functionality for network applications without the limitations currently imposed by the glibc implementation. For now I'm going to develop netresolve alongside glibc's name resolution functionality but would also like to see what can be done with the glibc implementation itself. That is why I started the project at sourceware.org and why I'm announcing it on the glibc mailing list. Looking forward to working together to make name resolution on open source systems better.

More information about netresolve:

    https://sourceware.org/git/?p=netresolve.git;a=blob;f=README;hb=HEAD
    https://sourceware.org/git/?p=netresolve.git;a=blob;f=TODO;hb=HEAD

The source code:

    https://sourceware.org/git/?p=netresolve.git;a=tree

File bug reports and feature requests:

    https://sourceware.org/bugzilla/enter_bug.cgi?product=netresolve

Cheers,

Pavel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]