• Jianguo Wu's avatar
    net-procfs: show net devices bound packet types · 1d10f8a1
    Jianguo Wu authored
    After commit:7866a621 ("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: 7866a621 ("dev: add per net_device packet type chains")
    Signed-off-by: default avatarJianguo Wu <wujianguo@chinatelecom.cn>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1d10f8a1
net-procfs.c 9.3 KB