Skip to contentSkip to conversation

connlabel: clarify default config path

PATCH In review Florian Westphal 2 participants 2 messages Jul 20, 2016 – Jul 21, 2016 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH v2 1/1 connlabel: clarify default config path

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

---
 extensions/libxt_connlabel.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
extensions/libxt_connlabel.c +5 -2
index 7e4ff26..2af5eca 100644
@@ -34,6 +34,8 @@ static const struct xt_option_entry connlabel_mt_opts[] = {
  */
 static void connlabel_open(void)
 {
+	const char *fname;
+
 	if (map)
 		return;
 
@@ -41,12 +43,13 @@ static void connlabel_open(void)
 	if (map != NULL)
 		return;
 
+	fname = nfct_labels_get_path();
 	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);
 	}
 }
 
Signature · 1 line
2.7.3