mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-05 21:31:18 +00:00
iproute: Parse last nexthop in a multipath route
Continue parsing a multipath payload as long as another nexthop can fit
in the payload.
# ip route add 192.0.2.0/24 nexthop dev dummy0 nexthop dev dummy1
Before:
# ip route show 192.0.2.0/24
192.0.2.0/24
nexthop dev dummy0 weight 1
After:
# ip route show 192.0.2.0/24
192.0.2.0/24
nexthop dev dummy0 weight 1
nexthop dev dummy1 weight 1
Fixes: f48e14880a ("iproute: refactor multipath print")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
37bf5c6fcb
commit
c0ec7c9f87
@ -650,7 +650,7 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
|
||||
int len = RTA_PAYLOAD(rta);
|
||||
int first = 1;
|
||||
|
||||
while (len > sizeof(*nh)) {
|
||||
while (len >= sizeof(*nh)) {
|
||||
struct rtattr *tb[RTA_MAX + 1];
|
||||
|
||||
if (nh->rtnh_len > len)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user