iproute: Fix for missing 'Oifs:' display
Covscan complained about dead code but after reading it, I assume the author's intention was to prefix the interface list with 'Oifs: '. Initializing first to 1 and setting it to 0 after above prefix was printed should fix it. Signed-off-by: Phil Sutter <phil@nwl.cc>
This commit is contained in:
parent
2869262144
commit
2a86625619
|
|
@ -624,7 +624,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
||||||
}
|
}
|
||||||
if (tb[RTA_MULTIPATH]) {
|
if (tb[RTA_MULTIPATH]) {
|
||||||
struct rtnexthop *nh = RTA_DATA(tb[RTA_MULTIPATH]);
|
struct rtnexthop *nh = RTA_DATA(tb[RTA_MULTIPATH]);
|
||||||
int first = 0;
|
int first = 1;
|
||||||
|
|
||||||
len = RTA_PAYLOAD(tb[RTA_MULTIPATH]);
|
len = RTA_PAYLOAD(tb[RTA_MULTIPATH]);
|
||||||
|
|
||||||
|
|
@ -634,10 +634,12 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
||||||
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: ");
|
||||||
else
|
first = 0;
|
||||||
|
} else {
|
||||||
fprintf(fp, " ");
|
fprintf(fp, " ");
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
fprintf(fp, "%s\tnexthop ", _SL_);
|
fprintf(fp, "%s\tnexthop ", _SL_);
|
||||||
if (nh->rtnh_len > sizeof(*nh)) {
|
if (nh->rtnh_len > sizeof(*nh)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue