iproute: whitespace fixes

Add whitespace around operators for consistency.
Use tabs for indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
Stephen Hemminger 2018-02-07 16:25:04 -08:00 committed by David Ahern
parent 58cf7b6759
commit 80d1c528b9
1 changed files with 13 additions and 10 deletions

View File

@ -162,7 +162,7 @@ static int filter_nlmsg(struct nlmsghdr *n, struct rtattr **tb, int host_len)
if (r->rtm_family == AF_INET6 && table != RT_TABLE_MAIN) if (r->rtm_family == AF_INET6 && table != RT_TABLE_MAIN)
ip6_multiple_tables = 1; ip6_multiple_tables = 1;
if (filter.cloned == !(r->rtm_flags&RTM_F_CLONED)) if (filter.cloned == !(r->rtm_flags & RTM_F_CLONED))
return 0; return 0;
if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) { if (r->rtm_family == AF_INET6 && !ip6_multiple_tables) {
@ -566,7 +566,8 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
if (nh->rtnh_len > len) if (nh->rtnh_len > len)
break; break;
if (r->rtm_flags&RTM_F_CLONED && r->rtm_type == RTN_MULTICAST) { if ((r->rtm_flags & RTM_F_CLONED) &&
r->rtm_type == RTN_MULTICAST) {
if (first) { if (first) {
fprintf(fp, "Oifs: "); fprintf(fp, "Oifs: ");
first = 0; first = 0;
@ -594,7 +595,8 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
print_rta_flow(fp, tb[RTA_FLOW]); print_rta_flow(fp, tb[RTA_FLOW]);
} }
if (r->rtm_flags&RTM_F_CLONED && r->rtm_type == RTN_MULTICAST) { if ((r->rtm_flags & RTM_F_CLONED) &&
r->rtm_type == RTN_MULTICAST) {
fprintf(fp, "%s", ll_index_to_name(nh->rtnh_ifindex)); fprintf(fp, "%s", ll_index_to_name(nh->rtnh_ifindex));
if (nh->rtnh_hops != 1) if (nh->rtnh_hops != 1)
fprintf(fp, "(ttl>%d)", nh->rtnh_hops); fprintf(fp, "(ttl>%d)", nh->rtnh_hops);
@ -722,7 +724,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if (table && (table != RT_TABLE_MAIN || show_details > 0) && !filter.tb) if (table && (table != RT_TABLE_MAIN || show_details > 0) && !filter.tb)
fprintf(fp, "table %s ", rtnl_rttable_n2a(table, b1, sizeof(b1))); fprintf(fp, "table %s ", rtnl_rttable_n2a(table, b1, sizeof(b1)));
if (!(r->rtm_flags&RTM_F_CLONED)) { if (!(r->rtm_flags & RTM_F_CLONED)) {
if ((r->rtm_protocol != RTPROT_BOOT || show_details > 0) && filter.protocolmask != -1) if ((r->rtm_protocol != RTPROT_BOOT || show_details > 0) && filter.protocolmask != -1)
fprintf(fp, "proto %s ", rtnl_rtprot_n2a(r->rtm_protocol, b1, sizeof(b1))); fprintf(fp, "proto %s ", rtnl_rtprot_n2a(r->rtm_protocol, b1, sizeof(b1)));
if ((r->rtm_scope != RT_SCOPE_UNIVERSE || show_details > 0) && filter.scopemask != -1) if ((r->rtm_scope != RT_SCOPE_UNIVERSE || show_details > 0) && filter.scopemask != -1)
@ -764,7 +766,6 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO])); print_rta_cacheinfo(fp, RTA_DATA(tb[RTA_CACHEINFO]));
} else if (r->rtm_family == AF_INET6) { } else if (r->rtm_family == AF_INET6) {
if (r->rtm_flags & RTM_F_CLONED) if (r->rtm_flags & RTM_F_CLONED)
fprintf(fp, "%s cache ", _SL_); fprintf(fp, "%s cache ", _SL_);
@ -2117,6 +2118,8 @@ int do_iproute(int argc, char **argv)
return iproute_showdump(); return iproute_showdump();
if (matches(*argv, "help") == 0) if (matches(*argv, "help") == 0)
usage(); usage();
fprintf(stderr, "Command \"%s\" is unknown, try \"ip route help\".\n", *argv);
fprintf(stderr,
"Command \"%s\" is unknown, try \"ip route help\".\n", *argv);
exit(-1); exit(-1);
} }