From 59d3a3611f05c05040cec4bf09f31c26ade0fa0a Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Tue, 2 Jul 2019 18:23:06 +0200 Subject: Netlink: Handle alien routes with unsorted nexthops Nest requires that nexthops are sorted, the kernel protocol have to ensure that for alien routes. --- sysdep/linux/netlink.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdep/linux') 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; } -- cgit v1.2.3