Re: [BUG iproute2] ip tuntap show

2018-02-05 Thread David Ahern
On 2/5/18 8:34 AM, Serhey Popovych wrote: > Sorry David, but I do no see problem with this function right now: > > 1. It allocates string using malloc() in asprintf() > 2. free() it *after* fopen() to prevent memory leak if fopen() fails > 3. or if fopen() succeeded and we fscanf() with %ms

Re: [BUG iproute2] ip tuntap show

2018-02-05 Thread Serhey Popovych
David Ahern wrote: > 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

Re: [BUG iproute2] ip tuntap show

2018-01-31 Thread Serhey Popovych
David Ahern wrote: > 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

Re: [BUG iproute2] ip tuntap show

2018-01-31 Thread Serhey Popovych
David Ahern wrote: > 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

Re: [BUG iproute2] ip tuntap show

2018-01-31 Thread David Ahern
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

Re: [BUG iproute2] ip tuntap show

2018-01-31 Thread Serhey Popovych
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

[BUG iproute2] ip tuntap show

2018-01-31 Thread Eric Dumazet
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.