diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-02 18:23:06 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-07-02 18:23:06 +0200 |
commit | 59d3a3611f05c05040cec4bf09f31c26ade0fa0a (patch) | |
tree | aab1ddc488455681058e40e277a948462f00ae93 /sysdep | |
parent | 1187627a1dded6a3673c0d43033f431f15cd1b8f (diff) |
Netlink: Handle alien routes with unsorted nexthops
Nest requires that nexthops are sorted, the kernel protocol have to
ensure that for alien routes.
Diffstat (limited to 'sysdep')
-rw-r--r-- | sysdep/linux/netlink.c | 4 |
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; } |