From: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: "Pablo M. Bermudo Garay" <pablombg@gmail.com>
Subject: [PATCH iptables] libxt_iprange: remove extra space in translation
Date: Mon, 20 Jun 2016 12:24:56 +0200 [thread overview]
Message-ID: <20160620102456.31875-1-pablombg@gmail.com> (raw)
Extra space was printed by iprange_xlate:
# iptables-translate -A INPUT -m iprange --src-range \
192.168.25.149-192.168.25.151 -j ACCEPT
nft add rule ip filter INPUT ip saddr 192.168.25.149-192.168.25...
^^
Signed-off-by: Pablo M. Bermudo Garay <pablombg@gmail.com>
---
extensions/libxt_iprange.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/extensions/libxt_iprange.c b/extensions/libxt_iprange.c
index c2d51e9..8da7de1 100644
--- a/extensions/libxt_iprange.c
+++ b/extensions/libxt_iprange.c
@@ -322,14 +322,14 @@ static int iprange_xlate(const void *ip, const struct xt_entry_match *match,
if (info->flags & IPRANGE_SRC) {
if (info->flags & IPRANGE_SRC_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip saddr");
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip saddr");
print_iprange_xlate(&info->src, xl);
}
if (info->flags & IPRANGE_DST) {
if (info->flags & IPRANGE_DST_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip daddr");
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip daddr");
print_iprange_xlate(&info->dst, xl);
}
@@ -343,16 +343,16 @@ static int iprange_mt4_xlate(const void *ip, const struct xt_entry_match *match,
if (info->flags & IPRANGE_SRC) {
if (info->flags & IPRANGE_SRC_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip saddr %s",
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip saddr %s",
xtables_ipaddr_to_numeric(&info->src_min.in));
xt_xlate_add(xl, "-%s ",
xtables_ipaddr_to_numeric(&info->src_max.in));
}
if (info->flags & IPRANGE_DST) {
if (info->flags & IPRANGE_DST_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip daddr %s",
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip daddr %s",
xtables_ipaddr_to_numeric(&info->dst_min.in));
xt_xlate_add(xl, "-%s ",
xtables_ipaddr_to_numeric(&info->dst_max.in));
@@ -368,16 +368,16 @@ static int iprange_mt6_xlate(const void *ip, const struct xt_entry_match *match,
if (info->flags & IPRANGE_SRC) {
if (info->flags & IPRANGE_SRC_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip saddr %s",
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip saddr %s",
xtables_ip6addr_to_numeric(&info->src_min.in6));
xt_xlate_add(xl, "-%s ",
xtables_ip6addr_to_numeric(&info->src_max.in6));
}
if (info->flags & IPRANGE_DST) {
if (info->flags & IPRANGE_DST_INV)
- xt_xlate_add(xl, " !=");
- xt_xlate_add(xl, " ip daddr %s",
+ xt_xlate_add(xl, "!= ");
+ xt_xlate_add(xl, "ip daddr %s",
xtables_ip6addr_to_numeric(&info->dst_min.in6));
xt_xlate_add(xl, "-%s ",
xtables_ip6addr_to_numeric(&info->dst_max.in6));
--
2.8.3
next reply other threads:[~2016-06-20 10:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 10:24 Pablo M. Bermudo Garay [this message]
2016-06-22 17:57 ` [PATCH iptables] libxt_iprange: remove extra space in translation Pablo Neira Ayuso
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=20160620102456.31875-1-pablombg@gmail.com \
--to=pablombg@gmail.com \
--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).