mailing list of musl libc
 help / color / mirror / code / Atom feed
From: orc <orc@sibserver.ru>
To: musl@lists.openwall.com
Subject: Re: Proposed roadmap to 1.0
Date: Wed, 24 Jul 2013 22:14:10 +0800	[thread overview]
Message-ID: <20130724221410.4b17905d@sibserver.ru> (raw)
In-Reply-To: <20130629235041.GA5046@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]

On Sat, 29 Jun 2013 19:50:41 -0400
Rich Felker <dalias@aerifal.cx> wrote:

> Hi all,
> 
> Here is a VERY tentative, proposed roadmap towards a 1.0 release of
> musl. Comments welcome!
> 
> Rich
> 
> 
> 
> 0.9.11
> Projected release: ASAP
> No further goals at the moment except fixing additional bugs found.
> 
> 0.9.12
> Projected release: Mid to late July
> Key targets:
> - Overhaul of time handling, including zoneinfo support.
> - Overhaul resolver to better provide legacy APIs without code dup.
> - Hybrid automatic/manual audit for cruft and code smells.
> - Resolve symlink direction issue for dynamic linker.
> - Affinity/cpuset interfaces.
> 
> 0.9.13
> Projected release: Early August
> Key targets:
> - Full C++ ABI compatibility with glibc/LSB.
> - Support for all remaining iconv charsets of interest (KR/TW/HK).
> - Possible overhaul of iconv for performance and clarity/simplicity.
> - Possibly add stateful iconv support.
> - Establish formal procedure for regression testing.
> 
> 0.9.14
> Projected release: End of summer
> Key targets:
> - Complete documentation draft.
> - Performance testing on under-tested archs, fixing bottlenecks hit.
> - Review for gratuitous application breakage (anything that could be
>   fixed with trivial changes that don't hurt musl's quality).
> 
> 1.0.0
> Projected release: Early fall
> Key targets:
> - Polished documentation.
> - Organized and coordinated publicity plan.
> - At least one new exciting addition to make the release noteworthy,
>   but which has no chance of breaking things that work. Best candidate
>   would be one or more new ports, labeled experimental.

Hi Rich,

(This probably should go into 1.0 wishlist thread, but this one
freshier)

While building a file server/router I found some bugs/incompatibilities
in getaddrinfo() and getifaddrs().

getaddrinfo() does not reports IPv6 available when asked with
AF_UNSPEC. Thus, servers like openssh or tinc (vpn daemon) still bind
only IPv4 socket when they configured to bind IPv4 and IPv6 sockets.
getifaddrs() does not returns AF_PACKET like glibc does, so list of
all system interfaces is incomplete (does not shows inactive
interfaces).

I attached patch for getaddrinfo() (adopt it if you need it)
and test program. I still have no any clues about getifaddrs(), but
that is not critical. It is usually implemented with help of netlink
(and possibly there is no other way, maybe some /proc file will give a
list)

musl-git (from 0.9.10 release). Unfortunately your git interface and
website were down at the time this email written and I cannot see any
changes in getaddrinfo.c from that version now.
I checked
https://github.com/idunham/musl/blob/master/src/network/getaddrinfo.c,
it seems to be same.

If I am missed something, let me know.

[-- Attachment #2: gai-test.c --]
[-- Type: application/octet-stream, Size: 710 bytes --]

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>

int main(void)
{
	struct addrinfo *ai, *aip, hint = {0};
	int err;
	char hostn[256], portn[10];

	hint.ai_family = AF_UNSPEC;
	hint.ai_socktype = SOCK_STREAM;
	hint.ai_protocol = IPPROTO_TCP;
	hint.ai_flags = AI_PASSIVE;

	err = getaddrinfo(NULL, "22", &hint, &ai);
	if (err || !ai) return 1;

	for (aip = ai; aip; aip = aip->ai_next) {
		err = getnameinfo(aip->ai_addr, aip->ai_addrlen, hostn, sizeof(hostn), portn, sizeof(portn), NI_NUMERICHOST|NI_NUMERICSERV);
		if (err) { printf("%p: invalid\n", aip); continue; }
		printf("%p: %s:%s\n", aip, hostn, portn);
	}

	freeaddrinfo(ai);

	return 0;
}

[-- Attachment #3: musl-0.9.10git-getaddrinfo-ipv4-ipv6.patch --]
[-- Type: application/octet-stream, Size: 1561 bytes --]

--- musl/src/network/getaddrinfo.c.orig
+++ musl/src/network/getaddrinfo.c
@@ -100,23 +100,31 @@
 	}
 
 	if (!host) {
-		if (family == AF_UNSPEC) family = AF_INET;
-		buf = calloc(sizeof *buf, 1+EXTRA);
+		int unspec = 0, idx = 0;
+		if (family == AF_UNSPEC) { unspec = 1; family = AF_INET; }
+		buf = calloc(sizeof *buf, (unspec ? 2 : 1)+EXTRA);
 		if (!buf) return EAI_MEMORY;
-		buf->ai.ai_protocol = proto;
-		buf->ai.ai_socktype = type;
-		buf->ai.ai_addr = (void *)&buf->sa;
-		buf->ai.ai_addrlen = family==AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin;
-		buf->ai.ai_family = family;
-		buf->sa.sin.sin_family = family;
-		buf->sa.sin.sin_port = port;
+_next6:
+		(buf+idx)->ai.ai_protocol = proto;
+		(buf+idx)->ai.ai_socktype = type;
+		(buf+idx)->ai.ai_addr = (void *)&(buf+idx)->sa;
+		(buf+idx)->ai.ai_addrlen = family==AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin;
+		(buf+idx)->ai.ai_family = family;
+		(buf+idx)->sa.sin.sin_family = family;
+		(buf+idx)->sa.sin.sin_port = port;
+		if (unspec) (buf+idx)->ai.ai_next = &(buf+1)->ai;
 		if (!(flags & AI_PASSIVE)) {
 			if (family == AF_INET) {
-				0[(uint8_t*)&buf->sa.sin.sin_addr.s_addr]=127;
-				3[(uint8_t*)&buf->sa.sin.sin_addr.s_addr]=1;
-			} else buf[0].sa.sin6.sin6_addr.s6_addr[15] = 1;
+				0[(uint8_t*)&(buf+idx)->sa.sin.sin_addr.s_addr]=127;
+				3[(uint8_t*)&(buf+idx)->sa.sin.sin_addr.s_addr]=1;
+			} else (buf+idx)[0].sa.sin6.sin6_addr.s6_addr[15] = 1;
 		}
 		*res = &buf->ai;
+		if (unspec) {
+			idx = 1; unspec = 0;
+			family = AF_INET6;
+			goto _next6;
+		}
 		return 0;
 	}
 

  parent reply	other threads:[~2013-07-24 14:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29 23:50 Rich Felker
2013-06-30  2:53 ` Rob Landley
2013-06-30  3:01   ` Rich Felker
2013-06-30  5:20 ` Isaac
2013-06-30  5:34   ` Rich Felker
2013-06-30  6:42     ` Isaac
2013-06-30  7:21       ` Justin Cormack
2013-06-30 12:02         ` Rich Felker
2013-07-04 18:13         ` Rob Landley
2013-07-07 20:25           ` Isaac
2013-07-04 18:10       ` Rob Landley
2013-07-07 20:30         ` Isaac
2013-06-30  9:24     ` Rob Landley
2013-06-30 10:45     ` Szabolcs Nagy
2013-06-30 21:29       ` Luca Barbato
2013-07-05 15:12   ` Rob Landley
2013-06-30  5:49 ` Strake
2013-07-17 16:02 ` Rich Felker
2013-07-24 18:36   ` Rob Landley
2013-07-24 19:47     ` Rich Felker
2013-07-25  7:25       ` Daniel Cegiełka
2013-07-25  7:40         ` Rich Felker
2013-07-27  5:30       ` Rob Landley
2013-07-25 10:29     ` Timo Teras
2013-07-24 14:14 ` orc [this message]
2013-07-24 14:42   ` Rich Felker
2013-07-24 15:29     ` orc
2013-07-24 16:04       ` Rich Felker
2013-07-24 16:25         ` orc
2013-07-24 19:41           ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130724221410.4b17905d@sibserver.ru \
    --to=orc@sibserver.ru \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).