Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140721145935.GR17402@brightrain.aerifal.cx>
Date: Mon, 21 Jul 2014 10:59:35 -0400
From: Rich Felker <dalias@...c.org>
To: Timo Teras <timo.teras@....fi>
Cc: musl@...ts.openwall.com
Subject: Re: if_nameindex, etc. [Re: Progress towards 1.1.4]

On Mon, Jul 21, 2014 at 04:31:09PM +0300, Timo Teras wrote:
> On Mon, 21 Jul 2014 01:59:07 -0400
> Rich Felker <dalias@...c.org> wrote:
> 
> > - Solving the long-standing if_nameindex and getifaddrs lack of
> >   support for unconfigured and v6-only interfaces.
> 
> I understand that the big part of this is making the informed decision
> on whether or not to use netlink. My take is to use netlink, as the
> only argument against was that emulation layers do not support netlink.
> But IIRC, it was mentioned that emulation does not support any of the
> other APIs that would be needed to implement this.
> 
> If considering my netlink patch, the biggest job is likely auditing the
> code. But I will be happy to do any changes requested.

I admit it's been low priority on my list of things to look at, so I
haven't looked at it in enough detail, but my first impression was
that it looked larger and more complex than needed (but of course much
smalled and less ugly than other netlink code I've seen, so maybe
that's just netlink...).

Some useful questions to get answers to:

- How does size(1) vary before/after the patch?

- Would it be easy to make if_nameindex support pulling interface
  names from 3 sources (ioctl, /proc/net/dev, and netlink), using the
  index numbers obtained during that process where available (netlink
  only?), and using ioctl to get index numbers for the rest? I think
  that would provide maximum compatibility but it may also be a lot
  more bloat than we want...

- Would netlink code get any smaller/simpler if it were just flattened
  in the two places it's used rather than having callbacks and general
  framework?

I'm not expecting you to have answers to all of these but maybe it's
something others could look into and/or experiment with too.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.