]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink: only display wanted chain in listing
authorEric Leblond <eric@regit.org>
Mon, 18 Nov 2013 07:40:21 +0000 (08:40 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 19 Nov 2013 20:31:32 +0000 (21:31 +0100)
commita6931ebc4742476ce3098d74e4ece263c65ae142
tree15bdf7d2abc11ecbff50fc234411c7b94fb51747
parent3451f89c65345dd22987c068647f54625b2f26ee
netlink: only display wanted chain in listing

When specifying a chain to list, all created chains were displayed
with a void content:

 # nft list chain filter
 table ip filter {
   chain input {
   }

   chain new {
    counter packets 17971 bytes 2380637 accept
    counter packets 0 bytes 0 accept
   }
  }

With the attached patch, only the asked chain is displayed:

  # nft list chain filter
  table ip filter {
   chain new {
    counter packets 17971 bytes 2380637 accept # handle 36
    counter packets 0 bytes 0 accept # handle 40
   }
  }

Signed-off-by: Eric Leblond <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c