netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev
@ 2018-01-31 19:49 Serhey Popovych
  2018-01-31 19:49 ` [PATCH iproute2-next 1/4] utils: Introduce do_each_proc_net_dev() helper Serhey Popovych
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Serhey Popovych @ 2018-01-31 19:49 UTC (permalink / raw)
  To: netdev

Currently there is two places in ip(8) where /proc/net/dev is read line
by line with nearly identical steps: iptunnel.c and ip6tunnel.c

On the other hand we have iptuntap.c that uses /sys/class/net that could
be problematic in case of unshare(1)d network namespace without sysfs
being mounted.

Introduce and use do_each_proc_net_dev() helper to read data from
/proc/net/dev line by line and pass this information to implementation
specific callback function.

See individual patch description message for more details.

Series is open for reviews and comments.

Tested only by compiling and executing ip [-46] [-s] [-d] tunnel in
various combinations: no problem so far. More can be done by request.

Thanks,
Serhii

Serhey Popovych (4):
  utils: Introduce do_each_proc_net_dev() helper
  iptunnel: Use do_each_proc_net_dev()
  ip6tunnel: Use do_each_proc_net_dev()
  tuntap: Use do_each_proc_net_dev()

 include/utils.h |   10 ++++++
 ip/ip6tunnel.c  |   94 ++++++++++++++++++++------------------------------
 ip/iptunnel.c   |  102 +++++++++++++++++++++++++------------------------------
 ip/iptuntap.c   |   59 ++++++++++++++------------------
 lib/utils.c     |   51 ++++++++++++++++++++++++++++
 5 files changed, 170 insertions(+), 146 deletions(-)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-01 19:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-31 19:49 [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 1/4] utils: Introduce do_each_proc_net_dev() helper Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 2/4] iptunnel: Use do_each_proc_net_dev() Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 3/4] ip6tunnel: " Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 4/4] tuntap: " Serhey Popovych
2018-01-31 23:04 ` [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev Stephen Hemminger
2018-02-01  3:17   ` David Ahern
2018-02-01 19:49   ` Serhey Popovych

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).