]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net-procfs: show net devices bound packet types
authorJianguo Wu <wujianguo@chinatelecom.cn>
Fri, 21 Jan 2022 09:15:31 +0000 (17:15 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Thu, 3 Feb 2022 09:28:51 +0000 (10:28 +0100)
commit1f6b9306b030e9a321140cc0c978ca1f0f21a175
treec331e2bae478c8d1519efae1b49be618063434b9
parent5d26fecc093343e088417c697029f512dd8cdd50
net-procfs: show net devices bound packet types

BugLink: https://bugs.launchpad.net/bugs/1959879
commit 1d10f8a1f40b965d449e8f2d5ed7b96a7c138b77 upstream.

After commit:7866a621043f ("dev: add per net_device packet type chains"),
we can not get packet types that are bound to a specified net device by
/proc/net/ptype, this patch fix the regression.

Run "tcpdump -i ens192 udp -nns0" Before and after apply this patch:

Before:
  [root@localhost ~]# cat /proc/net/ptype
  Type Device      Function
  0800          ip_rcv
  0806          arp_rcv
  86dd          ipv6_rcv

After:
  [root@localhost ~]# cat /proc/net/ptype
  Type Device      Function
  ALL  ens192   tpacket_rcv
  0800          ip_rcv
  0806          arp_rcv
  86dd          ipv6_rcv

v1 -> v2:
  - fix the regression rather than adding new /proc API as
    suggested by Stephen Hemminger.

Fixes: 7866a621043f ("dev: add per net_device packet type chains")
Signed-off-by: Jianguo Wu <wujianguo@chinatelecom.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/core/net-procfs.c