Commit 8de592d0 authored by Phil Sutter's avatar Phil Sutter Committed by Stephen Hemminger

ip{, 6}tunnel: get rid of extraneous whitespace when printing

Put whitespace in the beginning of optional parts, not as suffix
anywhere. Also drop double whitespaces in between words.
Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
parent caf8875b
...@@ -111,9 +111,9 @@ static void print_tunnel(struct ip6_tnl_parm2 *p) ...@@ -111,9 +111,9 @@ static void print_tunnel(struct ip6_tnl_parm2 *p)
printf(" key %u", ntohl(p->i_key)); printf(" key %u", ntohl(p->i_key));
else if ((p->i_flags|p->o_flags)&GRE_KEY) { else if ((p->i_flags|p->o_flags)&GRE_KEY) {
if (p->i_flags&GRE_KEY) if (p->i_flags&GRE_KEY)
printf(" ikey %u ", ntohl(p->i_key)); printf(" ikey %u", ntohl(p->i_key));
if (p->o_flags&GRE_KEY) if (p->o_flags&GRE_KEY)
printf(" okey %u ", ntohl(p->o_key)); printf(" okey %u", ntohl(p->o_key));
} }
if (p->i_flags&GRE_SEQ) if (p->i_flags&GRE_SEQ)
......
...@@ -343,7 +343,7 @@ static void print_tunnel(struct ip_tunnel_parm *p) ...@@ -343,7 +343,7 @@ static void print_tunnel(struct ip_tunnel_parm *p)
/* Do not use format_host() for local addr, /* Do not use format_host() for local addr,
* symbolic name will not be useful. * symbolic name will not be useful.
*/ */
printf("%s: %s/ip remote %s local %s ", printf("%s: %s/ip remote %s local %s",
p->name, p->name,
tnl_strproto(p->iph.protocol), tnl_strproto(p->iph.protocol),
p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1)) : "any", p->iph.daddr ? format_host(AF_INET, 4, &p->iph.daddr, s1, sizeof(s1)) : "any",
...@@ -371,13 +371,13 @@ static void print_tunnel(struct ip_tunnel_parm *p) ...@@ -371,13 +371,13 @@ static void print_tunnel(struct ip_tunnel_parm *p)
if (p->link) { if (p->link) {
const char *n = ll_index_to_name(p->link); const char *n = ll_index_to_name(p->link);
if (n) if (n)
printf(" dev %s ", n); printf(" dev %s", n);
} }
if (p->iph.ttl) if (p->iph.ttl)
printf(" ttl %d ", p->iph.ttl); printf(" ttl %d", p->iph.ttl);
else else
printf(" ttl inherit "); printf(" ttl inherit");
if (p->iph.tos) { if (p->iph.tos) {
SPRINT_BUF(b1); SPRINT_BUF(b1);
...@@ -393,11 +393,11 @@ static void print_tunnel(struct ip_tunnel_parm *p) ...@@ -393,11 +393,11 @@ static void print_tunnel(struct ip_tunnel_parm *p)
printf(" nopmtudisc"); printf(" nopmtudisc");
if (p->iph.protocol == IPPROTO_IPV6 && !tnl_ioctl_get_6rd(p->name, &ip6rd) && ip6rd.prefixlen) { if (p->iph.protocol == IPPROTO_IPV6 && !tnl_ioctl_get_6rd(p->name, &ip6rd) && ip6rd.prefixlen) {
printf(" 6rd-prefix %s/%u ", printf(" 6rd-prefix %s/%u",
inet_ntop(AF_INET6, &ip6rd.prefix, s1, sizeof(s1)), inet_ntop(AF_INET6, &ip6rd.prefix, s1, sizeof(s1)),
ip6rd.prefixlen); ip6rd.prefixlen);
if (ip6rd.relay_prefix) { if (ip6rd.relay_prefix) {
printf("6rd-relay_prefix %s/%u ", printf(" 6rd-relay_prefix %s/%u",
format_host(AF_INET, 4, &ip6rd.relay_prefix, s1, sizeof(s1)), format_host(AF_INET, 4, &ip6rd.relay_prefix, s1, sizeof(s1)),
ip6rd.relay_prefixlen); ip6rd.relay_prefixlen);
} }
...@@ -407,9 +407,9 @@ static void print_tunnel(struct ip_tunnel_parm *p) ...@@ -407,9 +407,9 @@ static void print_tunnel(struct ip_tunnel_parm *p)
printf(" key %u", ntohl(p->i_key)); printf(" key %u", ntohl(p->i_key));
else if ((p->i_flags|p->o_flags)&GRE_KEY) { else if ((p->i_flags|p->o_flags)&GRE_KEY) {
if (p->i_flags&GRE_KEY) if (p->i_flags&GRE_KEY)
printf(" ikey %u ", ntohl(p->i_key)); printf(" ikey %u", ntohl(p->i_key));
if (p->o_flags&GRE_KEY) if (p->o_flags&GRE_KEY)
printf(" okey %u ", ntohl(p->o_key)); printf(" okey %u", ntohl(p->o_key));
} }
if (p->i_flags&GRE_SEQ) if (p->i_flags&GRE_SEQ)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment