lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211009164249.euf7dfpccr6kz7a3@skbuf>
Date:   Sat, 9 Oct 2021 19:42:49 +0300
From:   Vladimir Oltean <olteanv@...il.com>
To:     Yajun Deng <yajun.deng@...ux.dev>
Cc:     davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: procfs: add seq_puts() statement for
 dev_mcast

On Sat, Oct 09, 2021 at 07:35:11PM +0300, Vladimir Oltean wrote:
> On Mon, Aug 16, 2021 at 04:57:57PM +0800, Yajun Deng wrote:
> > Add seq_puts() statement for dev_mcast, make it more readable.
> > As also, keep vertical alignment for {dev, ptype, dev_mcast} that
> > under /proc/net.
> > 
> > Signed-off-by: Yajun Deng <yajun.deng@...ux.dev>
> > ---
> 
> FYI, this program got broken by this commit (reverting it restores
> functionality):
> 
> root@...ian:~# ifstat
> ifstat: /proc/net/dev: unsupported format.
> 
> Confusingly enough, the "ifstat" provided by Debian is not from iproute2:
> https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/tree/misc/ifstat.c
> but rather a similarly named program:
> https://packages.debian.org/source/bullseye/ifstat
> https://github.com/matttbe/ifstat
> 
> I haven't studied how this program parses /proc/net/dev, but here's how
> the kernel's output changed:

Ah, it scrapes the text for "Inter-|":
https://github.com/matttbe/ifstat/blob/main/drivers.c#L825

> 
> Doesn't work:
> 
> root@...ian:~# cat /proc/net/dev
> Interface|                            Receive                                       |                                 Transmit
>          |            bytes      packets errs   drop fifo frame compressed multicast|            bytes      packets errs   drop fifo colls carrier compressed
>        lo:            97400         1204    0      0    0     0          0         0            97400         1204    0      0    0     0       0          0
>     bond0:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>      sit0:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>      eno2:          5002206         6651    0      0    0     0          0         0        105518642      1465023    0      0    0     0       0          0
>      swp0:           134531         2448    0      0    0     0          0         0         99599598      1464381    0      0    0     0       0          0
>      swp1:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>      swp2:          4867675         4203    0      0    0     0          0         0            58134          631    0      0    0     0       0          0
>     sw0p0:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>     sw0p1:           124739         2448    0   1422    0     0          0         0         93741184      1464369    0      0    0     0       0          0
>     sw0p2:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>     sw2p0:          4850863         4203    0      0    0     0          0         0            54722          619    0      0    0     0       0          0
>     sw2p1:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>     sw2p2:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>     sw2p3:                0            0    0      0    0     0          0         0                0            0    0      0    0     0       0          0
>       br0:            10508          212    0    212    0     0          0       212         61369558       958857    0      0    0     0       0          0
> 
> Works:
> 
> root@...ian:~# cat /proc/net/dev
> Inter-|   Receive                                                |  Transmit
>  face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
>     lo:   13160     164    0    0    0     0          0         0    13160     164    0    0    0     0       0          0
>  bond0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>   sit0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>   eno2:   30824     268    0    0    0     0          0         0     3332      37    0    0    0     0       0          0
>   swp0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>   swp1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>   swp2:   30824     268    0    0    0     0          0         0     2428      27    0    0    0     0       0          0
>  sw0p0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>  sw0p1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>  sw0p2:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>  sw2p0:   29752     268    0    0    0     0          0         0     1564      17    0    0    0     0       0          0
>  sw2p1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>  sw2p2:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
>  sw2p3:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ