This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] New getaddinfo implementation
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Thorsten Kukuk <kukuk at suse dot de>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 26 Mar 2003 11:13:53 -0800
- Subject: Re: [PATCH] New getaddinfo implementation
- Organization: Red Hat, Inc.
- References: <20030326101702.GA2375@suse.de>
-----BEGIN PGP SIGNED MESSAGE-----
Thorsten Kukuk wrote:
> I wrote a new getaddrinfo implementation for Linux,
Reading this I got really exciting...
> which uses the netlink kernel interface and works with IPv6, too.
... but this sounded strange :-). You mean getifaddrs...
How does this implementation react if netlink is not available? Netlink
is optional, right? If yes, we probably need a fallback solution.
What worries me most is the memory handling. First, there are several
places where the malloc/calloc results are not checked for NULL. This
will require cleanups. Also, the number of separate memory operations
is high. It should be possible to use exactly one chunk of memory.
Memory allocation is relatively slow and many allocations might lead to
fragmentation. If possible, for instance for the temporary objects used
in the functions, alloca should be used. This might mean merging a
functions or two but that's OK.
A few more comments for the non-obvious things, like the netlink
protocol, would be nice to have, too. And the code does not really
follow the coding conventions.
- --------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----