From: Serhey Popovych Subject: Re: [BUG iproute2] ip tuntap show Date: Wed, 31 Jan 2018 21:51:44 +0200 Message-ID: <83812183-669e-68e3-4b05-751ce42d3da6@gmail.com> References: <1517417908.3715.102.camel@gmail.com> <84e6cb8a-f140-4ced-4f6a-c508eaf06f6c@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4DbtXRXQwhyCK9MctZmWZGn57W5NWWk0s" Cc: netdev , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= To: David Ahern , Eric Dumazet , Stephen Hemminger Return-path: Received: from mail-wm0-f47.google.com ([74.125.82.47]:38229 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751608AbeAaTvv (ORCPT ); Wed, 31 Jan 2018 14:51:51 -0500 Received: by mail-wm0-f47.google.com with SMTP id 141so1332340wme.3 for ; Wed, 31 Jan 2018 11:51:50 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4DbtXRXQwhyCK9MctZmWZGn57W5NWWk0s Content-Type: multipart/mixed; boundary="CediJfbBusU3gvWAeE74HqYrE8G2xh99S"; protected-headers="v1" From: Serhey Popovych To: David Ahern , Eric Dumazet , Stephen Hemminger Cc: netdev , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= Message-ID: <83812183-669e-68e3-4b05-751ce42d3da6@gmail.com> Subject: Re: [BUG iproute2] ip tuntap show References: <1517417908.3715.102.camel@gmail.com> <84e6cb8a-f140-4ced-4f6a-c508eaf06f6c@gmail.com> In-Reply-To: --CediJfbBusU3gvWAeE74HqYrE8G2xh99S Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 tunne= l" ? >>> >>> 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 identica= l >> code to parse /proc/net/dev. >> >> Having single routine that reads /proc/net/dev and calls implementatio= n >> specific callback function with given network device name is good idea= =2E >> >> I can try to prepare v1 for this, if no one objects this. >> >=20 > pid_name function needs help too. comm is allocated via sprintf, freed,= > and used again and then returned to caller. >=20 Posted v1, but without pid_name patch, will prepare and send separately. Thanks, Serhii --CediJfbBusU3gvWAeE74HqYrE8G2xh99S-- --4DbtXRXQwhyCK9MctZmWZGn57W5NWWk0s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJach5UAAoJEBTawMmQ61bB4G8IAJw7j2YFrA9H1m1VIU3u0Jhd NM6GfyjiLQ8YPkD6vVwhqGIaJ706qN40s6sCjkjqIIwWME3Lx6jFaHyfCoHHIG7g 0y1vMjFDJ2OJg/ZhPLmWc0wPiFW3iNew+H7ygpPZR/6uz/los88J+99zO+6Hk/d3 hHuMUdwO1GktWWgxMJhx6KnTbSAekKixhlmsiJDbUkwCp8mC7/Sqfky66ageYskt vo56J+UXD1fq09vemgXcLdakTQZqUFddgXpbYi7HVk8U36BpF72yfoBD76WfZeqI 4MK5ug8Uw7K5al+ArBFwAo0sfpRTb0qwgaA9ZNmi5T6PSJATsp5N0oIFbs6TtyE= =2dRj -----END PGP SIGNATURE----- --4DbtXRXQwhyCK9MctZmWZGn57W5NWWk0s--