[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bf05b217-dcf9-41f8-8fd0-7fce9703fbe0@gmail.com>
Date: Wed, 31 Jan 2018 10:40:35 -0700
From: David Ahern <dsahern@...il.com>
To: Serhey Popovych <serhe.popovych@...il.com>,
Eric Dumazet <eric.dumazet@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev <netdev@...r.kernel.org>,
Maciej Żenczykowski <maze@...gle.com>
Subject: Re: [BUG iproute2] ip tuntap show
On 1/31/18 10:21 AM, Serhey Popovych wrote:
> Eric Dumazet wrote:
>> ip tuntap enumerates devices using /sys/class/net which is unusual.
>>
>> Should we replace this enumeration using /proc/net/dev like "ip tunnel" ?
>>
>> After "unshare -n" maybe mounting /sys should not be required for
>> proper iproute2 behavior.
>>
>> At least ip command should adopt a common enumeration method.
>>
>> What do you think ?
>
> It seems main reason for using /sys/class/net is to get additional
> information for netdev like "owner", "group" and "tun_flags".
>
> On the other hand at least iptunnel and ip6tunnel uses nearly identical
> code to parse /proc/net/dev.
>
> Having single routine that reads /proc/net/dev and calls implementation
> specific callback function with given network device name is good idea.
>
> I can try to prepare v1 for this, if no one objects this.
>
pid_name function needs help too. comm is allocated via sprintf, freed,
and used again and then returned to caller.
Powered by blists - more mailing lists