diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2017-09-23 13:08:12 -0300 |
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2017-09-28 21:50:46 -0300 |
| commit | 9e452e5dd18536c3fdec61c769061047af6e32ae (patch) | |
| tree | e703821a354fc382dc021f1b0ab663a93c238f74 /ldpd/adjacency.c | |
| parent | 2d9c2ae397eb30f8c62a6dc11ade108d7456f802 (diff) | |
ldpd: improve ordering of interfaces on user output
Before:
debian# show mpls ldp interface
AF Interface State Uptime Hello Timers ac
ipv4 rt0-eth0 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth1 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth10 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth11 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth2 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth3 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth4 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth5 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth6 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth7 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth8 ACTIVE 00:00:05 5/15 1
ipv4 rt0-eth9 ACTIVE 00:00:05 5/15 1
After:
debian# show mpls ldp interface
AF Interface State Uptime Hello Timers ac
ipv4 rt0-eth0 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth1 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth2 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth3 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth4 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth5 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth6 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth7 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth8 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth9 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth10 ACTIVE 00:00:14 5/15 1
ipv4 rt0-eth11 ACTIVE 00:00:14 5/15 1
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/adjacency.c')
| -rw-r--r-- | ldpd/adjacency.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c index 5b0723a008..7e4f0fd78b 100644 --- a/ldpd/adjacency.c +++ b/ldpd/adjacency.c @@ -60,11 +60,11 @@ adj_compare(const struct adj *a, const struct adj *b) switch (a->source.type) { case HELLO_LINK: - if (strcmp(a->source.link.ia->iface->name, - b->source.link.ia->iface->name) < 0) + if (if_cmp_name_func((char *)a->source.link.ia->iface->name, + (char *)b->source.link.ia->iface->name) < 0) return (-1); - if (strcmp(a->source.link.ia->iface->name, - b->source.link.ia->iface->name) > 0) + if (if_cmp_name_func((char *)a->source.link.ia->iface->name, + (char *)b->source.link.ia->iface->name) > 0) return (1); return (ldp_addrcmp(a->source.link.ia->af, &a->source.link.src_addr, &b->source.link.src_addr)); |
