[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinAiJJqhrro8Jlrb0WgHzDSCx_dtWXL5N9ZKUbd@mail.gmail.com>
Date: Fri, 16 Jul 2010 16:02:23 -0400
From: Chetan Loke <chetanloke@...il.com>
To: David Miller <davem@...emloft.net>
Cc: shemminger@...tta.com, Chetan.Loke@...scout.com,
bhutchings@...arflare.com, netdev@...r.kernel.org
Subject: Re: [RFC] Enhance dev_ioctl to return <hwaddr>:<if_name::if_index>
mapping
On Fri, Jul 16, 2010 at 3:40 PM, David Miller <davem@...emloft.net> wrote:
> From: Chetan Loke <chetanloke@...il.com>
> Date: Fri, 16 Jul 2010 15:35:48 -0400
>
>> Yes, I opened a socket and then sent the IFCONF ioctl.What I meant was
>> that interfaces that didn't have an IP weren't returned.
>
> If you use the correct set of ioctl()'s it will, just as
> "/sbin/ifconfig -a" lists all interfaces regardless of whether they
> have IP addresses.
>
> Run strace on 'ifconfig', see what it does :-)
I grep the /sys nodes in my existing code already ;) and I didn't want
to do that.If we plop the single for-each-netdev loop then wouldn't it
be easier?
>
> And then you also have the option of using netlink as well.
> This is how "ip l l" lists all interfaces, also regardless of
> configuration.
>
So all user space apps should replicate code when all of that can be
replaced at the cost of a single for-loop in a non fast-path code
within the kernel?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists