[PATCH] New getifaddrs implementation
Thorsten Kukuk
kukuk@suse.de
Wed Mar 26 21:53:00 GMT 2003
On Wed, Mar 26, Ulrich Drepper wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Thorsten Kukuk wrote:
>
> > I wrote a new getaddrinfo implementation for Linux,
>
> Reading this I got really exciting...
Argh, I shouldn't work on two functions with similar names at the
same time ...
> > 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.
Yes, netlink is optional, but all tools to configure the network use
netlink today. So without netlink you have a hard time to configure
your interfaces. But I think it is possible to use the current
implementation as fallback.
> 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.
Ok, I will try to change this due the next days.
Thorsten
--
Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de
SuSE Linux AG Deutschherrnstr. 15-19 D-90429 Nuernberg
--------------------------------------------------------------------
Key fingerprint = A368 676B 5E1B 3E46 CFCE 2D97 F8FD 4E23 56C6 FB4B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20030326/720a579f/attachment.sig>
More information about the Libc-alpha
mailing list