From: Serhey Popovych Subject: Re: [BUG iproute2] ip tuntap show Date: Wed, 31 Jan 2018 19:43:18 +0200 Message-ID: <6b007beb-ce91-dc2c-de3b-d8abfee7f950@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="m5EBgEKVlihov6lRJhF9yPLg6H9ztRCK8" Cc: netdev , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= To: David Ahern , Eric Dumazet , Stephen Hemminger Return-path: Received: from mail-wr0-f176.google.com ([209.85.128.176]:37617 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbeAaRn0 (ORCPT ); Wed, 31 Jan 2018 12:43:26 -0500 Received: by mail-wr0-f176.google.com with SMTP id a43so8368111wrc.4 for ; Wed, 31 Jan 2018 09:43:25 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5EBgEKVlihov6lRJhF9yPLg6H9ztRCK8 Content-Type: multipart/mixed; boundary="Gionndrw1j01Nz68kV1ox586l0oSVqyRP"; protected-headers="v1" From: Serhey Popovych To: David Ahern , Eric Dumazet , Stephen Hemminger Cc: netdev , =?UTF-8?Q?Maciej_=c5=bbenczykowski?= Message-ID: <6b007beb-ce91-dc2c-de3b-d8abfee7f950@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: --Gionndrw1j01Nz68kV1ox586l0oSVqyRP 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 Nice :-) will fix that too. Thanks for pointing. --Gionndrw1j01Nz68kV1ox586l0oSVqyRP-- --m5EBgEKVlihov6lRJhF9yPLg6H9ztRCK8 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) iQEcBAEBAgAGBQJacgA7AAoJEBTawMmQ61bBdLAH/jSEZaMGD1y7glazT7h6IaSv B5ts5K2qhHifX6397IwBkRVkbhEkpi8RJSrzDpZjOqxGen+33y6jRYL20bA/5x/3 OTQ4Ar/LUrvg9odIJjV6WU56pFMYYgP2xnVOoTNa48RRfOafRUqjil3DsCxSiiM+ ui5G1vf7UiWFpoOfuxRsdDDoEwHFbC+Gw3PounPNjNEbVGu7cXg50RkY+tGGlreZ YV7HQcbw5rXaOfTPwtKD6JAnbrOgmht1cK3Jw+dH5HB1/QgMSn5sCuRxlxG47j4Q OrC/nMhP1g+I9je83aO6dAL7PFiv3DyLrBIHnnL7IGN9mOBrLSFNvGx0jkPcANk= =9ARO -----END PGP SIGNATURE----- --m5EBgEKVlihov6lRJhF9yPLg6H9ztRCK8--