From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH v3 4/7] xtables-restore: Remove some pointless linebreaks
Date: Thu, 24 Oct 2019 18:37:09 +0200 [thread overview]
Message-ID: <20191024163712.22405-5-phil@nwl.cc> (raw)
In-Reply-To: <20191024163712.22405-1-phil@nwl.cc>
Due to reduced indenting level, some linebreaks are no longer needed.
OTOH, strings should not be split to aid in grepping for error output.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/xtables-restore.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index d21e9730805a8..83e05102769a7 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -125,8 +125,7 @@ static void xtables_restore_parse_line(struct nft_handle *h,
return;
if (h->noflush == 0) {
- DEBUGP("Cleaning all chains of table '%s'\n",
- table);
+ DEBUGP("Cleaning all chains of table '%s'\n", table);
if (cb->table_flush)
cb->table_flush(h, table);
}
@@ -151,8 +150,7 @@ static void xtables_restore_parse_line(struct nft_handle *h,
if (strlen(chain) >= XT_EXTENSION_MAXNAMELEN)
xtables_error(PARAMETER_PROBLEM,
- "Invalid chain name `%s' "
- "(%u chars max)",
+ "Invalid chain name `%s' (%u chars max)",
chain, XT_EXTENSION_MAXNAMELEN - 1);
policy = strtok(NULL, " \t\n");
@@ -169,16 +167,15 @@ static void xtables_restore_parse_line(struct nft_handle *h,
if (!ctrs || !parse_counters(ctrs, &count))
xtables_error(PARAMETER_PROBLEM,
- "invalid policy counters "
- "for chain '%s'\n", chain);
+ "invalid policy counters for chain '%s'\n",
+ chain);
}
if (cb->chain_set &&
cb->chain_set(h, state->curtable->name,
chain, policy, &count) < 0) {
xtables_error(OTHER_PROBLEM,
- "Can't set policy `%s'"
- " on `%s' line %u: %s\n",
+ "Can't set policy `%s' on `%s' line %u: %s\n",
policy, chain, line,
strerror(errno));
}
@@ -187,15 +184,13 @@ static void xtables_restore_parse_line(struct nft_handle *h,
} else if (cb->chain_restore(h, chain, state->curtable->name) < 0 &&
errno != EEXIST) {
xtables_error(PARAMETER_PROBLEM,
- "cannot create chain "
- "'%s' (%s)\n", chain,
- strerror(errno));
+ "cannot create chain '%s' (%s)\n",
+ chain, strerror(errno));
} else if (h->family == NFPROTO_BRIDGE &&
!ebt_set_user_chain_policy(h, state->curtable->name,
chain, policy)) {
xtables_error(OTHER_PROBLEM,
- "Can't set policy `%s'"
- " on `%s' line %u: %s\n",
+ "Can't set policy `%s' on `%s' line %u: %s\n",
policy, chain, line,
strerror(errno));
}
@@ -232,8 +227,8 @@ static void xtables_restore_parse_line(struct nft_handle *h,
ret = 0;
if (ret < 0) {
- fprintf(stderr, "failed to abort "
- "commit operation\n");
+ fprintf(stderr,
+ "failed to abort commit operation\n");
}
exit(1);
}
--
2.23.0
next prev parent reply other threads:[~2019-10-24 16:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 16:37 [iptables PATCH v3 0/7] Improve xtables-restore performance Phil Sutter
2019-10-24 16:37 ` [iptables PATCH v3 1/7] xtables-restore: Integrate restore callbacks into struct nft_xt_restore_parse Phil Sutter
2019-10-24 16:37 ` [iptables PATCH v3 2/7] xtables-restore: Introduce struct nft_xt_restore_state Phil Sutter
2019-10-24 16:37 ` [iptables PATCH v3 3/7] xtables-restore: Introduce line parsing function Phil Sutter
2019-10-24 16:37 ` Phil Sutter [this message]
2019-10-24 16:37 ` [iptables PATCH v3 5/7] xtables-restore: Allow lines without trailing newline character Phil Sutter
2019-10-24 16:37 ` [iptables PATCH v3 6/7] xtables-restore: Improve performance of --noflush operation Phil Sutter
2019-10-24 16:37 ` [iptables PATCH v3 7/7] tests: shell: Add ipt-restore/0007-flush-noflush_0 Phil Sutter
2019-10-31 15:02 ` [iptables PATCH v3 0/7] Improve xtables-restore performance Pablo Neira Ayuso
2019-10-31 17:19 ` Phil Sutter
2019-11-06 9:24 ` Pablo Neira Ayuso
2019-11-06 12:31 ` Phil Sutter
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=20191024163712.22405-5-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).