kernel-netlink: Fix lookup of next hops for destinations with prefix
authorTobias Brunner <tobias@strongswan.org>
Fri, 11 Mar 2016 17:39:35 +0000 (18:39 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 21 Mar 2016 11:14:59 +0000 (12:14 +0100)
References #1347.

src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index abe29e2..f4394a1 100644 (file)
@@ -1710,9 +1710,10 @@ static host_t *get_route(private_kernel_netlink_net_t *this, host_t *dest,
                chunk = candidate->get_address(candidate);
                netlink_add_attribute(hdr, RTA_PREFSRC, chunk, sizeof(request));
        }
+       /* we use this below to match against the routes */
+       chunk = dest->get_address(dest);
        if (!match_net)
        {
-               chunk = dest->get_address(dest);
                netlink_add_attribute(hdr, RTA_DST, chunk, sizeof(request));
        }