From patchwork Tue Feb 11 16:36:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Bursztyka X-Patchwork-Id: 319334 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 2DA2D2C00B0 for ; Wed, 12 Feb 2014 03:37:09 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752516AbaBKQhE (ORCPT ); Tue, 11 Feb 2014 11:37:04 -0500 Received: from mga11.intel.com ([192.55.52.93]:62651 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753160AbaBKQhC (ORCPT ); Tue, 11 Feb 2014 11:37:02 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 11 Feb 2014 08:37:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,826,1384329600"; d="scan'208";a="479719199" Received: from davidllo-mobl.ger.corp.intel.com (HELO rd-190.ger.corp.intel.com) ([10.252.123.163]) by fmsmga002.fm.intel.com with ESMTP; 11 Feb 2014 08:37:00 -0800 From: Tomasz Bursztyka To: netfilter-devel@vger.kernel.org Cc: Tomasz Bursztyka Subject: [iptables (nft-compat) PATCH 5/5] nft: Pass a line after printing out a debug message Date: Tue, 11 Feb 2014 18:36:46 +0200 Message-Id: <1392136606-10339-6-git-send-email-tomasz.bursztyka@linux.intel.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392136606-10339-1-git-send-email-tomasz.bursztyka@linux.intel.com> References: <1392136606-10339-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 In this specific places, libnftnl gives back a string on which iptables should not assume any line break, thus it's up to iptables to add it. Signed-off-by: Tomasz Bursztyka --- iptables/nft.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iptables/nft.c b/iptables/nft.c index 32d3dbb..f6d5263 100644 --- a/iptables/nft.c +++ b/iptables/nft.c @@ -458,7 +458,7 @@ nft_table_builtin_add(struct nft_handle *h, struct builtin_table *_t, char tmp[1024]; nft_table_snprintf(tmp, sizeof(tmp), t, 0, 0); - printf("DEBUG: table: %s", tmp); + printf("DEBUG: table: %s\n", tmp); mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len, sizeof(struct nfgenmsg)); #endif @@ -702,7 +702,7 @@ static void nft_chain_print_debug(struct nft_chain *c, struct nlmsghdr *nlh) char tmp[1024]; nft_chain_snprintf(tmp, sizeof(tmp), c, 0, 0); - printf("DEBUG: chain: %s", tmp); + printf("DEBUG: chain: %s\n", tmp); mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len, sizeof(struct nfgenmsg)); #endif } @@ -898,7 +898,7 @@ static void nft_rule_print_debug(struct nft_rule *r, struct nlmsghdr *nlh) char tmp[1024]; nft_rule_snprintf(tmp, sizeof(tmp), r, 0, 0); - printf("DEBUG: rule: %s", tmp); + printf("DEBUG: rule: %s\n", tmp); mnl_nlmsg_fprintf(stdout, nlh, nlh->nlmsg_len, sizeof(struct nfgenmsg)); #endif }