summaryrefslogtreecommitdiffstats
path: root/tests/nft-chain-test.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2015-06-11 20:43:54 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-06-16 17:29:57 +0200
commitbe97f91146d5717a1c6d43694fdb429b662846b3 (patch)
tree285f64e6801b1614c8a7e2c496a7dfa44bee8dab /tests/nft-chain-test.c
parent1dd9ba1ea23c46d2c9ea1685b458afb9af459e58 (diff)
chain: add netdev family support
Add support for the new NFT_CHAIN_ATTR_DEV attribute that indicates that the basechain is attached to a net_device. This partially reworks 1dd9ba1ea23c ("table: add netdev family support"). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests/nft-chain-test.c')
-rw-r--r--tests/nft-chain-test.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/nft-chain-test.c b/tests/nft-chain-test.c
index 1ff8334..ff8afed 100644
--- a/tests/nft-chain-test.c
+++ b/tests/nft-chain-test.c
@@ -59,6 +59,9 @@ static void cmp_nft_chain(struct nft_chain *a, struct nft_chain *b)
if (strcmp(nft_chain_attr_get_str(a, NFT_CHAIN_ATTR_TYPE),
nft_chain_attr_get_str(b, NFT_CHAIN_ATTR_TYPE)) != 0)
print_err("Chain type mismatches");
+ if (strcmp(nft_chain_attr_get_str(a, NFT_CHAIN_ATTR_DEV),
+ nft_chain_attr_get_str(b, NFT_CHAIN_ATTR_DEV)) != 0)
+ print_err("Chain device mismatches");
}
int main(int argc, char *argv[])
@@ -83,6 +86,7 @@ int main(int argc, char *argv[])
nft_chain_attr_set_u64(a, NFT_CHAIN_ATTR_BYTES, 0x1234567812345678);
nft_chain_attr_set_u64(a, NFT_CHAIN_ATTR_HANDLE, 0x1234567812345678);
nft_chain_attr_set_str(a, NFT_CHAIN_ATTR_TYPE, "Prueba");
+ nft_chain_attr_set_str(a, NFT_CHAIN_ATTR_DEV, "eth0");
/* cmd extracted from include/linux/netfilter/nf_tables.h */
nlh = nft_chain_nlmsg_build_hdr(buf, NFT_MSG_NEWCHAIN, AF_INET,