netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: <netfilter-devel@vger.kernel.org>
Cc: Florian Westphal <fw@strlen.de>
Subject: [PATCH iptables] connlabel: clarify default config path
Date: Wed, 20 Jul 2016 11:58:24 +0200	[thread overview]
Message-ID: <1469008704-22989-1-git-send-email-fw@strlen.de> (raw)

Pablo suggested to print full config file path for connlabel.conf
parsing errors.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 Pablo,

 I could also add the suggested nfct_labels_get_path() to lnf_conntrack
 but that means next iptables-release depends on a new library version.
 Given this name is set in stone anyway I would prefer this patch instead.

 Let me know, thanks.
 I will send a separate patch to change nftables location.

diff --git a/extensions/libxt_connlabel.c b/extensions/libxt_connlabel.c
index 7e4ff26..728f6ac 100644
--- a/extensions/libxt_connlabel.c
+++ b/extensions/libxt_connlabel.c
@@ -34,6 +34,8 @@ static const struct xt_option_entry connlabel_mt_opts[] = {
  */
 static void connlabel_open(void)
 {
+	static const char fname[]="/etc/xtables/connlabel.conf";
+
 	if (map)
 		return;
 
@@ -43,10 +45,10 @@ static void connlabel_open(void)
 
 	if (errno) {
 		xtables_error(RESOURCE_PROBLEM,
-			"cannot open connlabel.conf: %s", strerror(errno));
+			"cannot open %s: %s", fname, strerror(errno));
 	} else {
 		xtables_error(RESOURCE_PROBLEM,
-			"cannot parse label, maybe valid label map is empty");
+			"cannot parse %s: no labels found", fname);
 	}
 }
 
-- 
2.7.3


             reply	other threads:[~2016-07-20  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20  9:58 Florian Westphal [this message]
2016-07-20 16:22 ` [PATCH iptables] connlabel: clarify default config path Pablo Neira Ayuso
2016-07-20 16:31   ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469008704-22989-1-git-send-email-fw@strlen.de \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).