fprintf(f, "state %#x ", state);
} else if (brief) {
color_fprintf(f, oper_state_color(state),
- "%-14s ", oper_states[state]);
+ "%-14s ", oper_states[state]);
} else {
fprintf(f, "state ");
color_fprintf(f, oper_state_color(state),
- "%s ", oper_states[state]);
+ "%s ", oper_states[state]);
}
}
if (vf_spoofchk->setting != -1)
fprintf(fp, ", spoof checking %s",
- vf_spoofchk->setting ? "on" : "off");
+ vf_spoofchk->setting ? "on" : "off");
}
if (vf[IFLA_VF_LINK_STATE]) {
struct ifla_vf_link_state *vf_linkstate =
if (vf_trust->setting != -1)
fprintf(fp, ", trust %s",
- vf_trust->setting ? "on" : "off");
+ vf_trust->setting ? "on" : "off");
}
if (vf[IFLA_VF_STATS] && show_stats)
print_vf_stats64(fp, vf[IFLA_VF_STATS]);
}
/* increase value by a factor of 1000/1024 and print
- * if result is something a human can read */
+ * if result is something a human can read
+ */
for (;;) {
powi *= base;
if (count / base < powi)
return -1;
parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
- if (tb[IFLA_IFNAME] == NULL) {
+ if (tb[IFLA_IFNAME] == NULL)
fprintf(stderr, "BUG: device with ifindex %d has nil ifname\n", ifi->ifi_index);
- }
+
if (filter.label &&
(!filter.family || filter.family == AF_PACKET) &&
fnmatch(filter.label, RTA_DATA(tb[IFLA_IFNAME]), 0))
return 0;
parse_rtattr(tb, IFLA_MAX, IFLA_RTA(ifi), len);
- if (tb[IFLA_IFNAME] == NULL) {
+ if (tb[IFLA_IFNAME] == NULL)
fprintf(stderr, "BUG: device with ifindex %d has nil ifname\n", ifi->ifi_index);
- }
+
if (filter.label &&
(!filter.family || filter.family == AF_PACKET) &&
fnmatch(filter.label, RTA_DATA(tb[IFLA_IFNAME]), 0))
if (rta_tb[IFA_LOCAL]) {
color_fprintf(fp, ifa_family_color(ifa->ifa_family), "%s",
- format_host_rta(ifa->ifa_family,
- rta_tb[IFA_LOCAL]));
+ format_host_rta(ifa->ifa_family,
+ rta_tb[IFA_LOCAL]));
if (rta_tb[IFA_ADDRESS] &&
memcmp(RTA_DATA(rta_tb[IFA_ADDRESS]),
- RTA_DATA(rta_tb[IFA_LOCAL]),
- ifa->ifa_family == AF_INET ? 4 : 16)) {
+ RTA_DATA(rta_tb[IFA_LOCAL]),
+ ifa->ifa_family == AF_INET ? 4 : 16)) {
fprintf(fp, " peer ");
color_fprintf(fp, ifa_family_color(ifa->ifa_family),
- "%s", format_host_rta(ifa->ifa_family,
- rta_tb[IFA_ADDRESS]));
+ "%s", format_host_rta(ifa->ifa_family,
+ rta_tb[IFA_ADDRESS]));
}
fprintf(fp, "/%d ", ifa->ifa_prefixlen);
}
if (rta_tb[IFA_BROADCAST]) {
fprintf(fp, "brd ");
color_fprintf(fp, ifa_family_color(ifa->ifa_family), "%s ",
- format_host_rta(ifa->ifa_family,
- rta_tb[IFA_BROADCAST]));
+ format_host_rta(ifa->ifa_family,
+ rta_tb[IFA_BROADCAST]));
}
if (rta_tb[IFA_ANYCAST]) {
fprintf(fp, "any ");
color_fprintf(fp, ifa_family_color(ifa->ifa_family), "%s ",
- format_host_rta(ifa->ifa_family,
- rta_tb[IFA_ANYCAST]));
+ format_host_rta(ifa->ifa_family,
+ rta_tb[IFA_ANYCAST]));
}
fprintf(fp, "scope %s ", rtnl_rtscope_n2a(ifa->ifa_scope, b1, sizeof(b1)));
if (ifa_flags & IFA_F_SECONDARY) {
ifa_flags &= ~IFA_F_MCAUTOJOIN;
fprintf(fp, "autojoin ");
}
- if (!(ifa_flags & IFA_F_PERMANENT)) {
+ if (!(ifa_flags & IFA_F_PERMANENT))
fprintf(fp, "dynamic ");
- } else
+ else
ifa_flags &= ~IFA_F_PERMANENT;
if (ifa_flags & IFA_F_DADFAILED) {
ifa_flags &= ~IFA_F_DADFAILED;
filter.kind = *argv;
}
} else {
- if (strcmp(*argv, "dev") == 0) {
+ if (strcmp(*argv, "dev") == 0)
NEXT_ARG();
- } else if (matches(*argv, "help") == 0)
+ else if (matches(*argv, "help") == 0)
usage();
if (filter_dev)
duparg2("dev", *argv);
} else if (strcmp(*argv, "autojoin") == 0) {
ifa_flags |= IFA_F_MCAUTOJOIN;
} else {
- if (strcmp(*argv, "local") == 0) {
+ if (strcmp(*argv, "local") == 0)
NEXT_ARG();
- }
if (matches(*argv, "help") == 0)
usage();
if (local_len)
if (peer_len == 0 && local_len) {
if (cmd == RTM_DELADDR && lcl.family == AF_INET && !(lcl.flags & PREFIXLEN_SPECIFIED)) {
fprintf(stderr,
- "Warning: Executing wildcard deletion to stay compatible with old scripts.\n" \
- " Explicitly specify the prefix length (%s/%d) to avoid this warning.\n" \
- " This special behaviour is likely to disappear in further releases,\n" \
+ "Warning: Executing wildcard deletion to stay compatible with old scripts.\n"
+ " Explicitly specify the prefix length (%s/%d) to avoid this warning.\n"
+ " This special behaviour is likely to disappear in further releases,\n"
" fix your scripts!\n", lcl_arg, local_len*8);
} else {
peer = lcl;