summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/linux/netlink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 5a0b4d0c..6e3fe488 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -725,6 +725,10 @@ nl_parse_multipath(struct nl_parse_state *s, struct krt_proto *p, struct rtattr
nh = RTNH_NEXT(nh);
}
+ /* Ensure nexthops are sorted to satisfy nest invariant */
+ if (!nexthop_is_sorted(first))
+ first = nexthop_sort(first);
+
return first;
}