Subject: Re: network interface state

From: Ulrich Drepper <[email-masked]>
Date: Wed, 14 Nov 2007 16:12:28 -0800

David Miller wrote:
> Most daemons handle this by listening for events on the netlink
> socket, but I understand how that might not be practical for
> glibc.

Right, this cannot work.  I have no inner loop which I can control.  I
cannot install a listener.

At some point, when we have non-sequential, hidden file descriptors,
I'll be able to leave a socket file descriptor open.  But that's about
it.  Even then the generation counter interface is likely to be the best
choice.

> It's part of the link information, Look in ifinfomsg->ifi_type

Great, I fixed up the code.  I guess in future, once I can cache the
data, I'll simply read the RTM_GETADDR and RTM_GETLINK data all at once
and be done with it.

BTW, is it possible to send both these requests out before starting to
read the results?  This would reduce the amount of code quite a bit.

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖