From patchwork Tue May 14 10:52:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Bursztyka X-Patchwork-Id: 243675 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 858502C00B0 for ; Tue, 14 May 2013 20:52:21 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757027Ab3ENKwP (ORCPT ); Tue, 14 May 2013 06:52:15 -0400 Received: from mga11.intel.com ([192.55.52.93]:46611 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757019Ab3ENKwO (ORCPT ); Tue, 14 May 2013 06:52:14 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 14 May 2013 03:52:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,670,1363158000"; d="scan'208";a="333806177" Received: from rd-180.fi.intel.com ([10.237.68.33]) by fmsmga001.fm.intel.com with ESMTP; 14 May 2013 03:52:11 -0700 From: Tomasz Bursztyka To: netfilter-devel@vger.kernel.org Cc: Tomasz Bursztyka Subject: [iptables-nftables PATCH 1/6] xtables: initialize xtables defaults even on listing rules Date: Tue, 14 May 2013 13:52:02 +0300 Message-Id: <1368528727-10127-2-git-send-email-tomasz.bursztyka@linux.intel.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1368528727-10127-1-git-send-email-tomasz.bursztyka@linux.intel.com> References: <519216B6.7060701@linux.intel.com> <1368528727-10127-1-git-send-email-tomasz.bursztyka@linux.intel.com> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Output of the tool should be the same as for iptables. Signed-off-by: Tomasz Bursztyka --- iptables/nft.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iptables/nft.c b/iptables/nft.c index e68d112..f5d96bc 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -2477,6 +2477,10 @@ int nft_rule_list(struct nft_handle *h, const char *chain, const char *table, struct nft_chain_list_iter *iter; struct nft_chain *c; + /* If built-in chains don't exist for this table, create them */ + if (nft_xtables_config_load(h, XTABLES_CONFIG_DEFAULT, 0) < 0) + nft_chain_builtin_init(h, table, NULL, NF_ACCEPT); + list = nft_chain_dump(h); iter = nft_chain_list_iter_create(list);